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.

1454 lines
46 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <div class="mod-config yzz">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  5. <el-form-item :label="'申请单号'">
  6. <el-input v-model="searchData.notifyNo" style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'申请账号'">
  9. <el-input v-model="searchData.userName" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item label="状态" >
  12. <el-select v-model="searchData.status" placeholder="请选择" style="width: 120px">
  13. <el-option label="全部" value=""></el-option>
  14. <el-option label="ISSUE" value="ISSUE"></el-option>
  15. <el-option label="CANCEL" value="CANCEL"></el-option>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item :label="'申请单日期'">
  19. <el-date-picker
  20. style="width: 120px"
  21. v-model="searchData.startDate"
  22. type="date"
  23. value-format="yyyy-MM-dd"
  24. placeholder="选择日期">
  25. </el-date-picker>
  26. </el-form-item>
  27. <el-form-item style="margin-top: 23px;">
  28. <label style="margin-left: 0px;font-size: 19px">&#10142</label>
  29. </el-form-item>
  30. <el-form-item :label="' '">
  31. <el-date-picker
  32. style="width: 120px"
  33. v-model="searchData.endDate"
  34. type="date"
  35. value-format="yyyy-MM-dd"
  36. placeholder="选择日期">
  37. </el-date-picker>
  38. </el-form-item>
  39. </el-form>
  40. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  41. <el-form-item label="是否领料" >
  42. <el-select v-model="searchData.issueFlag" placeholder="请选择" style="width: 120px">
  43. <el-option label="全部" value=""></el-option>
  44. <el-option label="Y" value="Y"></el-option>
  45. <el-option label="N" value="N"></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="领料结果" >
  49. <el-select v-model="searchData.issueResult" placeholder="请选择" style="width: 120px">
  50. <el-option label="全部" value=""></el-option>
  51. <el-option label="部分发料" value="部分发料"></el-option>
  52. <el-option label="全部发料" value="全部发料"></el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item :label="' '">
  56. <el-button type="primary" @click="searchTable()">查询</el-button>
  57. <!-- <el-button type="primary" @click="createNotifyModal()">新增</el-button> -->
  58. <download-excel
  59. :fields="fields()"
  60. :data="exportData"
  61. type="xls"
  62. :name="exportName"
  63. :header="exportHeader"
  64. :footer="exportFooter"
  65. :fetch="createExportData"
  66. :before-generate="startDownload"
  67. :before-finish="finishDownload"
  68. worksheet="导出信息"
  69. class="el-button el-button--primary el-button--medium">
  70. {{ '导出' }}
  71. </download-excel>
  72. </el-form-item>
  73. </el-form>
  74. </el-form>
  75. <el-table
  76. :data="dataList"
  77. @row-click="changeData"
  78. :height="height"
  79. border
  80. highlight-current-row
  81. ref="mainTable"
  82. v-loading="dataListLoading"
  83. style="width: 100%; ">
  84. <el-table-column
  85. v-for="(item,index) in columnList1" :key="index"
  86. :sortable="item.columnSortable"
  87. :prop="item.columnProp"
  88. :header-align="item.headerAlign"
  89. :show-overflow-tooltip="item.showOverflowTooltip"
  90. :align="item.align"
  91. :fixed="item.fixed==''?false:item.fixed"
  92. :min-width="item.columnWidth"
  93. :label="item.columnLabel">
  94. <template slot-scope="scope">
  95. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  96. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  97. style="width: 100px; height: 80px"/></span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column
  101. header-align="center"
  102. align="center"
  103. width="160"
  104. label="操作">
  105. <template slot-scope="scope">
  106. <a type="text" size="small" v-if="scope.row.status==='ISSUE'" @click="closeNotifyModel(scope.row)">关闭</a>
  107. <a type="text" size="small" v-if="scope.row.status==='CLOSED'" @click="openNotify(scope.row)">开启</a>
  108. <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='Y'" @click="previewInventory(scope.row)" style="margin-left: 10px;">预览</a>
  109. <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='Y'" @click="pushToWcs(scope.row)" style="margin-left: 10px;">推送WCS</a>
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. <el-pagination
  114. @size-change="sizeChangeHandle"
  115. @current-change="currentChangeHandle"
  116. :current-page="pageIndex"
  117. :page-sizes="[20, 50, 100, 1000]"
  118. :page-size="pageSize"
  119. :total="totalPage"
  120. layout="total, sizes, prev, pager, next, jumper">
  121. </el-pagination>
  122. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  123. <el-tab-pane label="申请单明细" name="detail">
  124. <el-table
  125. :data="dataList2"
  126. :height="height"
  127. border
  128. v-loading="dataListLoading"
  129. style="width: 100%; ">
  130. <!-- <el-table-column-->
  131. <!-- header-align="center"-->
  132. <!-- align="center"-->
  133. <!-- width="80"-->
  134. <!-- label="操作">-->
  135. <!-- <template slot-scope="scope">-->
  136. <!-- <a type="text" size="small" v-if="currentRow.status==='ISSUE'" @click="deleteNotifySOSPlus(scope.row)">删除</a>-->
  137. <!-- </template>-->
  138. <!-- </el-table-column>-->
  139. <el-table-column
  140. v-for="(item,index) in columnList2" :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>
  156. </el-tab-pane>
  157. <el-tab-pane label="材料明细" name="sub">
  158. <el-table
  159. :data="dataList3"
  160. :height="height"
  161. border
  162. :row-class-name="tableRowClassName"
  163. v-loading="dataListLoading"
  164. style="width: 100%; ">
  165. <!-- <el-table-column-->
  166. <!-- header-align="center"-->
  167. <!-- align="center"-->
  168. <!-- width="80"-->
  169. <!-- label="操作">-->
  170. <!-- <template slot-scope="scope">-->
  171. <!-- <a type="text" size="small" v-if="currentRow.status==='ISSUE'" @click="deleteNotifyMaterial(scope.row)">删除</a>-->
  172. <!-- </template>-->
  173. <!-- </el-table-column>-->
  174. <el-table-column
  175. v-for="(item,index) in columnList3" :key="index"
  176. :sortable="item.columnSortable"
  177. :prop="item.columnProp"
  178. :header-align="item.headerAlign"
  179. :show-overflow-tooltip="item.showOverflowTooltip"
  180. :align="item.align"
  181. :fixed="item.fixed==''?false:item.fixed"
  182. :min-width="item.columnWidth"
  183. :label="item.columnLabel">
  184. <template slot-scope="scope">
  185. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  186. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  187. style="width: 100px; height: 80px"/></span>
  188. </template>
  189. </el-table-column>
  190. </el-table>
  191. </el-tab-pane>
  192. <el-tab-pane label="材料汇总" name="sum">
  193. <el-table
  194. :data="dataList4"
  195. :height="height"
  196. border
  197. v-loading="dataListLoading"
  198. style="width: 100%; ">
  199. <!-- <el-table-column-->
  200. <!-- header-align="center"-->
  201. <!-- align="center"-->
  202. <!-- width="80"-->
  203. <!-- fixed="left"-->
  204. <!-- label="操作">-->
  205. <!-- <template slot-scope="scope">-->
  206. <!-- <a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>-->
  207. <!-- </template>-->
  208. <!-- </el-table-column>-->
  209. <el-table-column
  210. v-for="(item,index) in columnList4" :key="index"
  211. :sortable="item.columnSortable"
  212. :prop="item.columnProp"
  213. :header-align="item.headerAlign"
  214. :show-overflow-tooltip="item.showOverflowTooltip"
  215. :align="item.align"
  216. :fixed="item.fixed==''?false:item.fixed"
  217. :min-width="item.columnWidth"
  218. :label="item.columnLabel">
  219. <template slot-scope="scope">
  220. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  221. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  222. style="width: 100px; height: 80px"/></span>
  223. </template>
  224. </el-table-column>
  225. </el-table>
  226. </el-tab-pane>
  227. </el-tabs>
  228. <el-dialog title="关闭原因" :close-on-click-modal="false" v-drag :visible.sync="closeModalFlag" width="450px">
  229. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  230. <el-row :gutter="20">
  231. <el-col :span="24">
  232. <el-form-item >
  233. <el-input
  234. type="textarea"
  235. v-model="closeData.closeRemark "
  236. :rows="3"
  237. resize='none'
  238. maxlength="200"
  239. show-word-limit
  240. style="height: 60px" >
  241. </el-input>
  242. </el-form-item>
  243. </el-col>
  244. </el-row>
  245. </el-form>
  246. <el-footer style="height:40px;margin-top: 60px;text-align:center">
  247. <el-button type="primary" @click="closeNotify()">保存</el-button>
  248. <el-button type="primary" @click="closeModalFlag=false">关闭</el-button>
  249. </el-footer>
  250. </el-dialog>
  251. <!-- 库存预览模态框 -->
  252. <el-dialog
  253. title="库存匹配预览"
  254. :visible.sync="previewDialogVisible"
  255. width="80%"
  256. :close-on-click-modal="false">
  257. <el-table
  258. :data="previewData"
  259. border
  260. v-loading="previewLoading"
  261. style="width: 100%;"
  262. height="300"
  263. :row-class-name="getRowClassName">
  264. <el-table-column
  265. prop="rowNo"
  266. label="行号"
  267. width="80"
  268. align="center">
  269. </el-table-column>
  270. <el-table-column
  271. prop="productionOrderNo"
  272. label="生产订单号"
  273. width="140"
  274. align="center">
  275. </el-table-column>
  276. <el-table-column
  277. prop="bomLineNo"
  278. label="BOM行号"
  279. width="100"
  280. align="center">
  281. </el-table-column>
  282. <el-table-column
  283. prop="partNo"
  284. label="物料编码"
  285. width="120"
  286. align="center">
  287. </el-table-column>
  288. <el-table-column
  289. prop="requiredQty"
  290. label="需求数量"
  291. width="100"
  292. align="center">
  293. </el-table-column>
  294. <el-table-column
  295. prop="isWarehouseSatisfied"
  296. label="立库是否满足"
  297. width="120"
  298. align="center">
  299. <template slot-scope="scope">
  300. <span :style="{color: scope.row.isWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}">
  301. {{ scope.row.isWarehouseSatisfied === 'Y' ? '是' : '否' }}
  302. </span>
  303. </template>
  304. </el-table-column>
  305. <el-table-column
  306. prop="isOtherWarehouseSatisfied"
  307. label="分切仓库是否满足"
  308. width="140"
  309. align="center">
  310. <template slot-scope="scope">
  311. <span v-if="scope.row.isOtherWarehouseSatisfied" :style="{color: scope.row.isOtherWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}">
  312. {{ scope.row.isOtherWarehouseSatisfied === 'Y' ? '是' : '否' }}
  313. </span>
  314. </template>
  315. </el-table-column>
  316. <el-table-column
  317. prop="matchedBarcodes"
  318. label="匹配条码"
  319. min-width="200"
  320. align="left"
  321. show-overflow-tooltip>
  322. </el-table-column>
  323. </el-table>
  324. <span slot="footer" class="dialog-footer">
  325. <el-button type="primary" class="yzzButtonAn" @click="pushToWCS">推送至WCS</el-button>
  326. <el-button @click="previewDialogVisible = false">关闭</el-button>
  327. </span>
  328. </el-dialog>
  329. </div>
  330. </template>
  331. <script>
  332. import {
  333. searchNotifyHeaderNew
  334. , searchNotifyOrderListNew
  335. , searchNotifyMaterialListNew
  336. , searchSumNotifyMaterialListNew
  337. , deleteNotifySOSPlus
  338. , updateNotifyStatusNew
  339. , deleteNotifyMaterial
  340. , searchNotifyLogNew
  341. , searchNotifyLogCloseNew
  342. , pushNotifyToWcs
  343. , checkIssueNotifyInventory
  344. , pushInventoryToWcs
  345. } from "@/api/orderIssure/soIssueNotify.js"
  346. export default {
  347. data() {
  348. return {
  349. height:200,
  350. activeName: 'detail',
  351. dataList: [],
  352. dataList2: [],
  353. dataList3: [],
  354. dataList4: [],
  355. dataList5: [],
  356. dataList6: [],
  357. userBuList:[],
  358. createNotifyFlag: false,
  359. saveOrderDetailFlag: false,
  360. closeData:{
  361. site:'',
  362. notifyNo:'',
  363. closeRemark:'',
  364. username:this.$store.state.user.name,
  365. },
  366. closeModalFlag:false,
  367. searchData: {
  368. page: 1,
  369. limit: 100,
  370. site:'',
  371. userName: '',
  372. notifyNo: '',
  373. status: '',
  374. issueFlag: '',
  375. loginUserName: this.$store.state.user.name,
  376. issueResult: '',
  377. startDate: this.dayjs().format("YYYY-MM-DD"),
  378. endDate: this.dayjs().format("YYYY-MM-DD"),
  379. sql: "",
  380. },
  381. notifyData:{
  382. site: '',
  383. bu: '',
  384. notifyNo: '',
  385. notifyDate: '',
  386. enteredDate: '',
  387. userName: this.$store.state.user.name,
  388. userDisplay: '',
  389. remark: '',
  390. planIssueDate: '',
  391. outWorkOrderFlag: false,
  392. },
  393. pageIndex: 1,
  394. pageSize: 100,
  395. totalPage: 0,
  396. //工单分页
  397. co_pageIndex: 1,
  398. co_pageSize: 100,
  399. co_totalPage: 0,
  400. dataListLoading: false,
  401. currentRow:'',
  402. columnList1:[
  403. {
  404. userId: this.$store.state.user.name,
  405. functionId: 701002,
  406. serialNumber: '701002Table1NotifyNo',
  407. tableId: "701002Table1",
  408. tableName: "领料申请主表",
  409. columnProp: "notifyNo",
  410. headerAlign: "center",
  411. align: "center",
  412. columnLabel: "申请单单号",
  413. columnHidden: false,
  414. columnImage: false,
  415. columnSortable: false,
  416. sortLv: 0,
  417. status: true,
  418. fixed: '',
  419. columnWidth: 100
  420. },{
  421. userId: this.$store.state.user.name,
  422. functionId: 701002,
  423. serialNumber: '701002Table1NotifyDate',
  424. tableId: "701002Table1",
  425. tableName: "领料申请主表",
  426. columnProp: "notifyDate",
  427. headerAlign: "center",
  428. align: "center",
  429. columnLabel: "申请日期",
  430. columnHidden: false,
  431. columnImage: false,
  432. columnSortable: false,
  433. sortLv: 0,
  434. status: true,
  435. fixed: '',
  436. columnWidth: 100
  437. }, {
  438. userId: this.$store.state.user.name,
  439. functionId: 701002,
  440. serialNumber: '701002Table1UserName',
  441. tableId: "701002Table1",
  442. tableName: "领料申请主表",
  443. columnProp: "username",
  444. headerAlign: "center",
  445. align: "left",
  446. columnLabel: "申请账号",
  447. columnHidden: false,
  448. columnImage: false,
  449. columnSortable: false,
  450. sortLv: 0,
  451. status: true,
  452. fixed: '',
  453. columnWidth: 100
  454. },{
  455. userId: this.$store.state.user.name,
  456. functionId: 701002,
  457. serialNumber: '701002Table1EnteredDate',
  458. tableId: "701002Table1",
  459. tableName: "领料申请主表",
  460. columnProp: "enteredDate",
  461. headerAlign: "center",
  462. align: "center",
  463. columnLabel: "录入时间",
  464. columnHidden: false,
  465. columnImage: false,
  466. columnSortable: false,
  467. sortLv: 0,
  468. status: true,
  469. fixed: '',
  470. columnWidth: 120
  471. },{
  472. userId: this.$store.state.user.name,
  473. functionId: 701002,
  474. serialNumber: '701002Table1IssueFlag',
  475. tableId: "701002Table1",
  476. tableName: "领料申请主表",
  477. columnProp: "issueFlag",
  478. headerAlign: "center",
  479. align: "center",
  480. columnLabel: "是否领料",
  481. columnHidden: false,
  482. columnImage: false,
  483. columnSortable: false,
  484. sortLv: 0,
  485. status: true,
  486. fixed: '',
  487. columnWidth: 60
  488. },{
  489. userId: this.$store.state.user.name,
  490. functionId: 701002,
  491. serialNumber: '701002Table1IssueResult',
  492. tableId: "701002Table1",
  493. tableName: "领料申请主表",
  494. columnProp: "issueResult",
  495. headerAlign: "center",
  496. align: "left",
  497. columnLabel: "领料结果",
  498. columnHidden: false,
  499. columnImage: false,
  500. columnSortable: false,
  501. sortLv: 0,
  502. status: true,
  503. fixed: '',
  504. columnWidth: 120
  505. },{
  506. userId: this.$store.state.user.name,
  507. functionId: 701002,
  508. serialNumber: '701002Table1Status',
  509. tableId: "701002Table1",
  510. tableName: "领料申请主表",
  511. columnProp: "status",
  512. headerAlign: "center",
  513. align: "left",
  514. columnLabel: "状态",
  515. columnHidden: false,
  516. columnImage: false,
  517. columnSortable: false,
  518. sortLv: 0,
  519. status: true,
  520. fixed: '',
  521. columnWidth: 80
  522. },{
  523. userId: this.$store.state.user.name,
  524. functionId: 701002,
  525. serialNumber: '701002Table1ConfirmStatus',
  526. tableId: "701002Table1",
  527. tableName: "领料申请主表",
  528. columnProp: "confirmStatus",
  529. headerAlign: "center",
  530. align: "center",
  531. columnLabel: "确认状态",
  532. columnHidden: false,
  533. columnImage: false,
  534. columnSortable: false,
  535. sortLv: 0,
  536. status: true,
  537. fixed: '',
  538. columnWidth: 80
  539. },{
  540. userId: this.$store.state.user.name,
  541. functionId: 701002,
  542. serialNumber: '701002Table1WcsPushFlag',
  543. tableId: "701002Table1",
  544. tableName: "领料申请主表",
  545. columnProp: "pushWcsFlag",
  546. headerAlign: "center",
  547. align: "left",
  548. columnLabel: "推送WCS",
  549. columnHidden: false,
  550. columnImage: false,
  551. columnSortable: false,
  552. sortLv: 0,
  553. status: true,
  554. fixed: '',
  555. columnWidth: 80
  556. },{
  557. userId: this.$store.state.user.name,
  558. functionId: 701002,
  559. serialNumber: '701002Table1Remark',
  560. tableId: "701002Table1",
  561. tableName: "领料申请主表",
  562. columnProp: "remark",
  563. headerAlign: "center",
  564. align: "left",
  565. columnLabel: "备注",
  566. columnHidden: false,
  567. columnImage: false,
  568. columnSortable: false,
  569. sortLv: 0,
  570. status: true,
  571. fixed: '',
  572. columnWidth: 200
  573. },
  574. ],
  575. columnList2:[
  576. {
  577. userId: this.$store.state.user.name,
  578. functionId: 701002,
  579. serialNumber: '701002Table2ItemNo',
  580. tableId: "701002Table2",
  581. tableName: "申请单派工单明细表",
  582. columnProp: "itemNo",
  583. headerAlign: "center",
  584. align: "right",
  585. columnLabel: "序号",
  586. columnHidden: false,
  587. columnImage: false,
  588. columnSortable: false,
  589. sortLv: 0,
  590. status: true,
  591. fixed: '',
  592. columnWidth: 40
  593. },
  594. {
  595. userId: this.$store.state.user.name,
  596. functionId: 701002,
  597. serialNumber: '701002Table2NeedDate',
  598. tableId: "701002Table2",
  599. tableName: "领料申请派工单子表",
  600. columnProp: 'needDate',
  601. headerAlign: "center",
  602. align: "left",
  603. columnLabel: '要求发料时间',
  604. columnHidden: false,
  605. columnImage: false,
  606. columnSortable: false,
  607. sortLv: 0,
  608. status: true,
  609. fixed: '',
  610. columnWidth: 80,
  611. }, {
  612. userId: this.$store.state.user.name,
  613. functionId: 701002,
  614. serialNumber: '701002Table2SOOrderNo',
  615. tableId: "701002Table2",
  616. tableName: "申请单派工单明细表",
  617. columnProp: "soorderNo",
  618. headerAlign: "center",
  619. align: "left",
  620. columnLabel: "生产订单",
  621. columnHidden: false,
  622. columnImage: false,
  623. columnSortable: false,
  624. sortLv: 0,
  625. status: true,
  626. fixed: '',
  627. columnWidth: 120
  628. }, {
  629. userId: this.$store.state.user.name,
  630. functionId: 701002,
  631. serialNumber: '701002Table2FGPartNo',
  632. tableId: "701002Table2",
  633. tableName: "申请单派工单明细表",
  634. columnProp: "fgPartNo",
  635. headerAlign: "center",
  636. align: "left",
  637. columnLabel: "工单物料",
  638. columnHidden: false,
  639. columnImage: false,
  640. columnSortable: false,
  641. sortLv: 0,
  642. status: true,
  643. fixed: '',
  644. columnWidth: 80
  645. }, {
  646. userId: this.$store.state.user.name,
  647. functionId: 701002,
  648. serialNumber: '701002Table2ReleaseNo',
  649. tableId: "701002Table2",
  650. tableName: "申请单派工单明细表",
  651. columnProp: "releaseNo",
  652. headerAlign: "center",
  653. align: "left",
  654. columnLabel: "发布号",
  655. columnHidden: false,
  656. columnImage: false,
  657. columnSortable: false,
  658. sortLv: 0,
  659. status: true,
  660. fixed: '',
  661. columnWidth: 80
  662. }, {
  663. userId: this.$store.state.user.name,
  664. functionId: 701002,
  665. serialNumber: '701002Table2SequenceNo',
  666. tableId: "701002Table2",
  667. tableName: "申请单派工单明细表",
  668. columnProp: "sequenceNo",
  669. headerAlign: "center",
  670. align: "left",
  671. columnLabel: "序号",
  672. columnHidden: false,
  673. columnImage: false,
  674. columnSortable: false,
  675. sortLv: 0,
  676. status: true,
  677. fixed: '',
  678. columnWidth: 80
  679. }
  680. ],
  681. columnList3:[
  682. {
  683. userId: this.$store.state.user.name,
  684. functionId: 701002,
  685. serialNumber: '701002Table3ItemNo',
  686. tableId: "701002Table3",
  687. tableName: "申请单材料明细表",
  688. columnProp: "itemNo",
  689. headerAlign: "center",
  690. align: "right",
  691. columnLabel: "申请单序号",
  692. columnHidden: false,
  693. columnImage: false,
  694. columnSortable: false,
  695. sortLv: 0,
  696. status: true,
  697. fixed: '',
  698. columnWidth: 80
  699. },{
  700. userId: this.$store.state.user.name,
  701. functionId: 701002,
  702. serialNumber: '701002Table3ComponentPartNo',
  703. tableId: "701002Table3",
  704. tableName: "申请单材料明细表",
  705. columnProp: "componentPartNo",
  706. headerAlign: "center",
  707. align: "center",
  708. columnLabel: "材料编码",
  709. columnHidden: false,
  710. columnImage: false,
  711. columnSortable: false,
  712. sortLv: 0,
  713. status: true,
  714. fixed: '',
  715. columnWidth: 100
  716. },{
  717. userId: this.$store.state.user.name,
  718. functionId: 701002,
  719. serialNumber: '701002Table3NeedDate',
  720. tableId: "701002Table3",
  721. tableName: "申请单材料明细表",
  722. columnProp: "needDate",
  723. headerAlign: "center",
  724. align: "center",
  725. columnLabel: "需求时间",
  726. columnHidden: false,
  727. columnImage: false,
  728. columnSortable: false,
  729. sortLv: 0,
  730. status: true,
  731. fixed: '',
  732. columnWidth: 110
  733. },{
  734. userId: this.$store.state.user.name,
  735. functionId: 701002,
  736. serialNumber: '701002Table3QtyToIssue',
  737. tableId: "701002Table3",
  738. tableName: "申请单材料明细表",
  739. columnProp: "qtyToIssue",
  740. headerAlign: "center",
  741. align: "right",
  742. columnLabel: "申请数量",
  743. columnHidden: false,
  744. columnImage: false,
  745. columnSortable: false,
  746. sortLv: 0,
  747. status: true,
  748. fixed: '',
  749. columnWidth: 80
  750. },{
  751. userId: this.$store.state.user.name,
  752. functionId: 701002,
  753. serialNumber: '701002Table3QtyToIssueOriginal',
  754. tableId: "701002Table3",
  755. tableName: "申请单材料明细表",
  756. columnProp: "qtyToIssueOriginal",
  757. headerAlign: "center",
  758. align: "right",
  759. columnLabel: "已发数量",
  760. columnHidden: false,
  761. columnImage: false,
  762. columnSortable: false,
  763. sortLv: 0,
  764. status: true,
  765. fixed: '',
  766. columnWidth: 80
  767. },{
  768. userId: this.$store.state.user.name,
  769. functionId: 701002,
  770. serialNumber: '701002Table3IssueType',
  771. tableId: "701002Table3",
  772. tableName: "申请单材料明细表",
  773. columnProp: "issueType",
  774. headerAlign: "center",
  775. align: "right",
  776. columnLabel: "类型",
  777. columnHidden: false,
  778. columnImage: false,
  779. columnSortable: false,
  780. sortLv: 0,
  781. status: true,
  782. fixed: '',
  783. columnWidth: 80
  784. },{
  785. userId: this.$store.state.user.name,
  786. functionId: 701002,
  787. serialNumber: '701002Table3Remark',
  788. tableId: "701002Table3",
  789. tableName: "申请单材料明细表",
  790. columnProp: "remark",
  791. headerAlign: "center",
  792. align: "left",
  793. columnLabel: "备注",
  794. columnHidden: false,
  795. columnImage: false,
  796. columnSortable: false,
  797. sortLv: 0,
  798. status: true,
  799. fixed: '',
  800. columnWidth: 160
  801. },{
  802. userId: this.$store.state.user.name,
  803. functionId: 701002,
  804. serialNumber: '701002Table3SOOrderNo',
  805. tableId: "701002Table3",
  806. tableName: "申请单材料明细表",
  807. columnProp: "soorderNo",
  808. headerAlign: "center",
  809. align: "left",
  810. columnLabel: "生产订单",
  811. columnHidden: false,
  812. columnImage: false,
  813. columnSortable: false,
  814. sortLv: 0,
  815. status: true,
  816. fixed: '',
  817. columnWidth: 120
  818. },{
  819. userId: this.$store.state.user.name,
  820. functionId: 701002,
  821. serialNumber: '701002Table3BOMItemNo',
  822. tableId: "701002Table3",
  823. tableName: "申请单材料明细表",
  824. columnProp: "bomitemNo",
  825. headerAlign: "center",
  826. align: "right",
  827. columnLabel: "BOM序号",
  828. columnHidden: false,
  829. columnImage: false,
  830. columnSortable: false,
  831. sortLv: 0,
  832. status: true,
  833. fixed: '',
  834. columnWidth: 80
  835. },
  836. ],
  837. columnList4:[
  838. {
  839. userId: this.$store.state.user.name,
  840. functionId: 701002,
  841. serialNumber: '701002Table4IssueType',
  842. tableId: "701002Table4",
  843. tableName: "申请单材料明细表",
  844. columnProp: "issueType",
  845. headerAlign: "center",
  846. align: "center",
  847. columnLabel: "类型",
  848. columnHidden: false,
  849. columnImage: false,
  850. columnSortable: false,
  851. sortLv: 0,
  852. status: true,
  853. fixed: '',
  854. columnWidth: 100
  855. },
  856. {
  857. userId: this.$store.state.user.name,
  858. functionId: 701002,
  859. serialNumber: '701002Table4ComponentPartNo',
  860. tableId: "701002Table4",
  861. tableName: "申请单材料明细表",
  862. columnProp: "componentPartNo",
  863. headerAlign: "center",
  864. align: "center",
  865. columnLabel: "材料编码",
  866. columnHidden: false,
  867. columnImage: false,
  868. columnSortable: false,
  869. sortLv: 0,
  870. status: true,
  871. fixed: '',
  872. columnWidth: 100
  873. },{
  874. userId: this.$store.state.user.name,
  875. functionId: 701002,
  876. serialNumber: '701002Table4PartDesc',
  877. tableId: "701002Table4",
  878. tableName: "申请单材料明细表",
  879. columnProp: "partDesc",
  880. headerAlign: "center",
  881. align: "left",
  882. columnLabel: "材料名称",
  883. columnHidden: false,
  884. columnImage: false,
  885. columnSortable: false,
  886. sortLv: 0,
  887. status: true,
  888. fixed: '',
  889. columnWidth: 130
  890. },{
  891. userId: this.$store.state.user.name,
  892. functionId: 701002,
  893. serialNumber: '701002Table4QtyToIssue',
  894. tableId: "701002Table4",
  895. tableName: "申请单材料明细表",
  896. columnProp: "qtyToIssue",
  897. headerAlign: "center",
  898. align: "right",
  899. columnLabel: "合计申请数量",
  900. columnHidden: false,
  901. columnImage: false,
  902. columnSortable: false,
  903. sortLv: 0,
  904. status: true,
  905. fixed: '',
  906. columnWidth: 80
  907. },{
  908. userId: this.$store.state.user.name,
  909. functionId: 701002,
  910. serialNumber: '701002Table4QtyToIssueOriginal',
  911. tableId: "701002Table4",
  912. tableName: "申请单材料明细表",
  913. columnProp: "qtyToIssueOriginal",
  914. headerAlign: "center",
  915. align: "right",
  916. columnLabel: "合计已发数量",
  917. columnHidden: false,
  918. columnImage: false,
  919. columnSortable: false,
  920. sortLv: 0,
  921. status: true,
  922. fixed: '',
  923. columnWidth: 80
  924. },
  925. ],
  926. // 导出 start
  927. exportData: [],
  928. exportName: '发料申请单'+this.dayjs().format('YYYYMMDDHHmmss'),
  929. exportHeader: ["发料申请单"],
  930. exportFooter: [],
  931. // 导出 end
  932. orderDetailData:{
  933. orderNo:'',
  934. seqNo:'',
  935. locationNo:'',
  936. qtyrequired:'',
  937. issureQty:0,
  938. partDesc:'',
  939. partNo:'',
  940. resourceId:'',
  941. resourceDesc:'',
  942. needDate:'',
  943. itemDesc:'',
  944. workCenterNo:'',
  945. itemNo:0,
  946. materialType:'BOM物料',
  947. },
  948. chooseSOSModalFlag: false,
  949. chooseSOSData: {
  950. orderno: '',
  951. seqno: '',
  952. sResourceid: '',
  953. startDate: '',
  954. endDate: '',
  955. },
  956. chooseOrderModalFlag: false,
  957. chooseOrderData: {
  958. page: 1,
  959. limit: 100,
  960. orderNo: '',
  961. status: '',
  962. date3: '',
  963. date4: '',
  964. statusList: '',
  965. },
  966. chooseOrderList: [],
  967. chooseOperationModalFlag: false,
  968. chooseOperationData: {
  969. orderNo: '',
  970. site: '',
  971. itemDesc: ''
  972. },
  973. chooseOperationList: [],
  974. chooseResourceModalFlag: false,
  975. chooseResourceData: {
  976. site: '',
  977. workCenterNo: '',
  978. resourceID: '',
  979. resourceDesc: '',
  980. },
  981. chooseResourceList: [],
  982. chooseSOSList: [],
  983. choosePartModalFlag: false,
  984. choosePartData: {
  985. site: '',
  986. sourceBu: '',
  987. partNo: '',
  988. partDesc: '',
  989. spec: '',
  990. },
  991. choosePartList: [],
  992. // 预览相关数据
  993. previewDialogVisible: false,
  994. previewLoading: false,
  995. previewData: [],
  996. currentRow: {} // 当前查看的申请单行数据
  997. }
  998. },
  999. mounted () {
  1000. this.$nextTick(() => {
  1001. this.height = (window.innerHeight- 315) / 2
  1002. })
  1003. },
  1004. created () {
  1005. },
  1006. methods: {
  1007. // 每页数
  1008. sizeChangeHandle (val) {
  1009. this.pageSize = val
  1010. this.searchTable()
  1011. },
  1012. // 当前页
  1013. currentChangeHandle (val) {
  1014. this.pageIndex = val
  1015. this.searchTable()
  1016. },
  1017. tabClick (tab, event) {
  1018. // 刷新列表数据
  1019. this.refreshCurrentTabTable()
  1020. },
  1021. changeData(row){
  1022. this.currentRow = JSON.parse(JSON.stringify(row));
  1023. this.refreshCurrentTabTable ();
  1024. },
  1025. refreshCurrentTabTable(){
  1026. if(this.currentRow===''||this.currentRow===null){
  1027. this.currentRow={site:'',notifyNo:''}
  1028. }
  1029. if(this.activeName==='detail'){
  1030. searchNotifyOrderListNew(this.currentRow).then(({data}) => {
  1031. //区分请求成功和失败的状况
  1032. if (data && data.code == 0) {
  1033. this.dataList2 = data.rows
  1034. } else {
  1035. this.dataList2 = [];
  1036. }
  1037. });
  1038. }else if(this.activeName==='sub'){
  1039. searchNotifyMaterialListNew(this.currentRow).then(({data}) => {
  1040. //区分请求成功和失败的状况
  1041. if (data && data.code == 0) {
  1042. this.dataList3 = data.rows
  1043. } else {
  1044. this.dataList3 = [];
  1045. }
  1046. });
  1047. }else if(this.activeName==='change'){
  1048. searchNotifyLogNew(this.currentRow).then(({data}) => {
  1049. //区分请求成功和失败的状况
  1050. if (data && data.code == 0) {
  1051. this.dataList5 = data.rows
  1052. } else {
  1053. this.dataList5 = [];
  1054. }
  1055. });
  1056. }else if(this.activeName==='close'){
  1057. searchNotifyLogCloseNew(this.currentRow).then(({data}) => {
  1058. //区分请求成功和失败的状况
  1059. if (data && data.code == 0) {
  1060. this.dataList6 = data.rows
  1061. } else {
  1062. this.dataList6 = [];
  1063. }
  1064. });
  1065. }else {
  1066. searchSumNotifyMaterialListNew(this.currentRow).then(({data}) => {
  1067. //区分请求成功和失败的状况
  1068. if (data && data.code == 0) {
  1069. this.dataList4 = data.rows
  1070. } else {
  1071. this.dataList4 = [];
  1072. }
  1073. });
  1074. }
  1075. },
  1076. searchTable(){
  1077. this.searchData.limit = this.pageSize
  1078. this.searchData.page = this.pageIndex
  1079. searchNotifyHeaderNew(this.searchData).then(({data}) => {
  1080. //区分请求成功和失败的状况
  1081. if (data && data.code == 0) {
  1082. this.dataList = data.page.list
  1083. this.pageIndex = data.page.currPage
  1084. this.pageSize = data.page.pageSize
  1085. this.totalPage = data.page.totalCount
  1086. } else {
  1087. this.dataList = [];
  1088. }
  1089. });
  1090. },
  1091. closeNotifyModel(row){
  1092. this.closeData.site=row.site
  1093. this.closeData.notifyNo=row.notifyNo
  1094. this.closeData.closeRemark=''
  1095. this.closeModalFlag=true
  1096. },
  1097. closeNotify(){
  1098. if(this.closeData.closeRemark==null||this.closeData.closeRemark===''){
  1099. this.$alert("必须输入关闭原因", '错误', {
  1100. confirmButtonText: '确定'
  1101. })
  1102. return false;
  1103. }
  1104. let inData={
  1105. site:this.closeData.site,
  1106. notifyNo:this.closeData.notifyNo,
  1107. closeRemark:this.closeData.closeRemark,
  1108. username:this.$store.state.user.name,
  1109. status:'已关闭',
  1110. }
  1111. updateNotifyStatusNew(inData).then(({data}) => {
  1112. if (data && data.code === 0) {
  1113. this.closeModalFlag=false
  1114. this.searchTable()
  1115. this.$message({
  1116. message: '操作成功',
  1117. type: 'success',
  1118. duration: 1500,
  1119. onClose: () => {}
  1120. })
  1121. } else {
  1122. this.$alert(data.msg, '错误', {
  1123. confirmButtonText: '确定'
  1124. })
  1125. }
  1126. })
  1127. },
  1128. openNotify(row){
  1129. this.$confirm('确认打开?', '提示', {
  1130. confirmButtonText: '确定',
  1131. cancelButtonText: '取消',
  1132. type: 'warning'
  1133. }).then(() => {
  1134. let inData={
  1135. site:row.site,
  1136. notifyNo:row.notifyNo,
  1137. status:'ISSUE',
  1138. }
  1139. updateNotifyStatusNew(inData).then(({data}) => {
  1140. if (data && data.code === 0) {
  1141. this.searchTable()
  1142. this.$message({
  1143. message: '操作成功',
  1144. type: 'success',
  1145. duration: 1500,
  1146. onClose: () => {}
  1147. })
  1148. } else {
  1149. this.$alert(data.msg, '错误', {
  1150. confirmButtonText: '确定'
  1151. })
  1152. }
  1153. })
  1154. })
  1155. },
  1156. // 预览库存匹配情况
  1157. previewInventory(row) {
  1158. this.currentRow = row // 保存当前行数据
  1159. this.previewDialogVisible = true
  1160. this.previewLoading = true
  1161. this.previewData = []
  1162. let inData = {
  1163. site: row.site,
  1164. notifyNo: row.notifyNo
  1165. }
  1166. checkIssueNotifyInventory(inData).then(({data}) => {
  1167. this.previewLoading = false
  1168. if (data && data.code === 0) {
  1169. this.previewData = data.rows || []
  1170. console.log('库存预览数据:', this.previewData)
  1171. } else {
  1172. this.$alert(data.msg, '错误', {
  1173. confirmButtonText: '确定'
  1174. })
  1175. }
  1176. }).catch(() => {
  1177. this.previewLoading = false
  1178. this.$message.error('获取库存预览失败')
  1179. })
  1180. },
  1181. // 根据订单满足状态设置行样式
  1182. getRowClassName({row}) {
  1183. if (row.orderSatisfactionStatus === 1) {
  1184. return 'success-row' // 绿色:完全立库满足
  1185. } else if (row.orderSatisfactionStatus === 2) {
  1186. return 'warning-row' // 黄色:立库+分切区满足
  1187. } else if (row.orderSatisfactionStatus === 3) {
  1188. return 'danger-row' // 红色:存在不满足
  1189. }
  1190. return ''
  1191. },
  1192. // 从预览对话框推送至WCS
  1193. pushToWCS() {
  1194. // 筛选绿色和黄色的数据(orderSatisfactionStatus = 1 或 2)
  1195. const validData = this.previewData.filter(item =>
  1196. item.orderSatisfactionStatus === 1 || item.orderSatisfactionStatus === 2
  1197. )
  1198. if (validData.length === 0) {
  1199. this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)')
  1200. return
  1201. }
  1202. this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
  1203. confirmButtonText: '确定',
  1204. cancelButtonText: '取消',
  1205. type: 'warning'
  1206. }).then(() => {
  1207. const inData = {
  1208. site: this.currentRow.site,
  1209. notifyNo: this.currentRow.notifyNo,
  1210. inventoryList: validData
  1211. }
  1212. pushInventoryToWcs(inData).then(({data}) => {
  1213. if (data && data.code === 0) {
  1214. this.$message({
  1215. message: '推送WCS成功',
  1216. type: 'success',
  1217. duration: 1500
  1218. })
  1219. this.previewDialogVisible = false
  1220. this.searchTable()
  1221. } else {
  1222. this.$alert(data.msg, '错误', {
  1223. confirmButtonText: '确定'
  1224. })
  1225. }
  1226. }).catch(() => {
  1227. this.$message.error('推送WCS失败')
  1228. })
  1229. })
  1230. },
  1231. pushToWcs(row){
  1232. this.$confirm('确认推送到WCS?', '提示', {
  1233. confirmButtonText: '确定',
  1234. cancelButtonText: '取消',
  1235. type: 'warning'
  1236. }).then(() => {
  1237. let inData={
  1238. site: row.site,
  1239. notifyNo: row.notifyNo
  1240. }
  1241. pushNotifyToWcs(inData).then(({data}) => {
  1242. if (data && data.code === 0) {
  1243. this.searchTable()
  1244. this.$message({
  1245. message: '推送WCS成功',
  1246. type: 'success',
  1247. duration: 1500,
  1248. onClose: () => {}
  1249. })
  1250. } else {
  1251. this.$alert(data.msg, '错误', {
  1252. confirmButtonText: '确定'
  1253. })
  1254. }
  1255. })
  1256. })
  1257. },
  1258. deleteNotifyMaterial(row){
  1259. this.$confirm('确认删除?', '提示', {
  1260. confirmButtonText: '确定',
  1261. cancelButtonText: '取消',
  1262. type: 'warning'
  1263. }).then(() => {
  1264. deleteNotifyMaterial(row).then(({data}) => {
  1265. if (data && data.code === 0) {
  1266. this.refreshCurrentTabTable()
  1267. this.$message({
  1268. message: '操作成功',
  1269. type: 'success',
  1270. duration: 1500,
  1271. onClose: () => {}
  1272. })
  1273. } else {
  1274. this.$alert(data.msg, '错误', {
  1275. confirmButtonText: '确定'
  1276. })
  1277. }
  1278. })
  1279. })
  1280. },
  1281. deleteNotifySOSPlus(row){
  1282. this.$confirm('确认删除?', '提示', {
  1283. confirmButtonText: '确定',
  1284. cancelButtonText: '取消',
  1285. type: 'warning'
  1286. }).then(() => {
  1287. deleteNotifySOSPlus(row).then(({data}) => {
  1288. if (data && data.code === 0) {
  1289. this.refreshCurrentTabTable()
  1290. this.$message({
  1291. message: '操作成功',
  1292. type: 'success',
  1293. duration: 1500,
  1294. onClose: () => {}
  1295. })
  1296. } else {
  1297. this.$alert(data.msg, '错误', {
  1298. confirmButtonText: '确定'
  1299. })
  1300. }
  1301. })
  1302. })
  1303. },
  1304. //导出excel
  1305. async createExportData() {
  1306. this.searchData.limit = -1
  1307. this.searchData.page = 1
  1308. const {data} = await searchNotifyHeaderNew(this.searchData)
  1309. return data.page.list;
  1310. },
  1311. startDownload() {
  1312. // this.exportData = this.dataList
  1313. },
  1314. finishDownload() {
  1315. },
  1316. fields() {
  1317. let json = "{"
  1318. this.columnList1.forEach((item, index) => {
  1319. if (index == this.columnList1.length - 1) {
  1320. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1321. } else {
  1322. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1323. }
  1324. })
  1325. json += "}"
  1326. let s = eval("(" + json + ")")
  1327. return s
  1328. },
  1329. tableRowClassName ({row, rowIndex}) {
  1330. if (row.qtyToIssueOriginal<row.qtyToIssue&&new Date(row.needDate)<new Date(this.dayjs().format("YYYY-MM-DD HH:mm"))) {
  1331. return 'error-row'
  1332. }
  1333. return ''
  1334. },
  1335. },
  1336. }
  1337. </script>
  1338. <style scoped>
  1339. /deep/ .el-form-item--medium .el-form-item__content {
  1340. height: auto;
  1341. }
  1342. .disabled {
  1343. cursor: not-allowed !important;
  1344. color: #C0C4CC !important;
  1345. pointer-events: none;
  1346. }
  1347. .text-right >>> .el-input__inner {
  1348. text-align: right !important;
  1349. }
  1350. .text-right >>> .el-input-number__input {
  1351. text-align: right !important;
  1352. }
  1353. .single-line-multi-select >>> .el-select__tags {
  1354. display: flex;
  1355. flex-wrap: nowrap;
  1356. overflow: hidden;
  1357. white-space: nowrap;
  1358. max-width: 100%;
  1359. }
  1360. .single-line-multi-select >>> .el-tag {
  1361. flex-shrink: 0;
  1362. max-width: 100px;
  1363. overflow: hidden;
  1364. text-overflow: ellipsis;
  1365. white-space: nowrap;
  1366. }
  1367. .single-line-multi-select >>> .el-select__input {
  1368. flex-shrink: 0;
  1369. min-width: 30px;
  1370. }
  1371. /* 库存预览表格行颜色 */
  1372. /deep/ .el-table .success-row {
  1373. background: #f0f9ff !important;
  1374. border-left: 3px solid #67C23A;
  1375. }
  1376. /deep/ .el-table .warning-row {
  1377. background: #fdf6ec !important;
  1378. border-left: 3px solid #E6A23C;
  1379. }
  1380. /deep/ .el-table .danger-row {
  1381. background: #fef0f0 !important;
  1382. border-left: 3px solid #F56C6C;
  1383. }
  1384. /deep/ .el-table .success-row:hover > td {
  1385. background-color: #ecf5ff !important;
  1386. }
  1387. /deep/ .el-table .warning-row:hover > td {
  1388. background-color: #faecd8 !important;
  1389. }
  1390. /deep/ .el-table .danger-row:hover > td {
  1391. background-color: #fde2e2 !important;
  1392. }
  1393. </style>