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.

1756 lines
57 KiB

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