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.

1137 lines
36 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
  4. <el-row>
  5. <el-col :span="24" style="">
  6. <el-form-item :label="'物料编码:'">
  7. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  8. </el-form-item>
  9. <el-form-item :label="'物料名称:'">
  10. <el-input v-model="searchData.partDesc" clearable style="width: 150px"></el-input>
  11. </el-form-item>
  12. <el-form-item :label="'通知单号:'">
  13. <el-input v-model="searchData.notifyNo" clearable style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="'检验单号:'">
  16. <el-input v-model="searchData.orderNo" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'采购单号:'">
  19. <el-input v-model="searchData.poOrderNo" clearable style="width: 120px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'采购单行号:'">
  22. <el-input v-model="searchData.poItemNo" clearable style="width: 100px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'单据状态:'">
  25. <el-select v-model="searchData.orderStatus" clearable style="width: 100px">
  26. <el-option label="待入库" value="待入库"></el-option>
  27. <el-option label="已完成" value="已完成"></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="检验日期">
  31. <el-date-picker
  32. style="width: 130px"
  33. v-model="searchData.startDate"
  34. value-format="yyyy-MM-dd"
  35. clearable
  36. >
  37. </el-date-picker>
  38. -
  39. <el-date-picker
  40. style="width: 130px"
  41. v-model="searchData.endDate "
  42. value-format="yyyy-MM-dd"
  43. clearable
  44. >
  45. </el-date-picker>
  46. </el-form-item>
  47. <el-form-item :label="' '" >
  48. <el-button class="customer-bun-min" type="primary" @click="getMainData" style="">Query</el-button>
  49. <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. </el-form>
  54. <el-table
  55. :height="height"
  56. :data="mainDataList"
  57. border
  58. ref="mainTable"
  59. highlight-current-row
  60. @row-click="changeData"
  61. v-loading="dataListLoading"
  62. style="margin-top: 0px; width: 100%;">
  63. <el-table-column
  64. header-align="center"
  65. align="center"
  66. width="100"
  67. label="操作">
  68. <template slot-scope="scope">
  69. <a type="text" size="small" @click="addOrUpdateHandle(scope.row)">生成标签</a>
  70. </template>
  71. </el-table-column>
  72. <el-table-column
  73. v-for="(item,index) in columnArray1" :key="index"
  74. :sortable="item.columnSortable"
  75. :prop="item.columnProp"
  76. :header-align="item.headerAlign"
  77. :show-overflow-tooltip="item.showOverflowTooltip"
  78. :align="item.align"
  79. :fixed="item.fixed==''?false:item.fixed"
  80. :min-width="item.columnWidth"
  81. :label="item.columnLabel">
  82. <template slot-scope="scope">
  83. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  84. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  85. style="width: 100px; height: 80px"/></span>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. <el-pagination style="margin-top: 0px"
  90. @size-change="sizeChangeHandle"
  91. @current-change="currentChangeHandle"
  92. :current-page="pageIndex"
  93. :page-sizes="[20, 50, 100, 200, 500]"
  94. :page-size="pageSize"
  95. :total="totalPage"
  96. layout="total, sizes, prev, pager, next, jumper">
  97. </el-pagination>
  98. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
  99. <el-form-item >
  100. <el-button type="primary" @click="printLabels" style="">打印</el-button>
  101. <el-button @click="deleteLabels()" type="primary" style="margin-left: 2px">删除</el-button>
  102. <el-button type="primary" icon="el-icon-upload" @click="openUpload()" style="margin-left: 2px">导入</el-button>
  103. </el-form-item>
  104. </el-form>
  105. <el-table
  106. :height="height"
  107. :data="table2List"
  108. border
  109. ref="table3"
  110. highlight-current-row
  111. @selection-change="handleSelectionChange"
  112. v-loading="dataListLoading"
  113. style="margin-top: 0px; width: 100%;">
  114. <el-table-column
  115. type="selection"
  116. width="55"
  117. align="center">
  118. </el-table-column>
  119. <el-table-column
  120. v-for="(item,index) in columnArray2" :key="index"
  121. :sortable="item.columnSortable"
  122. :prop="item.columnProp"
  123. :header-align="item.headerAlign"
  124. :show-overflow-tooltip="item.showOverflowTooltip"
  125. :align="item.align"
  126. :fixed="item.fixed==''?false:item.fixed"
  127. :min-width="item.columnWidth"
  128. :label="item.columnLabel">
  129. <template slot-scope="scope">
  130. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  131. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  132. style="width: 100px; height: 80px"/></span>
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <el-dialog title="标签发行" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="800px">
  137. <el-form :model="addModelData" label-position="top" style="margin-top: -5px;">
  138. <el-row :gutter="20">
  139. <el-col :span="8">
  140. <el-form-item label="物料编码" >
  141. <el-input v-model="addModelData.partNo" disabled style="width: 100%"></el-input>
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="16">
  145. <el-form-item label="物料名称" >
  146. <el-input v-model="addModelData.partDesc" disabled style="width: 100%"></el-input>
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="8">
  150. <el-form-item label="采购订单" >
  151. <el-input v-model="addModelData.poOrderNo" disabled style="width: 100%"></el-input>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="8">
  155. <el-form-item label="采购订单行号">
  156. <el-input v-model="addModelData.poItemNo" disabled style="width: 100%"></el-input>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="8">
  160. <el-form-item label="通知单">
  161. <el-input v-model="addModelData.orderNo" disabled style="width: 100%"></el-input>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="8">
  165. <el-form-item label="本次到货数量">
  166. <el-input v-model="addModelData.orderQty" disabled style="width: 100%"></el-input>
  167. </el-form-item>
  168. </el-col>
  169. <el-col :span="8">
  170. <el-form-item label="本次到货卷数">
  171. <el-input v-model="addModelData.orderRollCount" disabled style="width: 100%"></el-input>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="8">
  175. <el-form-item label="检验合格数量">
  176. <el-input v-model="addModelData.batchQualifiedQty" disabled style="width: 100%"></el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="4">
  180. <el-form-item label="超入比例" >
  181. <el-input v-model="addModelData.exceedInRatio" disabled style="width: 100%"></el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="4">
  185. <el-form-item label="有效期管理">
  186. <el-input v-model="addModelData.expirationFlag" disabled style="width: 100%"></el-input>
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="8">
  190. <el-form-item label="生产日期" required>
  191. <el-date-picker
  192. v-model="addModelData.productionDate"
  193. type="date"
  194. format="yyyy-MM-dd"
  195. value-format="yyyy-MM-dd"
  196. style="width: 100%">
  197. </el-date-picker>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="8">
  201. <el-form-item label="批次号">
  202. <el-input v-model="addModelData.batchNo" style="width: 100%"></el-input>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="8">
  206. <el-form-item label="发行张数" required>
  207. <el-input v-model="addModelData.rollCount" @blur="getNowRollQty()" @input="handleInput" type="number" style="width: 100%"></el-input>
  208. </el-form-item>
  209. </el-col>
  210. <el-col :span="8">
  211. <el-form-item label="每张数量" required>
  212. <el-input v-model="addModelData.rollQty" @blur="getNowRollQty()" type="number" style="width: 100%"></el-input>
  213. </el-form-item>
  214. </el-col>
  215. <el-col :span="8">
  216. <el-form-item label="尾卷数量">
  217. <el-input v-model="addModelData.tailRollQty" @blur="getNowRollQty()" type="number" style="width: 100%"></el-input>
  218. </el-form-item>
  219. </el-col>
  220. <el-col :span="8">
  221. <el-form-item label="本次发行数量" >
  222. <el-input v-model="addModelData.nowRollQty" disabled style="width: 100%"></el-input>
  223. </el-form-item>
  224. </el-col>
  225. <el-col :span="8">
  226. <el-form-item label="可发行数量">
  227. <el-input v-model="addModelData.remainingIssuableQty" disabled style="width: 100%"></el-input>
  228. </el-form-item>
  229. </el-col>
  230. </el-row>
  231. </el-form>
  232. <div slot="footer" class="dialog-footer" style="text-align: center;">
  233. <el-button type="success" @click="submitDataNoClose()">应用</el-button>
  234. <el-button type="success" @click="submitData()">确定</el-button>
  235. <el-button type="primary" @click="addModelFlag=false">取消</el-button>
  236. </div>
  237. </el-dialog>
  238. <!-- 导入 -->
  239. <qcUpload ref="qcUpload" @refreshPageTables="getDetailTableList()" v-drag></qcUpload>
  240. </div>
  241. </template>
  242. <script>
  243. /*组件*/
  244. import excel from "@/utils/excel-util.js";
  245. import qcUpload from "@/views/modules/qc/qc_upload";
  246. import {
  247. deletePoPartLabelData,
  248. getInboundQcResultData,
  249. getInboundQcResultOtherData,
  250. getPoOrderRollNoOutData, getPoPartLabelData,
  251. submitPoOrderRollNo
  252. } from '../../../api/wms/wms'
  253. import {poPartLabelPrint} from '../clodopLabel/poPartLabel'
  254. export default {
  255. data() {
  256. return {
  257. functionId: this.$route.meta.menuId,
  258. height: 200,
  259. currentRow: {},
  260. searchData:{
  261. site:this.$store.state.user.site,
  262. orderNo:'',
  263. notifyNo: '',
  264. partNo:'',
  265. partDesc:'',
  266. poOrderNo:'',
  267. poItemNo:'',
  268. orderStatus:'待入库',
  269. startDate:'',
  270. endDate:'',
  271. page: 1,
  272. limit: 10,
  273. },
  274. selectionDataList:[],
  275. pageIndex: 1,
  276. pageSize: 50,
  277. totalPage: 0,
  278. mainDataList:[],
  279. table2List:[],
  280. dataListLoading: false,
  281. addModelFlag:false,
  282. addModelData:{
  283. expirationWarningDay:'',
  284. site:'',
  285. buNo:'',
  286. partNo: '',
  287. partDesc: '',
  288. poOrderNo: '',
  289. poItemNo: '',
  290. orderNo: '',
  291. orderQty: '',
  292. supplierId: '',
  293. supplierName: '',
  294. orderRollCount: '',
  295. batchQualifiedQty: '',
  296. remainingIssuableQty: '',
  297. exceedInRatio: '',
  298. expirationFlag: '',
  299. expirationDay: '',
  300. nowRollQty: '',
  301. productionDate: '',
  302. batchNo: '',
  303. rollCount: '1',
  304. rollQty: '',
  305. tailRollQty: '0'
  306. },
  307. columnArray1: [
  308. {
  309. userId: this.$store.state.user.name,
  310. functionId: this.functionId,
  311. serialNumber: '670Table1BuNo',
  312. tableId: "670Table1",
  313. tableName: "采购检验合格单",
  314. columnProp: "buNo",
  315. headerAlign: "center",
  316. align: "center",
  317. columnLabel: "BU",
  318. columnWidth: '70',
  319. columnHidden: false,
  320. columnImage: false,
  321. columnSortable: false,
  322. sortLv: 0,
  323. status: true,
  324. fixed: false
  325. },
  326. {
  327. userId: this.$store.state.user.name,
  328. functionId: this.functionId,
  329. serialNumber: '670Table1NotifyNo',
  330. tableId: "670Table1",
  331. tableName: "采购检验合格单",
  332. columnProp: "notifyNo",
  333. headerAlign: "center",
  334. align: "left",
  335. columnLabel: "通知单号",
  336. columnWidth: '120',
  337. columnHidden: false,
  338. columnImage: false,
  339. columnSortable: false,
  340. sortLv: 1,
  341. status: true,
  342. fixed: false
  343. },
  344. {
  345. userId: this.$store.state.user.name,
  346. functionId: this.functionId,
  347. serialNumber: '670Table1OrderNo',
  348. tableId: "670Table1",
  349. tableName: "采购检验合格单",
  350. columnProp: "orderNo",
  351. headerAlign: "center",
  352. align: "left",
  353. columnLabel: "检验单号",
  354. columnWidth: '120',
  355. columnHidden: false,
  356. columnImage: false,
  357. columnSortable: false,
  358. sortLv: 1,
  359. status: true,
  360. fixed: false
  361. },
  362. {
  363. userId: this.$store.state.user.name,
  364. functionId: this.functionId,
  365. serialNumber: '670Table1OrderStatus',
  366. tableId: "670Table1",
  367. tableName: "采购检验合格单",
  368. columnProp: "orderStatus",
  369. headerAlign: "center",
  370. align: "center",
  371. columnLabel: "单据状态",
  372. columnWidth: '100',
  373. columnHidden: false,
  374. columnImage: false,
  375. columnSortable: false,
  376. sortLv: 2,
  377. status: true,
  378. fixed: false
  379. },
  380. {
  381. userId: this.$store.state.user.name,
  382. functionId: this.functionId,
  383. serialNumber: '670Table1PartNo',
  384. tableId: "670Table1",
  385. tableName: "采购检验合格单",
  386. columnProp: "partNo",
  387. headerAlign: "center",
  388. align: "left",
  389. columnLabel: "物料编码",
  390. columnWidth: '120',
  391. columnHidden: false,
  392. columnImage: false,
  393. columnSortable: false,
  394. sortLv: 3,
  395. status: true,
  396. fixed: false
  397. },
  398. {
  399. userId: this.$store.state.user.name,
  400. functionId: this.functionId,
  401. serialNumber: '670Table1PartDesc',
  402. tableId: "670Table1",
  403. tableName: "采购检验合格单",
  404. columnProp: "partDesc",
  405. headerAlign: "center",
  406. align: "left",
  407. columnLabel: "物料名称",
  408. columnWidth: '200',
  409. columnHidden: false,
  410. columnImage: false,
  411. columnSortable: false,
  412. sortLv: 4,
  413. status: true,
  414. fixed: false
  415. },
  416. {
  417. userId: this.$store.state.user.name,
  418. functionId: this.functionId,
  419. serialNumber: '670Table1OrderQty',
  420. tableId: "670Table1",
  421. tableName: "采购检验合格单",
  422. columnProp: "orderQty",
  423. headerAlign: "center",
  424. align: "right",
  425. columnLabel: "到货数量",
  426. columnWidth: '100',
  427. columnHidden: false,
  428. columnImage: false,
  429. columnSortable: false,
  430. sortLv: 10,
  431. status: true,
  432. fixed: false
  433. },
  434. {
  435. userId: this.$store.state.user.name,
  436. functionId: this.functionId,
  437. serialNumber: '670Table1RollCount',
  438. tableId: "670Table1",
  439. tableName: "采购检验合格单",
  440. columnProp: "rollCount",
  441. headerAlign: "center",
  442. align: "right",
  443. columnLabel: "到货卷数",
  444. columnWidth: '100',
  445. columnHidden: false,
  446. columnImage: false,
  447. columnSortable: false,
  448. sortLv: 11,
  449. status: true,
  450. fixed: false
  451. },
  452. {
  453. userId: this.$store.state.user.name,
  454. functionId: this.functionId,
  455. serialNumber: '670Table1BatchQualifiedQty',
  456. tableId: "670Table1",
  457. tableName: "采购检验合格单",
  458. columnProp: "batchQualifiedQty",
  459. headerAlign: "center",
  460. align: "right",
  461. columnLabel: "允许入库数",
  462. columnWidth: '100',
  463. columnHidden: false,
  464. columnImage: false,
  465. columnSortable: false,
  466. sortLv: 14,
  467. status: true,
  468. fixed: false
  469. },
  470. {
  471. userId: this.$store.state.user.name,
  472. functionId: this.functionId,
  473. serialNumber: '670Table1PoOrderNo',
  474. tableId: "670Table1",
  475. tableName: "采购检验合格单",
  476. columnProp: "poOrderNo",
  477. headerAlign: "center",
  478. align: "left",
  479. columnLabel: "采购订单号",
  480. columnWidth: '120',
  481. columnHidden: false,
  482. columnImage: false,
  483. columnSortable: false,
  484. sortLv: 5,
  485. status: true,
  486. fixed: false
  487. },
  488. {
  489. userId: this.$store.state.user.name,
  490. functionId: this.functionId,
  491. serialNumber: '670Table1PoItemNo',
  492. tableId: "670Table1",
  493. tableName: "采购检验合格单",
  494. columnProp: "poItemNo",
  495. headerAlign: "center",
  496. align: "center",
  497. columnLabel: "行号",
  498. columnWidth: '80',
  499. columnHidden: false,
  500. columnImage: false,
  501. columnSortable: false,
  502. sortLv: 6,
  503. status: true,
  504. fixed: false
  505. },
  506. {
  507. userId: this.$store.state.user.name,
  508. functionId: this.functionId,
  509. serialNumber: '670Table1SupplierName',
  510. tableId: "670Table1",
  511. tableName: "采购检验合格单",
  512. columnProp: "supplierName",
  513. headerAlign: "center",
  514. align: "left",
  515. columnLabel: "供应商",
  516. columnWidth: '120',
  517. columnHidden: false,
  518. columnImage: false,
  519. columnSortable: false,
  520. sortLv: 7,
  521. status: true,
  522. fixed: false
  523. },
  524. {
  525. userId: this.$store.state.user.name,
  526. functionId: this.functionId,
  527. serialNumber: '670Table1InspectorDate',
  528. tableId: "670Table1",
  529. tableName: "采购检验合格单",
  530. columnProp: "inspectorDate",
  531. headerAlign: "center",
  532. align: "center",
  533. columnLabel: "检验日期",
  534. columnWidth: '100',
  535. columnHidden: false,
  536. columnImage: false,
  537. columnSortable: false,
  538. sortLv: 8,
  539. status: true,
  540. fixed: false
  541. },
  542. {
  543. userId: this.$store.state.user.name,
  544. functionId: this.functionId,
  545. serialNumber: '670Table1InspectorNo',
  546. tableId: "670Table1",
  547. tableName: "采购检验合格单",
  548. columnProp: "inspectorNo",
  549. headerAlign: "center",
  550. align: "left",
  551. columnLabel: "检验员",
  552. columnWidth: '100',
  553. columnHidden: false,
  554. columnImage: false,
  555. columnSortable: false,
  556. sortLv: 9,
  557. status: true,
  558. fixed: false
  559. },
  560. {
  561. userId: this.$store.state.user.name,
  562. functionId: this.functionId,
  563. serialNumber: '670Table1InspectionResult',
  564. tableId: "670Table1",
  565. tableName: "采购检验合格单",
  566. columnProp: "inspectionResult",
  567. headerAlign: "center",
  568. align: "center",
  569. columnLabel: "检验结论",
  570. columnWidth: '100',
  571. columnHidden: false,
  572. columnImage: false,
  573. columnSortable: false,
  574. sortLv: 12,
  575. status: true,
  576. fixed: false
  577. },
  578. {
  579. userId: this.$store.state.user.name,
  580. functionId: this.functionId,
  581. serialNumber: '670Table1DisposalMeasures',
  582. tableId: "670Table1",
  583. tableName: "采购检验合格单",
  584. columnProp: "disposalMeasures",
  585. headerAlign: "center",
  586. align: "left",
  587. columnLabel: "处置措施",
  588. columnWidth: '120',
  589. columnHidden: false,
  590. columnImage: false,
  591. columnSortable: false,
  592. sortLv: 13,
  593. status: true,
  594. fixed: false
  595. },
  596. ],
  597. columnArray2: [
  598. {
  599. userId: this.$store.state.user.name,
  600. functionId: this.functionId,
  601. serialNumber: '670Table2OrderId',
  602. tableId: "670Table2",
  603. tableName: "采购物料标签清单",
  604. columnProp: "orderId",
  605. headerAlign: "center",
  606. align: "right",
  607. columnLabel: "No .",
  608. columnWidth: '50',
  609. columnHidden: false,
  610. columnImage: false,
  611. columnSortable: false,
  612. sortLv: 0,
  613. status: true,
  614. fixed: false
  615. },
  616. {
  617. userId: this.$store.state.user.name,
  618. functionId: this.functionId,
  619. serialNumber: '670Table2RollNo',
  620. tableId: "670Table2",
  621. tableName: "采购物料标签清单",
  622. columnProp: "rollNo",
  623. headerAlign: "center",
  624. align: "left",
  625. columnLabel: "标签条码",
  626. columnWidth: '150',
  627. columnHidden: false,
  628. columnImage: false,
  629. columnSortable: false,
  630. sortLv: 1,
  631. status: true,
  632. fixed: false
  633. },
  634. {
  635. userId: this.$store.state.user.name,
  636. functionId: this.functionId,
  637. serialNumber: '670Table2RollQty',
  638. tableId: "670Table2",
  639. tableName: "采购物料标签清单",
  640. columnProp: "rollQty",
  641. headerAlign: "center",
  642. align: "right",
  643. columnLabel: "标签数量",
  644. columnWidth: '100',
  645. columnHidden: false,
  646. columnImage: false,
  647. columnSortable: false,
  648. sortLv: 2,
  649. status: true,
  650. fixed: false
  651. },
  652. {
  653. userId: this.$store.state.user.name,
  654. functionId: this.functionId,
  655. serialNumber: '670Table2HardtagInFlag',
  656. tableId: "670Table2",
  657. tableName: "采购物料标签清单",
  658. columnProp: "hardtagInFlag",
  659. headerAlign: "center",
  660. align: "center",
  661. columnLabel: "标签状态",
  662. columnWidth: '100',
  663. columnHidden: false,
  664. columnImage: false,
  665. columnSortable: false,
  666. sortLv: 3,
  667. status: true,
  668. fixed: false
  669. },
  670. {
  671. userId: this.$store.state.user.name,
  672. functionId: this.functionId,
  673. serialNumber: '670Table2PrintFla',
  674. tableId: "670Table2",
  675. tableName: "采购物料标签清单",
  676. columnProp: "printFlag",
  677. headerAlign: "center",
  678. align: "right",
  679. columnLabel: "打印次数",
  680. columnWidth: '100',
  681. columnHidden: false,
  682. columnImage: false,
  683. columnSortable: false,
  684. sortLv: 4,
  685. status: true,
  686. fixed: false
  687. },
  688. {
  689. userId: this.$store.state.user.name,
  690. functionId: this.functionId,
  691. serialNumber: '670Table2BatchNo',
  692. tableId: "670Table2",
  693. tableName: "采购物料标签清单",
  694. columnProp: "batchNo",
  695. headerAlign: "center",
  696. align: "center",
  697. columnLabel: "批次号",
  698. columnWidth: '120',
  699. columnHidden: false,
  700. columnImage: false,
  701. columnSortable: false,
  702. sortLv: 6,
  703. status: true,
  704. fixed: false
  705. },
  706. {
  707. userId: this.$store.state.user.name,
  708. functionId: this.functionId,
  709. serialNumber: '670Table2ProductionDate',
  710. tableId: "670Table2",
  711. tableName: "采购物料标签清单",
  712. columnProp: "productionDate",
  713. headerAlign: "center",
  714. align: "center",
  715. columnLabel: "生产日期",
  716. columnWidth: '120',
  717. columnHidden: false,
  718. columnImage: false,
  719. columnSortable: false,
  720. sortLv: 6,
  721. status: true,
  722. fixed: false
  723. },
  724. {
  725. userId: this.$store.state.user.name,
  726. functionId: this.functionId,
  727. serialNumber: '670Table2ExpirationDate',
  728. tableId: "670Table2",
  729. tableName: "采购物料标签清单",
  730. columnProp: "expirationDate",
  731. headerAlign: "center",
  732. align: "center",
  733. columnLabel: "失效日期",
  734. columnWidth: '120',
  735. columnHidden: false,
  736. columnImage: false,
  737. columnSortable: false,
  738. sortLv: 6,
  739. status: true,
  740. fixed: false
  741. },
  742. {
  743. userId: this.$store.state.user.name,
  744. functionId: this.functionId,
  745. serialNumber: '670Table2ExpirationWarningDate',
  746. tableId: "670Table2",
  747. tableName: "采购物料标签清单",
  748. columnProp: "expirationWarningDate",
  749. headerAlign: "center",
  750. align: "center",
  751. columnLabel: "失效预警日期",
  752. columnWidth: '120',
  753. columnHidden: false,
  754. columnImage: false,
  755. columnSortable: false,
  756. sortLv: 6,
  757. status: true,
  758. fixed: false
  759. },
  760. {
  761. userId: this.$store.state.user.name,
  762. functionId: this.functionId,
  763. serialNumber: '670Table2OCreatedBy',
  764. tableId: "670Table2",
  765. tableName: "采购物料标签清单",
  766. columnProp: "createdBy",
  767. headerAlign: "center",
  768. align: "left",
  769. columnLabel: "操作员",
  770. columnWidth: '100',
  771. columnHidden: false,
  772. columnImage: false,
  773. columnSortable: false,
  774. sortLv: 7,
  775. status: true,
  776. fixed: false
  777. }
  778. ],
  779. exportName: '采购检验合格单'+this.dayjs().format('YYYYMMDDHHmmss'),
  780. exportName2: '采购物料标签清单'+this.dayjs().format('YYYYMMDDHHmmss'),
  781. }
  782. },
  783. /*组件*/
  784. components: {
  785. excel,
  786. qcUpload,
  787. },
  788. mounted() {
  789. this.$nextTick(() => {
  790. this.height = ( window.innerHeight - 220)/2;
  791. })
  792. },
  793. methods: {
  794. getMainData(){
  795. this.searchData.limit = this.pageSize
  796. this.searchData.page = this.pageIndex
  797. getInboundQcResultData(this.searchData).then(({data}) => {
  798. if (data.code === 0) {
  799. this.mainDataList = data.page.list
  800. this.pageIndex = data.page.currPage
  801. this.pageSize = data.page.pageSize
  802. this.totalPage = data.page.totalCount
  803. //判断是否全部存在数据
  804. if (this.totalPage > 0) {
  805. //设置选中行
  806. this.$refs.mainTable.setCurrentRow(this.mainDataList[0])
  807. this.changeData(this.mainDataList[0])
  808. }else {
  809. this.changeData(null)
  810. }
  811. }
  812. this.dataListLoading = false
  813. })
  814. },
  815. // 每页数
  816. sizeChangeHandle (val) {
  817. this.pageSize = val
  818. this.pageIndex = 1
  819. this.getMainData()
  820. },
  821. // 当前页
  822. currentChangeHandle (val) {
  823. this.pageIndex = val
  824. this.getMainData()
  825. },
  826. async exportExcel() {
  827. this.searchData.limit = -1
  828. this.searchData.page = 1
  829. excel.exportTable({
  830. url: "/wmsPrint/getInboundQcResultData",
  831. columnMapping: this.columnArray1,//可以直接用table,不需要的列就剔除
  832. mergeSetting: [],//需要合并的列
  833. params: this.searchData,
  834. fileName: this.exportName+".xlsx",
  835. rowFetcher: res => res.data,
  836. columnFormatter: [],
  837. dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列
  838. });
  839. },
  840. changeData(row){
  841. this.currentRow=JSON.parse(JSON.stringify(row))
  842. // let inData={
  843. // site:this.currentRow.site,
  844. // buNo:this.currentRow.buNo,
  845. // inspectionNo:this.currentRow.orderNo,
  846. // }
  847. // getPoOrderRollNoOutData(inData).then(({data}) => {
  848. // //区分请求成功和失败的状况
  849. // if (data && data.code == 0) {
  850. // this.table2List = data.rows
  851. //
  852. // } else {
  853. // this.table2List = [];
  854. // }
  855. // });
  856. this.getDetailTableList();
  857. },
  858. getDetailTableList () {
  859. let inData={
  860. site:this.currentRow.site,
  861. buNo:this.currentRow.buNo,
  862. inspectionNo:this.currentRow.orderNo,
  863. }
  864. getPoOrderRollNoOutData(inData).then(({data}) => {
  865. //区分请求成功和失败的状况
  866. if (data && data.code == 0) {
  867. this.table2List = data.rows
  868. } else {
  869. this.table2List = [];
  870. }
  871. });
  872. },
  873. handleSelectionChange(val){
  874. this.selectionDataList = val
  875. console.log(this.selectionDataList)
  876. },
  877. addOrUpdateHandle(row) {
  878. getInboundQcResultOtherData(row).then(({data}) => {
  879. //区分请求成功和失败的状况
  880. if (data && data.code=== 0) {
  881. let outData = data.row
  882. console.log(data.row);
  883. this.addModelData={
  884. site:row.site,
  885. buNo:row.buNo,
  886. partNo: row.partNo,
  887. partDesc: row.partDesc,
  888. poOrderNo: row.poOrderNo,
  889. poItemNo: row.poItemNo,
  890. orderNo: row.orderNo,
  891. orderQty: row.orderQty,
  892. supplierId: row.supplierId,
  893. supplierName: row.supplierName,
  894. orderRollCount: row.rollCount,
  895. batchQualifiedQty: row.batchQualifiedQty,
  896. remainingIssuableQty: outData.remainingIssuableQty,
  897. exceedInRatio: outData.exceedInRatio,
  898. expirationFlag: outData.expirationFlag,
  899. expirationDay:outData.expirationDay?Number(outData.expirationDay):0,
  900. nowRollQty: row.rollQty,
  901. productionDate: this.dayjs().format("YYYY-MM-DD"),
  902. batchNo: '',
  903. rollCount: '1',
  904. rollQty: row.rollQty,
  905. expirationWarningDay: outData.expirationWarningDay,
  906. tailRollQty: '0'
  907. }
  908. if(this.addModelData.exceedInRatio==""||this.addModelData.exceedInRatio==null){
  909. this.addModelData.exceedInRatio=0
  910. }
  911. }
  912. });
  913. this.addModelFlag = true;
  914. },
  915. submitData() {
  916. // 验证必填字段
  917. if (!this.addModelData.productionDate||this.addModelData.productionDate==='') {
  918. this.$message.error('请选择生产日期');
  919. return;
  920. }
  921. if (!this.addModelData.rollCount||this.addModelData.rollCount==='') {
  922. this.$message.error('请输入发行张数');
  923. return;
  924. }
  925. if (!this.addModelData.rollQty||this.addModelData.rollQty==='') {
  926. this.$message.error('请输入每张数量');
  927. return;
  928. }
  929. if ( this.addModelData.nowRollQty>Number(this.addModelData.remainingIssuableQty)+((Number(this.addModelData.exceedInRatio)*Number(this.addModelData.orderQty))/100)) {
  930. this.$message.error('本次发行数量大于剩余可发行数量和超入数量');
  931. return;
  932. }
  933. // 这里可以添加提交逻辑
  934. submitPoOrderRollNo(this.addModelData).then(({data}) => {
  935. if (data && data.code === 0) {
  936. this.$message.success( '操作成功')
  937. this.changeData(this.currentRow);
  938. this.addModelFlag = false;
  939. }else {
  940. this.$message.error(data.msg);
  941. }
  942. })
  943. },
  944. submitDataNoClose() {
  945. // 验证必填字段
  946. if (!this.addModelData.productionDate||this.addModelData.productionDate==='') {
  947. this.$message.error('请选择生产日期');
  948. return;
  949. }
  950. if (!this.addModelData.rollCount||this.addModelData.rollCount==='') {
  951. this.$message.error('请输入发行张数');
  952. return;
  953. }
  954. if (!this.addModelData.rollQty||this.addModelData.rollQty==='') {
  955. this.$message.error('请输入每张数量');
  956. return;
  957. }
  958. if ( this.addModelData.nowRollQty>Number(this.addModelData.remainingIssuableQty)+((Number(this.addModelData.exceedInRatio)*Number(this.addModelData.orderQty))/100)) {
  959. this.$message.error('本次发行数量大于剩余可发行数量和超入数量');
  960. return;
  961. }
  962. // 这里可以添加提交逻辑
  963. submitPoOrderRollNo(this.addModelData).then(({data}) => {
  964. if (data && data.code === 0) {
  965. this.$message.success( '操作成功')
  966. this.changeData(this.currentRow);
  967. let row=this.currentRow;
  968. getInboundQcResultOtherData(row).then(({data}) => {
  969. //区分请求成功和失败的状况
  970. if (data && data.code=== 0) {
  971. let outData = data.row
  972. console.log(data.row);
  973. this.addModelData.remainingIssuableQty= outData.remainingIssuableQty
  974. }
  975. });
  976. }else {
  977. this.$message.error(data.msg);
  978. }
  979. })
  980. },
  981. getNowRollQty(){
  982. if(this.addModelData.tailRollQty==''||this.addModelData.tailRollQty==null||this.addModelData.tailRollQty<0){
  983. this.addModelData.tailRollQty=0
  984. }
  985. if(this.addModelData.tailRollQty==0){
  986. this.addModelData.nowRollQty=Number(this.addModelData.rollQty)*Number(this.addModelData.rollCount)
  987. }else {
  988. this.addModelData.nowRollQty=Number(this.addModelData.rollQty)*(Number(this.addModelData.rollCount)-1)+Number(this.addModelData.tailRollQty)
  989. }
  990. },
  991. handleInput(value) {
  992. // 1. 只保留数字
  993. value = value.replace(/\D/g, '')
  994. // 2. 去除前导零(0, 00, 0123 → 123)
  995. value = value.replace(/^0+/, '')
  996. // 3. 更新数据(触发 Vue 响应式)
  997. this.addModelData.rollCount = value
  998. },
  999. printLabels(){
  1000. if(this.selectionDataList.length===0){
  1001. this.$message.error('未选择标签!');
  1002. return false;
  1003. }
  1004. getPoPartLabelData(this.selectionDataList).then(({data}) => {
  1005. if (data && data.code === 0) {
  1006. console.log(data.rows)
  1007. poPartLabelPrint(data.rows)
  1008. this.getDetailTableList();
  1009. }else {
  1010. this.$message.error(data.msg);
  1011. }
  1012. })
  1013. },
  1014. deleteLabels(){
  1015. if(this.selectionDataList.length===0){
  1016. this.$message.error('未选择标签!');
  1017. return false;
  1018. }
  1019. for (let i = 0; i <this.selectionDataList.length ; i++) {
  1020. if(this.selectionDataList[i].hardtagInFlag!=='未入库'){
  1021. this.$message.error('存在不是未入库状态的标签无法删除!');
  1022. return false;
  1023. }
  1024. }
  1025. deletePoPartLabelData(this.selectionDataList).then(({data}) => {
  1026. if (data && data.code === 0) {
  1027. this.getDetailTableList();
  1028. this.$message.success('删除成功!');
  1029. }else {
  1030. this.$message.error(data.msg);
  1031. }
  1032. })
  1033. },
  1034. openUpload(){
  1035. if(!this.currentRow || !this.currentRow.site){
  1036. this.$message.error('请先选择上方的检验合格单!');
  1037. return false;
  1038. }
  1039. let pageData = {
  1040. flag: 'poPartPrint',
  1041. createBy: this.$store.state.user.name,
  1042. site: this.currentRow.site,
  1043. buNo: this.currentRow.buNo,
  1044. orderNo: this.currentRow.orderNo,
  1045. partNo: this.currentRow.partNo,
  1046. partDesc: this.currentRow.partDesc,
  1047. poOrderNo: this.currentRow.poOrderNo,
  1048. poItemNo: this.currentRow.poItemNo,
  1049. supplierId: this.currentRow.supplierId,
  1050. supplierName: this.currentRow.supplierName,
  1051. orderQty: this.currentRow.orderQty,
  1052. inspectionNo: this.currentRow.orderNo
  1053. }
  1054. this.$refs.qcUpload.init(pageData);
  1055. },
  1056. },
  1057. created() {
  1058. //查询报表的类型
  1059. this.getMainData();
  1060. },
  1061. }
  1062. </script>
  1063. <!--当前页面的标签样式-->
  1064. <style scoped lang="scss">
  1065. /deep/ .customer-tab .el-tabs__content {
  1066. padding: 5px !important;
  1067. }
  1068. /deep/ .el-form-item__label {
  1069. font-weight: 500;
  1070. }
  1071. /deep/ .el-form-item.is-required .el-form-item__label:before {
  1072. content: '*';
  1073. color: #f56c6c;
  1074. margin-right: 4px;
  1075. }
  1076. /deep/ .dialog-footer {
  1077. padding: 20px 0 0 0;
  1078. text-align: center;
  1079. }
  1080. /deep/ .el-dialog__body {
  1081. padding: 20px;
  1082. }
  1083. /deep/ .el-input.is-disabled .el-input__inner {
  1084. background-color: #f5f7fa;
  1085. border-color: #e4e7ed;
  1086. color: #c0c4cc;
  1087. }
  1088. </style>