You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2261 lines
73 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div class="mod-config yzzInput yzz">
  3. <el-form :inline="true" label-position="top" style="margin-top: -0px">
  4. <el-row :gutter="20">
  5. <el-col :span="20">
  6. <el-button v-if="notifyNo===''" @click="addNotify()" class="yzzButtonAn">新建申请单</el-button>
  7. <el-button v-if="notifyNo!=''" type="primary" @click="chooseSOSModal()" class="yzzButtonAn">选择派工单</el-button>
  8. <el-button v-if="notifyNo!=''" type="primary" @click="xiadaNotifyModel()" class="yzzButtonAn">下达申请单</el-button>
  9. <el-button v-if="notifyNo!=''" type="primary" @click="deleteNotify()" class="yzzButtonAn">删除申请单</el-button>
  10. <el-button v-if="notifyNo!=''" type="primary" @click="updateBuModel()" class="yzzButtonAn">修改BU</el-button>
  11. <el-button v-if="notifyNo!=''" type="primary" @click="noBomModel()" class="yzzButtonAn">非BOM物料</el-button>
  12. <el-button v-if="notifyNo!=''" type="primary" @click="noControlModel()" class="yzzButtonAn">不管控物料</el-button>
  13. </el-col>
  14. <el-col :span="4">
  15. <span @click="favoriteFunction()">
  16. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  17. </span>
  18. </el-col>
  19. </el-row>
  20. <el-row :gutter="20" v-if="notifyNo!=''">
  21. <el-col :span="2">
  22. <el-form-item :label="'工厂编码'" >
  23. <el-input v-model="notifyData.site" disabled ></el-input>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="2">
  27. <el-form-item :label="'BU'" >
  28. <el-input v-model="notifyData.bu" disabled ></el-input>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="2">
  32. <el-form-item :label="'申请单号'" >
  33. <el-input v-model="notifyData.notifyNo" disabled ></el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="2">
  37. <el-form-item :label="'申请账号'" >
  38. <el-input v-model="notifyData.userName" disabled ></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="3">
  42. <el-form-item :label="'申请时间'" >
  43. <el-input v-model="notifyData.enteredDate" disabled ></el-input>
  44. </el-form-item>
  45. </el-col>
  46. <!-- <el-col :span="4">-->
  47. <!-- <el-form-item :label="'要求发料日期'" >-->
  48. <!-- <el-date-picker-->
  49. <!-- v-model="notifyData.planIssueDate"-->
  50. <!-- type="date"-->
  51. <!-- value-format="yyyy-MM-dd"-->
  52. <!-- placeholder="选择日期">-->
  53. <!-- </el-date-picker>-->
  54. <!-- </el-form-item>-->
  55. <!-- </el-col>-->
  56. </el-row>
  57. <el-row :gutter="20" v-if="notifyNo!=''">
  58. <el-col :span="11">
  59. <el-form-item :label="'备注'" >
  60. <el-input v-model="notifyData.remark" ></el-input>
  61. </el-form-item>
  62. </el-col>
  63. </el-row>
  64. </el-form>
  65. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" v-if="notifyNo!=''" type="border-card" >
  66. <el-tab-pane label="已申请派工单" name="sos">
  67. <el-table
  68. :height="height"
  69. :data="dataList"
  70. border
  71. style="width: 100%;">
  72. <el-table-column
  73. v-for="(item,index) in columnList" :key="index"
  74. :sortable="item.columnSortable"
  75. :prop="item.columnProp"
  76. :header-align="item.headerAlign"
  77. :show-overflow-tooltip="item.showOverflowTooltip"
  78. :align="item.align"
  79. :fixed="item.fixed==''?false:item.fixed"
  80. :min-width="item.columnWidth"
  81. :label="item.columnLabel">
  82. <template slot-scope="scope">
  83. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  84. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. fixed="right"
  89. header-align="center"
  90. align="center"
  91. width="100"
  92. label="操作">
  93. <template slot-scope="scope">
  94. <a type="text" size="small" @click="enterSOSDetail(scope.row)">物料</a>
  95. <a type="text" size="small" @click="deleteNotifySOS(scope.row)">删除</a>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. </el-tab-pane>
  100. <el-tab-pane label="非BOM物料" name="noBom">
  101. <el-table
  102. :data="dataList2"
  103. :height="height"
  104. border
  105. style="width: 100%; ">
  106. <el-table-column
  107. v-for="(item,index) in columnList4" :key="index"
  108. :sortable="item.columnSortable"
  109. :prop="item.columnProp"
  110. :header-align="item.headerAlign"
  111. :show-overflow-tooltip="item.showOverflowTooltip"
  112. :align="item.align"
  113. :fixed="item.fixed==''?false:item.fixed"
  114. :min-width="item.columnWidth"
  115. :label="item.columnLabel">
  116. <template slot-scope="scope">
  117. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  118. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  119. style="width: 100px; height: 80px"/></span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column
  123. header-align="center"
  124. align="center"
  125. width="80"
  126. label="操作">
  127. <template slot-scope="scope">
  128. <a type="text" size="small" @click="deleteNotifyMaterial(scope.row)">删除</a>
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. </el-tab-pane>
  133. <el-tab-pane label="不管控物料" name="noControl">
  134. <el-table
  135. :data="dataList3"
  136. :height="height"
  137. border
  138. style="width: 100%; ">
  139. <el-table-column
  140. v-for="(item,index) in columnList4" :key="index"
  141. :sortable="item.columnSortable"
  142. :prop="item.columnProp"
  143. :header-align="item.headerAlign"
  144. :show-overflow-tooltip="item.showOverflowTooltip"
  145. :align="item.align"
  146. :fixed="item.fixed==''?false:item.fixed"
  147. :min-width="item.columnWidth"
  148. :label="item.columnLabel">
  149. <template slot-scope="scope">
  150. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  151. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  152. style="width: 100px; height: 80px"/></span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column
  156. header-align="center"
  157. align="center"
  158. width="80"
  159. label="操作">
  160. <template slot-scope="scope">
  161. <a type="text" size="small" @click="deleteNotifyMaterial(scope.row)">删除</a>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. </el-tab-pane>
  166. </el-tabs>
  167. <!-- <el-pagination-->
  168. <!-- @size-change="sizeChangeHandle"-->
  169. <!-- @current-change="currentChangeHandle"-->
  170. <!-- :current-page="pageIndex"-->
  171. <!-- :page-sizes="[20, 50, 100, 200, 500]"-->
  172. <!-- :page-size="pageSize"-->
  173. <!-- :total="totalPage"-->
  174. <!-- layout="total, sizes, prev, pager, next, jumper">-->
  175. <!-- </el-pagination>-->
  176. <el-dialog title="选择派工单" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="1000px">
  177. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  178. <el-row :gutter="20">
  179. <el-col :span="4">
  180. <el-form-item :label="'生产订单'" >
  181. <el-input v-model="seqNoData.orderno" ></el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="4">
  185. <el-form-item :label="'派工单号'" >
  186. <el-input v-model="seqNoData.seqno" ></el-input>
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="4">
  190. <el-form-item >
  191. <span slot="label" style="" @click="getBaseList(515)"><a herf="#">机台</a></span>
  192. <el-input v-model="seqNoData.sResourceid" ></el-input>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :span="4">
  196. <el-form-item >
  197. <span slot="label" style="" @click="getBaseList(216)"><a herf="#">加工中心</a></span>
  198. <el-input v-model="seqNoData.sWorkcenterno" ></el-input>
  199. </el-form-item>
  200. </el-col>
  201. <el-col :span="4">
  202. <el-form-item :label="'派工日期'" >
  203. <el-date-picker
  204. style="width: 100%"
  205. v-model="seqNoData.startDate"
  206. type="date"
  207. value-format="yyyy-MM-dd"
  208. placeholder="选择日期">
  209. </el-date-picker>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="4">
  213. <el-form-item :label="'到'" >
  214. <el-date-picker
  215. style="width: 100%"
  216. v-model="seqNoData.endDate"
  217. type="date"
  218. value-format="yyyy-MM-dd"
  219. placeholder="选择日期">
  220. </el-date-picker>
  221. </el-form-item>
  222. </el-col>
  223. </el-row>
  224. <el-row :gutter="20">
  225. <el-col :span="6">
  226. <el-form-item >
  227. <el-button type="primary" @click="searchSOSRouting()" style="margin-top: 5px" class="">查询</el-button>
  228. </el-form-item>
  229. </el-col>
  230. </el-row>
  231. </el-form>
  232. <el-table
  233. :height="400"
  234. :data="seqNoList"
  235. border
  236. style="width: 100%;">
  237. <el-table-column
  238. v-for="(item,index) in columnList2" :key="index"
  239. :sortable="item.columnSortable"
  240. :prop="item.columnProp"
  241. :header-align="item.headerAlign"
  242. :show-overflow-tooltip="item.showOverflowTooltip"
  243. :align="item.align"
  244. :fixed="item.fixed==''?false:item.fixed"
  245. :min-width="item.columnWidth"
  246. :label="item.columnLabel">
  247. <template slot-scope="scope">
  248. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  249. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  250. </template>
  251. </el-table-column>
  252. <el-table-column
  253. fixed="left"
  254. header-align="center"
  255. align="center"
  256. width="60"
  257. label="操作">
  258. <template slot-scope="scope">
  259. <a type="text" size="small" @click="chooseSOS(scope.row)">选择</a>
  260. </template>
  261. </el-table-column>
  262. </el-table>
  263. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  264. <el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button>
  265. </el-footer>
  266. </el-dialog>
  267. <el-dialog title="保存派工单" :close-on-click-modal="false" v-drag :visible.sync="saveSeqNoModalFlag" width="750px">
  268. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  269. <el-row :gutter="20">
  270. <el-col :span="6">
  271. <el-form-item :label="'生产订单'" >
  272. <el-input v-model="notifyOrderData.orderno" disabled ></el-input>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="6">
  276. <el-form-item :label="'派工单号'" >
  277. <el-input v-model="notifyOrderData.seqno" disabled ></el-input>
  278. </el-form-item>
  279. </el-col>
  280. <el-col :span="6">
  281. <el-form-item :label="'机台'" >
  282. <el-input v-model="notifyOrderData.sResourceid" disabled ></el-input>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="6">
  286. <el-form-item :label="'派工数量'" >
  287. <el-input v-model="notifyOrderData.qtyrequired" disabled ></el-input>
  288. </el-form-item>
  289. </el-col>
  290. </el-row>
  291. <el-row :gutter="20">
  292. <el-col :span="6">
  293. <el-form-item :label="'物料'" >
  294. <el-input v-model="notifyOrderData.orderno" disabled ></el-input>
  295. </el-form-item>
  296. </el-col>
  297. <el-col :span="18">
  298. <el-form-item :label="'物料名称'" >
  299. <el-input v-model="notifyOrderData.seqno" disabled ></el-input>
  300. </el-form-item>
  301. </el-col>
  302. </el-row>
  303. <el-row :gutter="20">
  304. <el-col :span="6">
  305. <el-form-item :label="'要求发料时间'" >
  306. <el-date-picker
  307. style="width: 165px"
  308. v-model="notifyOrderData.needDate"
  309. type="datetime"
  310. value-format="yyyy-MM-dd HH:mm"
  311. placeholder="选择日期">
  312. </el-date-picker>
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="6">
  316. <el-form-item label="机台">
  317. <!-- <span slot="label" style="" @click="getBaseList(215)"><a herf="#">机台</a></span>-->
  318. <el-input v-model="notifyOrderData.locationNo" disabled ></el-input>
  319. </el-form-item>
  320. </el-col>
  321. <el-col :span="6">
  322. <el-form-item :label="'此次领料数量'" >
  323. <el-input-number v-model="notifyOrderData.issureQty" style="padding: 0;width: 100%" :controls="false" :step="0" :min="0" ></el-input-number>
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="6">
  327. <el-form-item :label="' '" >
  328. <el-button type="primary" @click="qtyAllForSeqNo()">全数领料</el-button>
  329. </el-form-item>
  330. </el-col>
  331. </el-row>
  332. </el-form>
  333. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  334. <el-button type="primary" @click="saveSOS()">保存</el-button>
  335. <el-button type="primary" @click="saveSeqNoModalFlag=false">关闭</el-button>
  336. </el-footer>
  337. </el-dialog>
  338. <el-dialog title="变更BU" :close-on-click-modal="false" v-drag :visible.sync="changeBuFlag" width="350px">
  339. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  340. <el-row :gutter="20">
  341. <el-col :span="12">
  342. <el-form-item :label="'工厂编码'" >
  343. <el-input v-model="notifyData.site" disabled ></el-input>
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="12">
  347. <el-form-item :label="'申请单号'" >
  348. <el-input v-model="notifyData.notifyNo" disabled ></el-input>
  349. </el-form-item>
  350. </el-col>
  351. <el-col :span="12">
  352. <el-form-item :label="'BU'" >
  353. <el-select v-model="newBu" placeholder="请选择" style="width: 100%">
  354. <el-option
  355. v-for = "i in buList"
  356. :key = "i.buNo"
  357. :label = "i.buNo+' - '+i.buDesc"
  358. :value = "i.buNo">
  359. </el-option>
  360. </el-select>
  361. </el-form-item>
  362. </el-col>
  363. </el-row>
  364. </el-form>
  365. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  366. <el-button type="primary" @click="saveNewBu()">保存</el-button>
  367. <!-- <el-button type="primary" @click="ToSOS()">重新选择派工单</el-button>-->
  368. <el-button type="primary" @click="changeBuFlag=false">关闭</el-button>
  369. </el-footer>
  370. </el-dialog>
  371. <el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="900px">
  372. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  373. <el-row :gutter="20">
  374. <el-col :span="6">
  375. <el-form-item :label="'生产订单'" >
  376. <el-input v-model="sobomData.orderno" readonly ></el-input>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :span="6">
  380. <el-form-item :label="'派工单号'" >
  381. <el-input v-model="sobomData.seqno" readonly ></el-input>
  382. </el-form-item>
  383. </el-col>
  384. <el-col :span="6">
  385. <el-form-item :label="'产品编码'" >
  386. <el-input v-model="sobomData.partNo" readonly ></el-input>
  387. </el-form-item>
  388. </el-col>
  389. </el-row>
  390. </el-form>
  391. <div class="yzzTable">
  392. <el-table
  393. :height="400"
  394. :data="sobomList"
  395. border
  396. v-loading="bomLoadFlag"
  397. style="width: 100%;">
  398. <el-table-column
  399. v-for="(item,index) in columnList3" :key="index"
  400. :sortable="item.columnSortable"
  401. :prop="item.columnProp"
  402. :header-align="item.headerAlign"
  403. :show-overflow-tooltip="item.showOverflowTooltip"
  404. :align="item.align"
  405. :fixed="item.fixed==''?false:item.fixed"
  406. :min-width="item.columnWidth"
  407. :label="item.columnLabel">
  408. <template slot-scope="scope">
  409. <div v-if="item.columnProp === 'qtyToIssue'">
  410. <el-input-number v-model="scope.row.qtyToIssue" style="padding: 0;width: 100%" :step="0" :min="0" :controls="false"></el-input-number>
  411. </div>
  412. <div v-else-if="item.columnProp === 'remark'">
  413. <el-input v-model="scope.row.remark" style="padding: 0;width: 100%" ></el-input>
  414. </div>
  415. <div v-else>
  416. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  417. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  418. </div>
  419. </template>
  420. </el-table-column>
  421. <el-table-column
  422. prop=""
  423. header-align="center"
  424. align="center"
  425. min-width="50"
  426. label="操作">
  427. <template slot-scope="scope">
  428. <el-button type="primary" @click="qtyAllForBom(scope.row)" style="width: 100%">全数领料</el-button>
  429. </template>
  430. </el-table-column>
  431. </el-table>
  432. </div>
  433. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  434. <el-button type="primary" @click="saveMaterialDetail()">保存</el-button>
  435. <!-- <el-button type="primary" @click="ToSOS()">重新选择派工单</el-button>-->
  436. <el-button type="primary" @click="materialModalFlag=false">关闭</el-button>
  437. </el-footer>
  438. </el-dialog>
  439. <el-dialog
  440. width="600px"
  441. title="选择非BOM物料"
  442. :close-on-click-modal="false"
  443. :visible.sync="partModelFlag">
  444. <el-form :inline="true" label-position="top" label-width="100px" >
  445. <el-row :gutter="20">
  446. <el-col :span="6">
  447. <el-form-item style="margin-left: 0px" label="物料编码">
  448. <el-input v-model="partSearch.partNo" ></el-input>
  449. </el-form-item>
  450. </el-col>
  451. <el-col :span="6">
  452. <el-form-item style="margin-left: 0px" label="物料名称">
  453. <el-input v-model="partSearch.partDesc" ></el-input>
  454. </el-form-item>
  455. </el-col>
  456. <el-col :span="6">
  457. <el-form-item style="margin-left: 0px" label="规格型号">
  458. <el-input v-model="partSearch.spec" ></el-input>
  459. </el-form-item>
  460. </el-col>
  461. <el-col :span="6">
  462. <el-form-item label=" ">
  463. <el-button type="primary" @click="searchPartModel()">{{'查询'}}</el-button>
  464. </el-form-item>
  465. </el-col>
  466. </el-row>
  467. </el-form>
  468. <el-table
  469. height="450"
  470. :data="partList"
  471. border
  472. @row-dblclick="chooseNoBomPartNo"
  473. style="width: 100%;">
  474. <el-table-column
  475. prop="partNo"
  476. header-align="center"
  477. align="left"
  478. min-width="80"
  479. style="font-size: 20px"
  480. label="物料编码">
  481. </el-table-column>
  482. <el-table-column
  483. prop="partDesc"
  484. header-align="center"
  485. align="left"
  486. min-width="120"
  487. style="font-size: 20px"
  488. label="物料描述">
  489. </el-table-column>
  490. <el-table-column
  491. prop="spec"
  492. header-align="center"
  493. align="left"
  494. min-width="120"
  495. style="font-size: 20px"
  496. label="规格型号">
  497. </el-table-column>
  498. <el-table-column
  499. prop="sku"
  500. header-align="center"
  501. align="left"
  502. min-width="80"
  503. label="SKU">
  504. </el-table-column>
  505. <el-table-column
  506. prop="umid"
  507. header-align="center"
  508. align="left"
  509. min-width="60"
  510. label="计量单位">
  511. </el-table-column>
  512. </el-table>
  513. </el-dialog>
  514. <el-dialog
  515. width="600px"
  516. title="选择不管控物料"
  517. :close-on-click-modal="false"
  518. :visible.sync="noControlPartModelFlag">
  519. <el-form :inline="true" label-position="top" label-width="100px" >
  520. <el-row :gutter="20">
  521. <el-col :span="6">
  522. <el-form-item style="margin-left: 0px" label="物料编码">
  523. <el-input v-model="partSearch.partNo" ></el-input>
  524. </el-form-item>
  525. </el-col>
  526. <el-col :span="6">
  527. <el-form-item style="margin-left: 0px" label="物料名称">
  528. <el-input v-model="partSearch.partDesc" ></el-input>
  529. </el-form-item>
  530. </el-col>
  531. <el-col :span="6">
  532. <el-form-item style="margin-left: 0px" label="规格型号">
  533. <el-input v-model="partSearch.spec" ></el-input>
  534. </el-form-item>
  535. </el-col>
  536. <el-col :span="6">
  537. <el-form-item label=" ">
  538. <el-button type="primary" @click="searchNoControlPartModel()">{{'查询'}}</el-button>
  539. </el-form-item>
  540. </el-col>
  541. </el-row>
  542. </el-form>
  543. <el-table
  544. height="450"
  545. :data="partList2"
  546. border
  547. @row-dblclick="chooseNoControlPartNo"
  548. style="width: 100%;">
  549. <el-table-column
  550. prop="partNo"
  551. header-align="center"
  552. align="left"
  553. min-width="80"
  554. style="font-size: 20px"
  555. label="物料编码">
  556. </el-table-column>
  557. <el-table-column
  558. prop="partDesc"
  559. header-align="center"
  560. align="left"
  561. min-width="120"
  562. style="font-size: 20px"
  563. label="物料描述">
  564. </el-table-column>
  565. <el-table-column
  566. prop="spec"
  567. header-align="center"
  568. align="left"
  569. min-width="120"
  570. style="font-size: 20px"
  571. label="规格型号">
  572. </el-table-column>
  573. <el-table-column
  574. prop="sku"
  575. header-align="center"
  576. align="left"
  577. min-width="80"
  578. label="SKU">
  579. </el-table-column>
  580. <el-table-column
  581. prop="umid"
  582. header-align="center"
  583. align="left"
  584. min-width="60"
  585. label="计量单位">
  586. </el-table-column>
  587. </el-table>
  588. </el-dialog>
  589. <el-dialog
  590. width="500px"
  591. title="物料库存 VS 需求数量"
  592. :close-on-click-modal="false"
  593. :visible.sync="xiadaModelFlag">
  594. <div class="board666">
  595. <el-table
  596. height="300"
  597. :data="xiadaList"
  598. border
  599. :row-class-name="tableRowClassName"
  600. style="width: 100%;">
  601. <el-table-column
  602. prop="componentPartNo"
  603. header-align="center"
  604. align="left"
  605. min-width="80"
  606. style="font-size: 20px"
  607. label="物料编码">
  608. </el-table-column>
  609. <el-table-column
  610. prop="partDesc"
  611. header-align="center"
  612. align="left"
  613. min-width="120"
  614. style="font-size: 20px"
  615. label="物料描述">
  616. </el-table-column>
  617. <el-table-column
  618. prop="qtyToIssue"
  619. header-align="center"
  620. align="right"
  621. min-width="80"
  622. style="font-size: 20px"
  623. label="发料数量">
  624. </el-table-column>
  625. <el-table-column
  626. prop="qtyOnHand"
  627. header-align="center"
  628. align="right"
  629. min-width="80"
  630. label="库存数量">
  631. </el-table-column>
  632. <el-table-column
  633. prop="qtyAvailable"
  634. header-align="center"
  635. align="right"
  636. min-width="80"
  637. label="可用数量">
  638. </el-table-column>
  639. </el-table>
  640. </div>
  641. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  642. <el-button type="primary" @click="xiadaNotify()">确定下达</el-button>
  643. <!-- <el-button type="primary" @click="ToSOS()">重新选择派工单</el-button>-->
  644. <el-button type="primary" @click="xiadaModelFlag=false">取消</el-button>
  645. </el-footer>
  646. </el-dialog>
  647. <el-dialog title="保存物料" :close-on-click-modal="false" v-drag :visible.sync="saveOtherPartModalFlag" width="600px">
  648. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  649. <el-row :gutter="20">
  650. <el-col :span="6">
  651. <el-form-item :label="'物料编码'" >
  652. <el-input v-model="otherPartData.componentPartNo" disabled ></el-input>
  653. </el-form-item>
  654. </el-col>
  655. <el-col :span="18">
  656. <el-form-item :label="'物料描述'" >
  657. <el-input v-model="otherPartData.partDesc" disabled ></el-input>
  658. </el-form-item>
  659. </el-col>
  660. </el-row>
  661. <el-row :gutter="20">
  662. <el-col :span="6">
  663. <el-form-item :label="'计量单位'" >
  664. <el-input v-model="otherPartData.umid" disabled ></el-input>
  665. </el-form-item>
  666. </el-col>
  667. <el-col :span="6">
  668. <el-form-item :label="'需求数量'" >
  669. <!-- <el-input v-model="otherPartData.qtyToIssue" ></el-input>-->
  670. <el-input-number v-model="otherPartData.qtyToIssue" style="padding: 0;width: 100%" :step="0" :min="0" :controls="false"></el-input-number>
  671. </el-form-item>
  672. </el-col>
  673. </el-row>
  674. <el-row :gutter="20">
  675. <el-col :span="24">
  676. <el-form-item :label="'备注'" >
  677. <el-input v-model="otherPartData.remark" ></el-input>
  678. </el-form-item>
  679. </el-col>
  680. </el-row>
  681. </el-form>
  682. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  683. <el-button type="primary" @click="saveOtherPart()">保存</el-button>
  684. <el-button type="primary" @click="saveOtherPartModalFlag=false">关闭</el-button>
  685. </el-footer>
  686. </el-dialog>
  687. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  688. </div>
  689. </template>
  690. <script>
  691. import {
  692. eamGroupSearch,
  693. getSiteAndBuByUserName
  694. } from "@/api/eam/eam.js"
  695. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  696. import {
  697. getTableDefaultListLanguage,
  698. getTableUserListLanguage,
  699. } from "@/api/table.js"
  700. import {
  701. getUserNotifyNo,createNotify,
  702. getNotifyNoDetail,
  703. getSOScheduledRoutingListForIssure,
  704. getSOSBOMForIssure,
  705. saveSOIssueNotifyOrderList,
  706. saveMaterialDetail,
  707. deleteNotifySOS,
  708. deleteNotify,
  709. xiadaNotify,
  710. updateNotifyBu,
  711. getBuByUserNameSite,
  712. getPartList,
  713. checkPartStock,
  714. saveOtherPart,
  715. getNoControlPartList,
  716. searchOtherPart,
  717. deleteNotifyMaterialWithOutLog,
  718. }from "@/api/orderIssure/soIssueNotify.js"
  719. import Chooselist from '@/views/modules/common/Chooselist_eam'
  720. export default {
  721. components: {
  722. Chooselist
  723. },
  724. watch: {
  725. // notifyOrderData: {
  726. // deep: true,
  727. // handler: function (newV, oldV) {
  728. // this.notifyOrderData.locationNo = this.notifyOrderData.locationNo.toUpperCase()
  729. // }
  730. // },
  731. },
  732. data () {
  733. return {
  734. activeName:'sos',
  735. noControlPartModelFlag: false,
  736. buList:[],
  737. partList:[],
  738. partList2:[],
  739. notifyNo:'',
  740. notifyData:{
  741. site:'',
  742. bu:'',
  743. notifyNo:'',
  744. notifyDate:'',
  745. enteredDate:'',
  746. userName:'',
  747. userDisplay:'',
  748. remark:'',
  749. planIssueDate:'',
  750. },
  751. dataList2:[],
  752. dataList3:[],
  753. // 是否收藏
  754. favorite: false,
  755. changeBuFlag: false,
  756. partModelFlag: false,
  757. newBu:'',
  758. // 导出 start
  759. exportData: [],
  760. exportName: "设备分组" + this.dayjs().format('YYYYMMDDHHmmss'),
  761. exportHeader: ["设备分组"],
  762. exportFooter: [],
  763. exportList:[],
  764. // 导出 end
  765. searchData: {
  766. site: this.$store.state.user.site,
  767. userName: this.$store.state.user.name,
  768. groupID: '',
  769. groupDesc: '',
  770. buDesc: '',
  771. active: 'Y',
  772. page: 1,
  773. limit: 10,
  774. },
  775. sobomData:{
  776. orderno:'',
  777. seqno:'',
  778. partNo:'',
  779. },
  780. //申请单序号
  781. itemNo:'',
  782. notifyOrderData:{
  783. partNo:'',
  784. orderno:'',
  785. itemno:'',
  786. seqno:'',
  787. partDesc:'',
  788. qtyrequired:'',
  789. sResourceid:'',
  790. issureQty:'',
  791. locationNo:'',
  792. needDate:'',
  793. },
  794. seqNoData:{
  795. site: this.$store.state.user.site,
  796. bu:'',
  797. orderno:'',
  798. seqno:'',
  799. sResourceid:'',
  800. sWorkcenterno:'',
  801. operatorId:'',
  802. sShiftno:'',
  803. startDate:'',
  804. endDate:'',
  805. },
  806. seqNoList:[],
  807. height: 200,
  808. pageIndex: 1,
  809. pageSize: 20,
  810. totalPage: 0,
  811. dataList: [],
  812. sobomList: [],
  813. dataListSelections: [],
  814. seqNoModalFlag:false,
  815. materialModalFlag:false,
  816. modalDisableFlag:false,
  817. saveSeqNoModalFlag:false,
  818. bomLoadFlag:false,
  819. xiadaList:[],
  820. columnList4:[
  821. {
  822. userId: this.$store.state.user.name,
  823. functionId: 701001,
  824. serialNumber: '701001Table4ComponentPartNo',
  825. tableId: "701001Table4",
  826. tableName: "申请单材料明细表",
  827. columnProp: "componentPartNo",
  828. headerAlign: "center",
  829. align: "center",
  830. columnLabel: "材料编码",
  831. columnHidden: false,
  832. columnImage: false,
  833. columnSortable: false,
  834. sortLv: 0,
  835. status: true,
  836. fixed: '',
  837. columnWidth: 100
  838. },{
  839. userId: this.$store.state.user.name,
  840. functionId: 701001,
  841. serialNumber: '701001Table4PartDesc',
  842. tableId: "701001Table4",
  843. tableName: "申请单材料明细表",
  844. columnProp: "partDesc",
  845. headerAlign: "center",
  846. align: "left",
  847. columnLabel: "材料名称",
  848. columnHidden: false,
  849. columnImage: false,
  850. columnSortable: false,
  851. sortLv: 0,
  852. status: true,
  853. fixed: '',
  854. columnWidth: 130
  855. },{
  856. userId: this.$store.state.user.name,
  857. functionId: 701001,
  858. serialNumber: '701001Table4QtyToIssue',
  859. tableId: "701001Table4",
  860. tableName: "申请单材料明细表",
  861. columnProp: "qtyToIssue",
  862. headerAlign: "center",
  863. align: "right",
  864. columnLabel: "申请数量",
  865. columnHidden: false,
  866. columnImage: false,
  867. columnSortable: false,
  868. sortLv: 0,
  869. status: true,
  870. fixed: '',
  871. columnWidth: 80
  872. },{
  873. userId: this.$store.state.user.name,
  874. functionId: 701001,
  875. serialNumber: '701001Table4Remark',
  876. tableId: "701001Table4",
  877. tableName: "申请单材料明细表",
  878. columnProp: "remark",
  879. headerAlign: "center",
  880. align: "left",
  881. columnLabel: "备注",
  882. columnHidden: false,
  883. columnImage: false,
  884. columnSortable: false,
  885. sortLv: 0,
  886. status: true,
  887. fixed: '',
  888. columnWidth: 200
  889. },
  890. ],
  891. modalData:{
  892. flag:'',
  893. bu: '',
  894. site: this.$store.state.user.site,
  895. groupID:'',
  896. groupDesc:'',
  897. active:'',
  898. createBy: this.$store.state.user.name,
  899. updateBy: this.$store.state.user.name,
  900. },
  901. // 展示列集
  902. columnList: [
  903. {
  904. userId: this.$store.state.user.name,
  905. functionId: 701001002,
  906. serialNumber: '701001002Table1ItemNo',
  907. tableId: "701001002Table1",
  908. tableName: "领料申请派工单子表",
  909. columnProp: 'itemNo',
  910. headerAlign: "center",
  911. align: "right",
  912. columnLabel: '序号',
  913. columnHidden: false,
  914. columnImage: false,
  915. columnSortable: false,
  916. sortLv: 0,
  917. status: true,
  918. fixed: '',
  919. columnWidth: 50,
  920. },
  921. {
  922. userId: this.$store.state.user.name,
  923. functionId: 701001002,
  924. serialNumber: '701001002Table1SeqNo',
  925. tableId: "701001002Table1",
  926. tableName: "领料申请派工单子表",
  927. columnProp: 'seqNo',
  928. headerAlign: "center",
  929. align: "center",
  930. columnLabel: '派工单号',
  931. columnHidden: false,
  932. columnImage: false,
  933. columnSortable: false,
  934. sortLv: 0,
  935. status: true,
  936. fixed: '',
  937. columnWidth: 150,
  938. },
  939. {
  940. userId: this.$store.state.user.name,
  941. functionId: 701001002,
  942. serialNumber: '701001002Table1SOOrderNo',
  943. tableId: "701001002Table1",
  944. tableName: "领料申请派工单子表",
  945. columnProp: 'sOOrderNo',
  946. headerAlign: "center",
  947. align: "center",
  948. columnLabel: '生产订单',
  949. columnHidden: false,
  950. columnImage: false,
  951. columnSortable: false,
  952. sortLv: 0,
  953. status: true,
  954. fixed: '',
  955. columnWidth: 120,
  956. },
  957. {
  958. userId: this.$store.state.user.name,
  959. functionId: 701001002,
  960. serialNumber: '701001002Table1OpsItemNo',
  961. tableId: "701001002Table1",
  962. tableName: "领料申请派工单子表",
  963. columnProp: 'opsItemNo',
  964. headerAlign: "center",
  965. align: "right",
  966. columnLabel: '工序',
  967. columnHidden: false,
  968. columnImage: false,
  969. columnSortable: false,
  970. sortLv: 0,
  971. status: true,
  972. fixed: '',
  973. columnWidth: 80,
  974. },
  975. {
  976. userId: this.$store.state.user.name,
  977. functionId: 701001002,
  978. serialNumber: '701001002Table1ItemDesc',
  979. tableId: "701001002Table1",
  980. tableName: "领料申请派工单子表",
  981. columnProp: 'itemDesc',
  982. headerAlign: "center",
  983. align: "left",
  984. columnLabel: '工序名称',
  985. columnHidden: false,
  986. columnImage: false,
  987. columnSortable: false,
  988. sortLv: 0,
  989. status: true,
  990. fixed: '',
  991. columnWidth: 100,
  992. },
  993. {
  994. userId: this.$store.state.user.name,
  995. functionId: 701001002,
  996. serialNumber: '701001002Table1LocationNo',
  997. tableId: "701001002Table1",
  998. tableName: "领料申请派工单子表",
  999. columnProp: 'locationNo',
  1000. headerAlign: "center",
  1001. align: "left",
  1002. columnLabel: '机台编码',
  1003. columnHidden: false,
  1004. columnImage: false,
  1005. columnSortable: false,
  1006. sortLv: 0,
  1007. status: true,
  1008. fixed: '',
  1009. columnWidth: 80,
  1010. },
  1011. {
  1012. userId: this.$store.state.user.name,
  1013. functionId: 701001002,
  1014. serialNumber: '701001002Table1NeedDate',
  1015. tableId: "701001002Table1",
  1016. tableName: "领料申请派工单子表",
  1017. columnProp: 'needDate',
  1018. headerAlign: "center",
  1019. align: "left",
  1020. columnLabel: '要求发料时间',
  1021. columnHidden: false,
  1022. columnImage: false,
  1023. columnSortable: false,
  1024. sortLv: 0,
  1025. status: true,
  1026. fixed: '',
  1027. columnWidth: 80,
  1028. },
  1029. {
  1030. userId: this.$store.state.user.name,
  1031. functionId: 701001002,
  1032. serialNumber: '701001002Table1IssureQty',
  1033. tableId: "701001002Table1",
  1034. tableName: "领料申请派工单子表",
  1035. columnProp: 'issureQty',
  1036. headerAlign: "center",
  1037. align: "right",
  1038. columnLabel: '发料数量',
  1039. columnHidden: false,
  1040. columnImage: false,
  1041. columnSortable: false,
  1042. sortLv: 0,
  1043. status: true,
  1044. fixed: '',
  1045. columnWidth: 80,
  1046. },
  1047. ],
  1048. columnList2: [
  1049. {
  1050. userId: this.$store.state.user.name,
  1051. functionId: 701001002,
  1052. serialNumber: '701001002Table2Orderno',
  1053. tableId: "701001002Table2",
  1054. tableName: "查询派工单",
  1055. columnProp: 'orderno',
  1056. headerAlign: "center",
  1057. align: "center",
  1058. columnLabel: '生产订单',
  1059. columnHidden: false,
  1060. columnImage: false,
  1061. columnSortable: false,
  1062. sortLv: 0,
  1063. status: true,
  1064. fixed: '',
  1065. columnWidth: 120,
  1066. },
  1067. {
  1068. userId: this.$store.state.user.name,
  1069. functionId: 701001002,
  1070. serialNumber: '701001002Table2Itemno',
  1071. tableId: "701001002Table2",
  1072. tableName: "查询派工单",
  1073. columnProp: 'itemno',
  1074. headerAlign: "center",
  1075. align: "right",
  1076. columnLabel: '工序',
  1077. columnHidden: false,
  1078. columnImage: false,
  1079. columnSortable: false,
  1080. sortLv: 0,
  1081. status: true,
  1082. fixed: '',
  1083. columnWidth: 50,
  1084. },
  1085. {
  1086. userId: this.$store.state.user.name,
  1087. functionId: 701001002,
  1088. serialNumber: '701001002Table2ItemDesc',
  1089. tableId: "701001002Table2",
  1090. tableName: "查询派工单",
  1091. columnProp: 'itemDesc',
  1092. headerAlign: "center",
  1093. align: "left",
  1094. columnLabel: '工序名称',
  1095. columnHidden: false,
  1096. columnImage: false,
  1097. columnSortable: false,
  1098. sortLv: 0,
  1099. status: true,
  1100. fixed: '',
  1101. columnWidth: 100,
  1102. },
  1103. {
  1104. userId: this.$store.state.user.name,
  1105. functionId: 701001002,
  1106. serialNumber: '701001002Table2Seqno',
  1107. tableId: "701001002Table2",
  1108. tableName: "查询派工单",
  1109. columnProp: 'seqno',
  1110. headerAlign: "center",
  1111. align: "center",
  1112. columnLabel: '派工单号',
  1113. columnHidden: false,
  1114. columnImage: false,
  1115. columnSortable: false,
  1116. sortLv: 0,
  1117. status: true,
  1118. fixed: '',
  1119. columnWidth: 150,
  1120. },
  1121. {
  1122. userId: this.$store.state.user.name,
  1123. functionId: 701001002,
  1124. serialNumber: '701001002Table2PartNo',
  1125. tableId: "701001002Table2",
  1126. tableName: "查询派工单",
  1127. columnProp: 'partNo',
  1128. headerAlign: "center",
  1129. align: "left",
  1130. columnLabel: '物料编码',
  1131. columnHidden: false,
  1132. columnImage: false,
  1133. columnSortable: false,
  1134. sortLv: 0,
  1135. status: true,
  1136. fixed: '',
  1137. columnWidth: 80,
  1138. },
  1139. {
  1140. userId: this.$store.state.user.name,
  1141. functionId: 701001002,
  1142. serialNumber: '701001002Table2Qtyrequired',
  1143. tableId: "701001002Table2",
  1144. tableName: "查询派工单",
  1145. columnProp: 'qtyrequired',
  1146. headerAlign: "center",
  1147. align: "right",
  1148. columnLabel: '派工数量',
  1149. columnHidden: false,
  1150. columnImage: false,
  1151. columnSortable: false,
  1152. sortLv: 0,
  1153. status: true,
  1154. fixed: '',
  1155. columnWidth: 80,
  1156. },
  1157. {
  1158. userId: this.$store.state.user.name,
  1159. functionId: 701001002,
  1160. serialNumber: '701001002Table2Qtyreported',
  1161. tableId: "701001002Table2",
  1162. tableName: "查询派工单",
  1163. columnProp: 'qtyreported',
  1164. headerAlign: "center",
  1165. align: "right",
  1166. columnLabel: '报工数量',
  1167. columnHidden: false,
  1168. columnImage: false,
  1169. columnSortable: false,
  1170. sortLv: 0,
  1171. status: true,
  1172. fixed: '',
  1173. columnWidth: 100,
  1174. },
  1175. {
  1176. userId: this.$store.state.user.name,
  1177. functionId: 701001002,
  1178. serialNumber: '701001002Table2SScheduleddate',
  1179. tableId: "701001002Table2",
  1180. tableName: "查询派工单",
  1181. columnProp: 'sScheduleddate',
  1182. headerAlign: "center",
  1183. align: "left",
  1184. columnLabel: '派工日期',
  1185. columnHidden: false,
  1186. columnImage: false,
  1187. columnSortable: false,
  1188. sortLv: 0,
  1189. status: true,
  1190. fixed: '',
  1191. columnWidth: 100,
  1192. },
  1193. {
  1194. userId: this.$store.state.user.name,
  1195. functionId: 701001002,
  1196. serialNumber: '701001002Table2SWorkcenterno',
  1197. tableId: "701001002Table2",
  1198. tableName: "查询派工单",
  1199. columnProp: 'sWorkcenterno',
  1200. headerAlign: "center",
  1201. align: "left",
  1202. columnLabel: '加工中心编码',
  1203. columnHidden: false,
  1204. columnImage: false,
  1205. columnSortable: false,
  1206. sortLv: 0,
  1207. status: true,
  1208. fixed: '',
  1209. columnWidth: 80,
  1210. },
  1211. {
  1212. userId: this.$store.state.user.name,
  1213. functionId: 701001002,
  1214. serialNumber: '701001002Table2WorkCenterDesc',
  1215. tableId: "701001002Table2",
  1216. tableName: "查询派工单",
  1217. columnProp: 'workCenterDesc',
  1218. headerAlign: "center",
  1219. align: "left",
  1220. columnLabel: '加工中心名称',
  1221. columnHidden: false,
  1222. columnImage: false,
  1223. columnSortable: false,
  1224. sortLv: 0,
  1225. status: true,
  1226. fixed: '',
  1227. columnWidth: 100,
  1228. },
  1229. {
  1230. userId: this.$store.state.user.name,
  1231. functionId: 701001002,
  1232. serialNumber: '701001002Table2SResourceid',
  1233. tableId: "701001002Table2",
  1234. tableName: "查询派工单",
  1235. columnProp: 'sResourceid',
  1236. headerAlign: "center",
  1237. align: "left",
  1238. columnLabel: '机台编码',
  1239. columnHidden: false,
  1240. columnImage: false,
  1241. columnSortable: false,
  1242. sortLv: 0,
  1243. status: true,
  1244. fixed: '',
  1245. columnWidth: 60,
  1246. },
  1247. {
  1248. userId: this.$store.state.user.name,
  1249. functionId: 701001002,
  1250. serialNumber: '701001002Table2ResourceDesc',
  1251. tableId: "701001002Table2",
  1252. tableName: "查询派工单",
  1253. columnProp: 'resourceDesc',
  1254. headerAlign: "center",
  1255. align: "left",
  1256. columnLabel: '机台名称',
  1257. columnHidden: false,
  1258. columnImage: false,
  1259. columnSortable: false,
  1260. sortLv: 0,
  1261. status: true,
  1262. fixed: '',
  1263. columnWidth: 100,
  1264. },
  1265. {
  1266. userId: this.$store.state.user.name,
  1267. functionId: 701001002,
  1268. serialNumber: '701001002Table2OperatorDesc',
  1269. tableId: "701001002Table2",
  1270. tableName: "查询派工单",
  1271. columnProp: 'operatorDesc',
  1272. headerAlign: "center",
  1273. align: "left",
  1274. columnLabel: '操作员',
  1275. columnHidden: false,
  1276. columnImage: false,
  1277. columnSortable: false,
  1278. sortLv: 0,
  1279. status: true,
  1280. fixed: '',
  1281. columnWidth: 100,
  1282. },
  1283. ],
  1284. columnList3: [
  1285. {
  1286. userId: this.$store.state.user.name,
  1287. functionId: 701001002,
  1288. serialNumber: '701001002Table3ComponentPartNo',
  1289. tableId: "701001002Table3",
  1290. tableName: "领料申请BOM子表",
  1291. columnProp: 'componentPartNo',
  1292. headerAlign: "center",
  1293. align: "left",
  1294. columnLabel: '物料编码',
  1295. columnHidden: false,
  1296. columnImage: false,
  1297. columnSortable: false,
  1298. sortLv: 0,
  1299. status: true,
  1300. fixed: '',
  1301. columnWidth: 80,
  1302. },
  1303. {
  1304. userId: this.$store.state.user.name,
  1305. functionId: 701001002,
  1306. serialNumber: '701001002Table3PartDesc',
  1307. tableId: "701001002Table3",
  1308. tableName: "领料申请BOM子表",
  1309. columnProp: 'partDesc',
  1310. headerAlign: "center",
  1311. align: "left",
  1312. columnLabel: '物料描述',
  1313. columnHidden: false,
  1314. columnImage: false,
  1315. columnSortable: false,
  1316. sortLv: 0,
  1317. status: true,
  1318. fixed: '',
  1319. columnWidth: 120,
  1320. },
  1321. {
  1322. userId: this.$store.state.user.name,
  1323. functionId: 701001002,
  1324. serialNumber: '701001002Table3QtyRequired',
  1325. tableId: "701001002Table3",
  1326. tableName: "领料申请BOM子表",
  1327. columnProp: 'qtyRequired',
  1328. headerAlign: "center",
  1329. align: "right",
  1330. columnLabel: '需求数量',
  1331. columnHidden: false,
  1332. columnImage: false,
  1333. columnSortable: false,
  1334. sortLv: 0,
  1335. status: true,
  1336. fixed: '',
  1337. columnWidth: 50,
  1338. },
  1339. {
  1340. userId: this.$store.state.user.name,
  1341. functionId: 701001002,
  1342. serialNumber: '701001002Table3QtyOnHand',
  1343. tableId: "701001002Table3",
  1344. tableName: "领料申请BOM子表",
  1345. columnProp: 'qtyOnHand',
  1346. headerAlign: "center",
  1347. align: "right",
  1348. columnLabel: '现场库存',
  1349. columnHidden: false,
  1350. columnImage: false,
  1351. columnSortable: false,
  1352. sortLv: 0,
  1353. status: true,
  1354. fixed: '',
  1355. columnWidth: 50,
  1356. },
  1357. {
  1358. userId: this.$store.state.user.name,
  1359. functionId: 701001002,
  1360. serialNumber: '701001002Table3StockQty',
  1361. tableId: "701001002Table3",
  1362. tableName: "领料申请BOM子表",
  1363. columnProp: 'stockQty',
  1364. headerAlign: "center",
  1365. align: "right",
  1366. columnLabel: 'ERP库存',
  1367. columnHidden: false,
  1368. columnImage: false,
  1369. columnSortable: false,
  1370. sortLv: 0,
  1371. status: true,
  1372. fixed: '',
  1373. columnWidth: 50,
  1374. },
  1375. {
  1376. userId: this.$store.state.user.name,
  1377. functionId: 701001002,
  1378. serialNumber: '701001002Table3QtyToIssue',
  1379. tableId: "701001002Table3",
  1380. tableName: "领料申请BOM子表",
  1381. columnProp: 'qtyToIssue',
  1382. headerAlign: "center",
  1383. align: "right",
  1384. columnLabel: '本次申请数量',
  1385. columnHidden: false,
  1386. columnImage: false,
  1387. columnSortable: false,
  1388. sortLv: 0,
  1389. status: true,
  1390. fixed: '',
  1391. columnWidth: 60,
  1392. },
  1393. {
  1394. userId: this.$store.state.user.name,
  1395. functionId: 701001002,
  1396. serialNumber: '701001002Table3Remark',
  1397. tableId: "701001002Table3",
  1398. tableName: "领料申请BOM子表",
  1399. columnProp: 'remark',
  1400. headerAlign: "center",
  1401. align: "left",
  1402. columnLabel: '备注',
  1403. columnHidden: false,
  1404. columnImage: false,
  1405. columnSortable: false,
  1406. sortLv: 0,
  1407. status: true,
  1408. fixed: '',
  1409. columnWidth: 150,
  1410. },
  1411. ],
  1412. rules:{
  1413. groupIdType:[
  1414. {
  1415. required: true,
  1416. message: ' ',
  1417. trigger: ['blur','change']
  1418. }
  1419. ],
  1420. groupDescType:[
  1421. {
  1422. required: true,
  1423. message: ' ',
  1424. trigger: ['blur','change']
  1425. }
  1426. ],
  1427. activeType:[
  1428. {
  1429. required: true,
  1430. message: ' ',
  1431. trigger: ['blur','change']
  1432. }
  1433. ],
  1434. bu:[
  1435. {
  1436. required: true,
  1437. message: ' ',
  1438. trigger: ['blur','change']
  1439. }
  1440. ]
  1441. },
  1442. userBuList: [],
  1443. authSearch: false,
  1444. authSave: false,
  1445. authUpdate: false,
  1446. authDelete: false,
  1447. menuId: this.$route.meta.menuId,
  1448. partSearch:{
  1449. site:'',
  1450. sourceBu:'',
  1451. partNo:'',
  1452. partDesc:'',
  1453. spec:'',
  1454. },
  1455. xiadaModelFlag:false,
  1456. saveOtherPartModalFlag:false,
  1457. otherPartData:{
  1458. site:'',
  1459. notifyNo:'',
  1460. itemNo:'',
  1461. bOMItemNo:'',
  1462. componentPartNo:'',
  1463. qtyToIssue:'',
  1464. issueType:'',
  1465. partDesc:'',
  1466. umid:'',
  1467. remark:'',
  1468. },
  1469. }
  1470. },
  1471. mounted () {
  1472. this.$nextTick(() => {
  1473. this.height = window.innerHeight - 300
  1474. })
  1475. },
  1476. created () {
  1477. // 按钮控制
  1478. // this.getButtonAuthData()
  1479. // 获取用户的 site 和 bu
  1480. // this.getSiteAndBuByUserName()
  1481. // 校验用户是否收藏
  1482. this.favoriteIsOk()
  1483. this.getUserNotifyNo()
  1484. // 动态列
  1485. // this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1486. // if (!this.authSearch) {
  1487. // // 获取数据列表
  1488. // this.getDataList()
  1489. // }
  1490. },
  1491. methods: {
  1492. deleteNotifyMaterial(row){
  1493. this.$confirm('确认删除?', '提示', {
  1494. confirmButtonText: '确定',
  1495. cancelButtonText: '取消',
  1496. type: 'warning'
  1497. }).then(() => {
  1498. deleteNotifyMaterialWithOutLog(row).then(({data}) => {
  1499. if (data && data.code === 0) {
  1500. this.searchOtherPart('非BOM物料')
  1501. this.searchOtherPart('不管控物料')
  1502. this.$message({
  1503. message: '操作成功',
  1504. type: 'success',
  1505. duration: 1500,
  1506. onClose: () => {}
  1507. })
  1508. } else {
  1509. this.$alert(data.msg, '错误', {
  1510. confirmButtonText: '确定'
  1511. })
  1512. }
  1513. })
  1514. })
  1515. },
  1516. getBaseList (val,type) {
  1517. this.tagNo = val
  1518. let conSql=''
  1519. this.$nextTick(() => {
  1520. let strVal = ''
  1521. if (val === 515) {
  1522. strVal = this.seqNoData.sResourceid
  1523. conSql = " and site = '" + this.notifyData.site + "'" + " and bu_no = '" + this.notifyData.bu + "'"
  1524. this.$refs.baseList.init(val, strVal,conSql)
  1525. }
  1526. if (val === 216) {
  1527. strVal = this.seqNoData.sWorkcenterno
  1528. conSql = " and site = '" + this.notifyData.site + "'" + " and bu_no = '" + this.notifyData.bu + "'"
  1529. this.$refs.baseList.init(val, strVal,conSql)
  1530. }
  1531. if (val === 215) {
  1532. strVal = this.notifyOrderData.locationNo
  1533. this.$refs.baseList.init(val, strVal)
  1534. }
  1535. })
  1536. },
  1537. chooseNoBomPartNo(row){
  1538. this.otherPartData={
  1539. site:this.notifyData.site,
  1540. notifyNo:this.notifyData.notifyNo,
  1541. itemNo:998,
  1542. bOMItemNo:'',
  1543. componentPartNo:row.partNo,
  1544. qtyToIssue:'',
  1545. issueType:'非BOM物料',
  1546. partDesc:row.partDesc,
  1547. umid:row.umid,
  1548. remark:'',
  1549. }
  1550. this.saveOtherPartModalFlag=true
  1551. },
  1552. chooseNoControlPartNo(row){
  1553. this.otherPartData={
  1554. site:this.notifyData.site,
  1555. notifyNo:this.notifyData.notifyNo,
  1556. itemNo:999,
  1557. bOMItemNo:'',
  1558. componentPartNo:row.partNo,
  1559. qtyToIssue:'',
  1560. issueType:'不管控物料',
  1561. partDesc:row.partDesc,
  1562. umid:row.umid,
  1563. remark:'',
  1564. }
  1565. this.saveOtherPartModalFlag=true
  1566. },
  1567. tableRowClassName ({row, rowIndex}) {
  1568. if(row.qtyToIssue>row.qtyAvailable){
  1569. return 'error-row'
  1570. }
  1571. return ''
  1572. },
  1573. // 列表方法的回调
  1574. getBaseData (val) {
  1575. if (this.tagNo === 515) {
  1576. this.seqNoData.sResourceid = val.resource_id
  1577. }
  1578. if (this.tagNo === 215) {
  1579. this.notifyOrderData.locationNo = val.location_id
  1580. }
  1581. if (this.tagNo === 216) {
  1582. this.seqNoData.sWorkcenterno = val.work_center_no
  1583. }
  1584. },
  1585. getUserNotifyNo(){
  1586. let inData={
  1587. site:this.$store.state.user.site,
  1588. userName:this.$store.state.user.name,
  1589. }
  1590. getUserNotifyNo(inData).then(({data})=>{
  1591. if (data.code === 0) {
  1592. if(data.row!=null){
  1593. this.notifyNo = data.row.notifyNo
  1594. this.notifyData=data.row
  1595. this.getNotifyNoDetail();
  1596. this.searchOtherPart('非BOM物料')
  1597. this.searchOtherPart('不管控物料')
  1598. }else {
  1599. this.notifyNo =''
  1600. this.notifyData={
  1601. site:'',
  1602. bu:'',
  1603. notifyNo:'',
  1604. notifyDate:'',
  1605. enteredDate:'',
  1606. userName:'',
  1607. userDisplay:'',
  1608. remark:'',
  1609. planIssueDate:'',
  1610. }
  1611. this.dataList=[]
  1612. }
  1613. }else {
  1614. this.notifyNo =''
  1615. this.notifyData={
  1616. site:'',
  1617. bu:'',
  1618. notifyNo:'',
  1619. notifyDate:'',
  1620. enteredDate:'',
  1621. userName:'',
  1622. userDisplay:'',
  1623. remark:'',
  1624. planIssueDate:'',
  1625. }
  1626. this.dataList=[]
  1627. }
  1628. })
  1629. },
  1630. getNotifyNoDetail(){
  1631. let inData={
  1632. site:this.$store.state.user.site,
  1633. notifyNo:this.notifyNo,
  1634. }
  1635. getNotifyNoDetail(inData).then(({data})=>{
  1636. if (data.code === 0) {
  1637. this.dataList = data.rows
  1638. }
  1639. })
  1640. },
  1641. addNotify(){
  1642. let inData={
  1643. site:this.$store.state.user.site,
  1644. userName:this.$store.state.user.name,
  1645. }
  1646. createNotify(inData).then(({data})=>{
  1647. if (data.code === 0) {
  1648. this.$message({
  1649. message: '操作成功',
  1650. type: 'success',
  1651. duration: 1500,
  1652. onClose: () => {}
  1653. })
  1654. this.getUserNotifyNo()
  1655. }else {
  1656. this.$alert(data.msg, '错误', {
  1657. confirmButtonText: '确定'
  1658. })
  1659. }
  1660. })
  1661. },
  1662. chooseSOS(row){
  1663. if(this.dataList.length>0){
  1664. let stop=false
  1665. for (let i = 0; i < this.dataList.length; i++) {
  1666. if(this.dataList[i].seqNo==row.seqno){
  1667. stop=true
  1668. }
  1669. }
  1670. if(stop){
  1671. this.$alert('已经选择过此派工单,请返回点击明细直接操作!!', '提示', {
  1672. confirmButtonText: '确定'
  1673. })
  1674. return false
  1675. }
  1676. }
  1677. this.notifyOrderData.partNo=row.partNo
  1678. this.notifyOrderData.orderno=row.orderno
  1679. this.notifyOrderData.itemno=row.itemno
  1680. this.notifyOrderData.seqno=row.seqno
  1681. this.notifyOrderData.partDesc=row.partDesc
  1682. this.notifyOrderData.qtyrequired=row.qtyrequired
  1683. this.notifyOrderData.sResourceid=row.sResourceid
  1684. this.notifyOrderData.issureQty=''
  1685. this.notifyOrderData.needDate=this.dayjs().format("YYYY-MM-DD HH:mm")
  1686. this.notifyOrderData.locationNo=row.sResourceid;
  1687. this.saveSeqNoModalFlag=true
  1688. },
  1689. saveSOS(){
  1690. if(this.notifyOrderData.needDate==null||this.notifyOrderData.needDate==''){
  1691. this.$message.warning('请选择时间!')
  1692. return false
  1693. }
  1694. // if(this.notifyOrderData.locationNo==null||this.notifyOrderData.locationNo==''){
  1695. // this.$message.warning('请输入机台!')
  1696. // return false
  1697. // }
  1698. if(this.notifyOrderData.issureQty==null||this.notifyOrderData.issureQty==''||this.notifyOrderData.issureQty<=0){
  1699. this.$message.warning('请填写领取数量!')
  1700. return false
  1701. }
  1702. let row=this.notifyOrderData
  1703. if(this.dataList.length>0){
  1704. let stop=false
  1705. for (let i = 0; i < this.dataList.length; i++) {
  1706. if(this.dataList[i].seqNo==row.seqno){
  1707. stop=true
  1708. }
  1709. }
  1710. if(stop){
  1711. this.$alert('已经选择过此派工单,请返回点击明细直接操作!!', '提示', {
  1712. confirmButtonText: '确定'
  1713. })
  1714. return false
  1715. }
  1716. }
  1717. this.$confirm('确定选择派工单'+row.seqno+'?', '提示', {
  1718. confirmButtonText: '确定',
  1719. cancelButtonText: '取消',
  1720. type: 'warning'
  1721. }).then(() => {
  1722. let inData={
  1723. site:this.$store.state.user.site,
  1724. notifyNo:this.notifyNo,
  1725. fGPartNo:row.partNo,
  1726. sOOrderNo:row.orderno,
  1727. opsItemNo:row.itemno,
  1728. seqNo:row.seqno,
  1729. locationNo:row.locationNo,
  1730. needDate:row.needDate,
  1731. issureQty:row.issureQty,
  1732. outWorkOrderFlag:'N',
  1733. }
  1734. saveSOIssueNotifyOrderList(inData).then(({data})=>{
  1735. if (data.code === 0) {
  1736. this.saveSeqNoModalFlag=false
  1737. this.getNotifyNoDetail()
  1738. this.enterSOS(row);
  1739. this.itemNo=data.itemNo
  1740. }else {
  1741. this.$alert(data.msg, '错误', {
  1742. confirmButtonText: '确定'
  1743. })
  1744. }
  1745. })
  1746. })
  1747. },
  1748. qtyAllForSeqNo(){
  1749. this.notifyOrderData.issureQty=this.notifyOrderData.qtyrequired
  1750. },
  1751. qtyAllForBom(row){
  1752. row.qtyToIssue=row.qtyRequired
  1753. },
  1754. enterSOSDetail(row){
  1755. let rows={
  1756. site:this.$store.state.user.site,
  1757. notifyNo:this.notifyNo,
  1758. orderno:row.sOOrderNo,
  1759. seqno:row.seqNo,
  1760. partNo:row.fGPartNo,
  1761. itemno:row.opsItemNo,
  1762. }
  1763. this.itemNo=row.itemNo
  1764. this.enterSOS(rows)
  1765. },
  1766. enterSOS(row){
  1767. this.seqNoModalFlag = false
  1768. this.materialModalFlag=true
  1769. this.sobomList = []
  1770. this.sobomData={
  1771. orderno:row.orderno,
  1772. seqno:row.seqno,
  1773. partNo:row.partNo,
  1774. }
  1775. this.bomLoadFlag=true
  1776. let inData={
  1777. site:this.$store.state.user.site,
  1778. notifyNo:this.notifyNo,
  1779. orderno:row.orderno,
  1780. seqno:row.seqno,
  1781. partNo:row.partNo,
  1782. itemno:row.itemno,
  1783. }
  1784. getSOSBOMForIssure(inData).then(({data})=>{
  1785. this.bomLoadFlag=false
  1786. if (data.code === 0) {
  1787. this.sobomList = data.rows
  1788. }
  1789. })
  1790. },
  1791. ToSOS(){
  1792. this.seqNoModalFlag = true
  1793. this.materialModalFlag=false
  1794. },
  1795. chooseSOSModal(){
  1796. this.seqNoData={
  1797. site: this.$store.state.user.site,
  1798. bu:this.notifyData.bu,
  1799. orderno:'',
  1800. seqno:'',
  1801. sResourceid:'',
  1802. sWorkcenterno:'',
  1803. operatorId:'',
  1804. sShiftno:'',
  1805. startDate: this.dayjs().format('YYYY-MM-DD'),
  1806. endDate: this.dayjs().format('YYYY-MM-DD'),
  1807. }
  1808. this.searchSOSRouting()
  1809. this.seqNoModalFlag=true;
  1810. },
  1811. searchSOSRouting(){
  1812. getSOScheduledRoutingListForIssure(this.seqNoData).then(({data})=>{
  1813. if (data.code === 0) {
  1814. this.seqNoList = data.rows
  1815. }
  1816. })
  1817. },
  1818. saveMaterialDetail(){
  1819. for (let i = 0; i < this.sobomList.length; i++) {
  1820. if (this.sobomList[i].applyQty===''||this.sobomList[i].applyQty==null){
  1821. this.sobomList[i].applyQty=0
  1822. }
  1823. }
  1824. let materialList=this.sobomList.filter(item => item.qtyToIssue > 0)
  1825. if(materialList.length==0){
  1826. this.$alert('没有需要保存的内容!', '提示', {
  1827. confirmButtonText: '确定'
  1828. })
  1829. return false
  1830. }
  1831. saveMaterialDetail(materialList).then(({data})=>{
  1832. if (data.code === 0) {
  1833. this.materialModalFlag=false
  1834. this.chooseSOSModal();
  1835. this.$message.success( '操作成功')
  1836. }else {
  1837. this.$alert(data.msg, '错误', {
  1838. confirmButtonText: '确定'
  1839. })
  1840. }
  1841. })
  1842. },
  1843. //获取用户的bu
  1844. getSiteAndBuByUserName () {
  1845. let tempData = {
  1846. username: this.$store.state.user.name,
  1847. }
  1848. getSiteAndBuByUserName(tempData).then(({data}) => {
  1849. if (data.code === 0 && data.row !=null) {
  1850. this.userBuList = data.rows
  1851. }
  1852. })
  1853. },
  1854. // 校验用户是否收藏
  1855. favoriteIsOk () {
  1856. let userFavorite = {
  1857. userId: this.$store.state.user.id,
  1858. languageCode: this.$i18n.locale
  1859. }
  1860. userFavoriteList(userFavorite).then(({data}) => {
  1861. for (let i = 0; i < data.list.length; i++) {
  1862. if (this.$route.meta.menuId === data.list[i].menuId) {
  1863. this.favorite = true
  1864. }
  1865. }
  1866. })
  1867. },
  1868. // 收藏 OR 取消收藏
  1869. favoriteFunction () {
  1870. let userFavorite = {
  1871. userId: this.$store.state.user.id,
  1872. functionId: this.$route.meta.menuId,
  1873. }
  1874. if (this.favorite) {
  1875. removeUserFavorite(userFavorite).then(({data}) => {
  1876. this.$message.success(data.msg)
  1877. this.favorite = false
  1878. })
  1879. } else {
  1880. // 收藏
  1881. saveUserFavorite(userFavorite).then(({data}) => {
  1882. this.$message.success(data.msg)
  1883. this.favorite = true
  1884. })
  1885. }
  1886. },
  1887. //导出excel
  1888. async createExportData () {
  1889. this.searchData.limit = -1
  1890. this.searchData.page = 1
  1891. await eamGroupSearch(this.searchData).then(({data}) => {
  1892. this.exportList = data.page.list
  1893. })
  1894. return this.exportList
  1895. },
  1896. startDownload () {},
  1897. finishDownload () {},
  1898. fields () {
  1899. let json = "{"
  1900. this.columnList.forEach((item, index) => {
  1901. if (index == this.columnList.length - 1) {
  1902. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1903. } else {
  1904. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1905. }
  1906. })
  1907. json += "}"
  1908. let s = eval("(" + json + ")")
  1909. return s
  1910. },
  1911. // // 获取数据列表
  1912. // getDataList () {
  1913. // eamGroupSearch(this.searchData).then(({data}) => {
  1914. // if (data.code === 0) {
  1915. // this.dataList = data.page.list
  1916. // }
  1917. // })
  1918. // },
  1919. // 每页数
  1920. // sizeChangeHandle (val) {
  1921. // this.pageSize = val
  1922. // this.pageIndex = 1
  1923. // this.getDataList()
  1924. // },
  1925. // // 当前页
  1926. // currentChangeHandle (val) {
  1927. // this.pageIndex = val
  1928. // this.getDataList()
  1929. // },
  1930. noBomModel(){
  1931. this.partSearch={
  1932. site:this.notifyData.site,
  1933. sourceBu:this.notifyData.bu,
  1934. partNo:'',
  1935. partDesc:'',
  1936. spec:'',
  1937. }
  1938. this.partModelFlag=true
  1939. this. searchPartModel()
  1940. },
  1941. noControlModel(){
  1942. this.partSearch={
  1943. site:this.notifyData.site,
  1944. sourceBu:this.notifyData.bu,
  1945. partNo:'',
  1946. partDesc:'',
  1947. spec:'',
  1948. }
  1949. this.noControlPartModelFlag=true
  1950. this. searchNoControlPartModel()
  1951. },
  1952. searchPartModel(){
  1953. getPartList(this.partSearch).then(({data})=>{
  1954. if (data.code === 0) {
  1955. this.partList=data.rows
  1956. }
  1957. })
  1958. },
  1959. searchNoControlPartModel(){
  1960. getNoControlPartList(this.partSearch).then(({data})=>{
  1961. if (data.code === 0) {
  1962. this.partList2=data.rows
  1963. }
  1964. })
  1965. },
  1966. xiadaNotifyModel(){
  1967. if(this.dataList.length==0&&this.dataList2.length==0&&this.dataList3.length==0){
  1968. this.$alert('没有明细记录无法下达!!', '提示', {
  1969. confirmButtonText: '确定'
  1970. })
  1971. return false
  1972. }
  1973. checkPartStock(this.notifyData).then(({data})=>{
  1974. if (data.code === 0) {
  1975. this.xiadaList=data.rows
  1976. }
  1977. })
  1978. this.xiadaModelFlag=true
  1979. },
  1980. xiadaNotify() {
  1981. // if(this.notifyData.planIssueDate==null||this.notifyData.planIssueDate==''){
  1982. // this.$alert('请选择要求发料时间!!', '提示', {
  1983. // confirmButtonText: '确定'
  1984. // })
  1985. // return false
  1986. // }
  1987. xiadaNotify(this.notifyData).then(({data})=>{
  1988. if (data.code === 0) {
  1989. this.xiadaModelFlag=false
  1990. this.getUserNotifyNo()
  1991. this.$message.success( '操作成功')
  1992. }else {
  1993. this.$alert(data.msg, '错误', {
  1994. confirmButtonText: '确定'
  1995. })
  1996. }
  1997. })
  1998. },
  1999. saveOtherPart(){
  2000. if(this.otherPartData.qtyToIssue==null||this.otherPartData.qtyToIssue==''||this.otherPartData.qtyToIssue<=0){
  2001. this.$message.warning('请填写领取数量!')
  2002. return false
  2003. }
  2004. this.$confirm('确定保存'+'?', '提示', {
  2005. confirmButtonText: '确定',
  2006. cancelButtonText: '取消',
  2007. type: 'warning'
  2008. }).then(() => {
  2009. saveOtherPart(this.otherPartData).then(({data})=>{
  2010. if (data.code === 0) {
  2011. this.saveOtherPartModalFlag=false
  2012. if(this.otherPartData.issueType==='非BOM物料'){
  2013. this.partModelFlag=false
  2014. this.activeName='noBom'
  2015. this.searchOtherPart('非BOM物料')
  2016. }
  2017. if(this.otherPartData.issueType==='不管控物料'){
  2018. this.noControlPartModelFlag=false
  2019. this.activeName='noControl'
  2020. this.searchOtherPart('不管控物料')
  2021. }
  2022. this.$message.success( '操作成功')
  2023. }else {
  2024. this.$alert(data.msg, '错误', {
  2025. confirmButtonText: '确定'
  2026. })
  2027. }
  2028. })
  2029. })
  2030. },
  2031. deleteNotify() {
  2032. if(this.dataList.length>0){
  2033. this.$alert('请先删除已经申请的明细记录!!', '提示', {
  2034. confirmButtonText: '确定'
  2035. })
  2036. return false
  2037. }
  2038. deleteNotify(this.notifyData).then(({data})=>{
  2039. if (data.code === 0) {
  2040. this.getUserNotifyNo()
  2041. this.$message.success( '操作成功')
  2042. }else {
  2043. this.$alert(data.msg, '错误', {
  2044. confirmButtonText: '确定'
  2045. })
  2046. }
  2047. })
  2048. },
  2049. updateBuModel(){
  2050. if(this.dataList.length>0){
  2051. this.$alert('已经选择了派工单,无法切换BU,请删除已选派工单!', '错误', {
  2052. confirmButtonText: '确定'
  2053. })
  2054. }
  2055. let inData={
  2056. site:this.notifyData.site,
  2057. username:this.$store.state.user.name,
  2058. }
  2059. getBuByUserNameSite(inData).then(({data}) =>{
  2060. if (data && data.code === 0) {
  2061. this.buList=data.rows
  2062. }
  2063. })
  2064. this.newBu=this.notifyData.bu
  2065. this.changeBuFlag=true
  2066. },
  2067. saveNewBu(){
  2068. let inData={
  2069. bu:this.newBu,
  2070. site:this.notifyData.site,
  2071. notifyNo:this.notifyData.notifyNo,
  2072. }
  2073. updateNotifyBu(inData).then(({data}) => {
  2074. if (data && data.code === 0) {
  2075. this.notifyData.bu=this.newBu
  2076. this.changeBuFlag=false
  2077. this.$message({
  2078. message: '操作成功',
  2079. type: 'success',
  2080. duration: 1500,
  2081. onClose: () => {}
  2082. })
  2083. } else {
  2084. this.$alert(data.msg, '错误', {
  2085. confirmButtonText: '确定'
  2086. })
  2087. }
  2088. })
  2089. },
  2090. searchOtherPart(type){
  2091. let inData={
  2092. site:this.notifyData.site,
  2093. notifyNo:this.notifyData.notifyNo,
  2094. issueType:type
  2095. }
  2096. searchOtherPart(inData).then(({data}) =>{
  2097. if (data && data.code === 0) {
  2098. if(type==='非BOM物料'){
  2099. this.dataList2=data.rows
  2100. }
  2101. if(type==='不管控物料'){
  2102. this.dataList3=data.rows
  2103. }
  2104. }
  2105. })
  2106. },
  2107. // 删除
  2108. deleteNotifySOS (row) {
  2109. this.$confirm(`是否删除这个派工单的申请信息?`, '提示', {
  2110. confirmButtonText: '确定',
  2111. cancelButtonText: '取消',
  2112. type: 'warning'
  2113. }).then(() => {
  2114. deleteNotifySOS(row).then(({data}) => {
  2115. if (data && data.code === 0) {
  2116. this.getNotifyNoDetail()
  2117. this.$message({
  2118. message: '操作成功',
  2119. type: 'success',
  2120. duration: 1500,
  2121. onClose: () => {}
  2122. })
  2123. } else {
  2124. this.$alert(data.msg, '错误', {
  2125. confirmButtonText: '确定'
  2126. })
  2127. }
  2128. })
  2129. }).catch(() => {
  2130. })
  2131. },
  2132. // 动态列开始 获取 用户保存的 格式列
  2133. async getTableUserColumn(tableId, columnId) {
  2134. let queryTableUser = {
  2135. userId: this.$store.state.user.name,
  2136. functionId: this.$route.meta.menuId,
  2137. tableId: tableId,
  2138. status: true,
  2139. languageCode: this.$i18n.locale
  2140. }
  2141. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2142. if (data.rows.length > 0) {
  2143. //this.columnList1 = []
  2144. switch (columnId) {
  2145. case 1:
  2146. this.columnList = data.rows
  2147. break;
  2148. // case 2:
  2149. // this.detailColumnList = data.rows
  2150. // break;
  2151. // case 3:
  2152. // this.columnList2 = data.rows
  2153. // break;
  2154. // case 4:
  2155. // this.columnList3 = data.rows
  2156. // break;
  2157. }
  2158. } else {
  2159. this.getColumnList(tableId, columnId)
  2160. }
  2161. })
  2162. },
  2163. // 获取 tableDefault 列
  2164. async getColumnList (tableId, columnId) {
  2165. let queryTable= {
  2166. functionId: this.$route.meta.menuId,
  2167. tableId: tableId,
  2168. languageCode: this.$i18n.locale
  2169. }
  2170. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2171. if (!data.rows.length == 0) {
  2172. switch (columnId) {
  2173. case 1:
  2174. this.columnList = data.rows
  2175. break;
  2176. // case 2:
  2177. // this.detailColumnList = data.rows
  2178. // break;
  2179. // case 3:
  2180. // this.columnList2 = data.rows
  2181. // break;
  2182. // case 4:
  2183. // this.columnList3 = data.rows
  2184. // break;
  2185. }
  2186. } else {
  2187. // this.showDefault = true.
  2188. }
  2189. })
  2190. },
  2191. //获取按钮的权限数据
  2192. getButtonAuthData () {
  2193. let searchFlag = this.isAuth(this.menuId+":search")
  2194. let saveFlag = this.isAuth(this.menuId+":save")
  2195. let updateFlag = this.isAuth(this.menuId+":update")
  2196. let deleteFlag = this.isAuth(this.menuId+":delete")
  2197. //处理页面的权限数据
  2198. this.authSearch = !searchFlag
  2199. this.authSave = !saveFlag
  2200. this.authUpdate = !updateFlag
  2201. this.authDelete = !deleteFlag
  2202. },
  2203. }
  2204. }
  2205. </script>
  2206. <style >
  2207. .board666 .el-table .error-row {
  2208. background: #f86868;
  2209. }
  2210. </style>