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.

1174 lines
40 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years 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-form-item :label="'工厂编号:'">
  5. <el-input v-model="dataForm.site" readonly style="width: 120px;" ></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'采购订单号:'">
  8. <el-input v-model="dataForm.orderNo" style="width: 120px;" ></el-input>
  9. </el-form-item>
  10. <el-form-item >
  11. <span slot="label" style="" @click="getBaseList(3,0)"><a herf="#">供应商编码</a></span>
  12. <el-input v-model="dataForm.supplierID" @change="getSupplier()" style="width: 120px;" onblur="this.value=this.value.toUpperCase()"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'供应商名称:'">
  15. <el-input v-model="dataForm.supplierName" readonly style="width: 255px;"></el-input>
  16. <el-button @click="saveCRoll()" type="primary" style="width: 108px;margin-left: 20px;">创建分卷</el-button>
  17. </el-form-item>
  18. </el-form>
  19. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  20. <el-form-item >
  21. <span slot="label" style="" @click="getBaseList(5,2)"><a herf="#">物料编码</a></span>
  22. <el-input v-model="dataForm.partNo" @change="getPartNo2()" style="width: 120px;" ></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'物料名称:'">
  25. <el-input v-model="dataForm.partDescription" readonly style="width: 195px;"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'规格型号:'">
  28. <el-input v-model="dataForm.spec" readonly style="width: 180px;"></el-input>
  29. </el-form-item>
  30. <!-- <el-form-item style="margin-top: 30px">-->
  31. <!-- <el-button @click="modelFlag=false" type="primary" style="width: 80px;margin-left: 95px;">关闭</el-button>-->
  32. <!-- </el-form-item>-->
  33. <el-form-item :label="'接收日期:'">
  34. <el-date-picker
  35. style="width: 120px"
  36. v-model="dataForm.receive"
  37. value-format="yyyy-MM-dd"
  38. placeholder="选择日期">
  39. </el-date-picker>
  40. <el-button @click="getSaveModel()" type="primary" style="margin-left: 20px;">供应商批号录入</el-button>
  41. </el-form-item>
  42. </el-form>
  43. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  44. <el-form-item :label="'供应商批次号:'" style="">
  45. <el-input v-model="dataForm.suppRollNo" style="width: 120px;"></el-input>
  46. </el-form-item>
  47. <el-form-item :label="'送货单号:'" style="">
  48. <el-input v-model="dataForm.suppDeliveryNote" style="width: 120px;"></el-input>
  49. </el-form-item>
  50. <el-form-item :label="'每卷数量:'">
  51. <el-input v-model="dataForm.rollQty" type="number" style="width: 120px;"></el-input>
  52. </el-form-item>
  53. <el-form-item :label="'卷数:'">
  54. <el-input v-model="dataForm.rollNumber" type="number" style="width: 120px;"></el-input>
  55. </el-form-item>
  56. <el-form-item :label="' '">
  57. <el-button @click="insertData()" type="primary">插入</el-button>
  58. <el-checkbox style="margin-left: 60px" v-model="dataForm.checked">自动打印标签</el-checkbox>
  59. </el-form-item>
  60. </el-form>
  61. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  62. <el-form-item >
  63. <span slot="label" style="" @click="getBaseList(92,0)"><a herf="#">客户编号</a></span>
  64. <el-input v-model="dataForm.customerID" style="width: 120px;" @change="getReferenceData()"></el-input>
  65. </el-form-item>
  66. <el-form-item >
  67. <span slot="label" style="" @click="getBaseList(5,1)"><a herf="#">产品编码</a></span>
  68. <el-input v-model="dataForm.fGPartNo" style="width: 120px;" @change="getReferenceData()"></el-input>
  69. </el-form-item>
  70. <el-form-item :label="'参照名称:'">
  71. <el-input v-model="dataForm.referencePartDesc" readonly style="width: 200px;"></el-input>
  72. </el-form-item>
  73. <el-form-item :label="'供应商编码:'">
  74. <el-input v-model="dataForm.referenceSupplierID" readonly style="width: 100px;" ></el-input>
  75. </el-form-item>
  76. <el-form-item :label="'供应商名称:'">
  77. <el-input v-model="dataForm.referenceSupplierName" readonly style="width: 200px;"></el-input>
  78. </el-form-item>
  79. </el-form>
  80. <el-tabs v-model="activeName" style="font-size: 12px" class="customer-tab" type="border-card">
  81. <el-tab-pane label="待分卷" name="first">
  82. <div style="width: 1000px;margin-top: 0px;">
  83. <div style="width: 100%;float: left">
  84. <el-table
  85. :height="height"
  86. :data="dataList1"
  87. border
  88. :vertical-align="'middle'"
  89. style="width: 100%;">
  90. <el-table-column
  91. v-for="(item,index) in columnList1" :key="index"
  92. :sortable="item.columnSortable"
  93. :prop="item.columnProp"
  94. :header-align="item.headerAlign"
  95. :show-overflow-tooltip="item.showOverflowTooltip"
  96. :align="item.align"
  97. :fixed="item.fixed==''?false:item.fixed"
  98. :width="item.columnWidth"
  99. :label="item.columnLabel">
  100. <template slot-scope="scope">
  101. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  102. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  103. style="width: 100px; height: 80px"/></span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column
  107. fixed="right"
  108. header-align="center"
  109. align="center"
  110. width="150"
  111. :label="'操作'">
  112. <template slot-scope="scope">
  113. <a type="text" size="small" @click="remove(scope.row)" herf="#">删除卷</a>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. </div>
  118. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  119. <span style="margin-left: 5px;">合计卷数</span>
  120. <el-input v-model="sum1" style="width: 50px;" readonly></el-input>
  121. <span>总数量</span>
  122. <el-input v-model="sum2" style="width: 80px;" readonly></el-input>
  123. </el-form>
  124. </div>
  125. </el-tab-pane>
  126. <el-tab-pane label="已分卷" name="second">
  127. <div style="width: 1000px;margin-top: 0px">
  128. <el-table
  129. :height="height"
  130. :data="dataList3"
  131. border
  132. :vertical-align="'middle'"
  133. style="width: 100%;">
  134. <el-table-column
  135. v-for="(item,index) in columnList3" :key="index"
  136. :prop="item.columnProp"
  137. :header-align="item.headerAlign"
  138. :align="item.align"
  139. :vertical-align="'middle'"
  140. :min-width="item.columnWidth"
  141. :label="item.columnLabel">
  142. </el-table-column>
  143. </el-table>
  144. <el-form :inline="true" label-position="top" label-width="100px">
  145. <span style="margin-left: 5px">合计卷数</span>
  146. <el-input v-model="sum3" style="width: 50px;" readonly></el-input>
  147. <span>总卷数量</span>
  148. <el-input v-model="sum4" style="width: 80px;" readonly></el-input>
  149. </el-form>
  150. </div>
  151. </el-tab-pane>
  152. </el-tabs>
  153. <el-footer style="height:10px;margin-top: 0px;text-align:center">
  154. </el-footer>
  155. <el-dialog width="430px" :title="'供应商批号录入'" :close-on-click-modal="false" v-drag :visible.sync="modelFlag2">
  156. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  157. <el-form-item :label="'工厂编码:'">
  158. <el-input v-model="saveData.site" style="width: 80px"></el-input>
  159. </el-form-item>
  160. <el-form-item :label="'卷号:'">
  161. <el-input v-model="saveData.rollNo" style="width: 150px"></el-input>
  162. <el-button @click="goSaveSuppRollNo()" type="primary" style="margin-left: 10px;">保存</el-button>
  163. <el-button @click="modelFlag2=false" type="primary" style="margin-left: 10px;">关闭</el-button>
  164. </el-form-item>
  165. </el-form>
  166. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  167. <el-form-item :label="'供应商批号:'">
  168. <el-input v-model="saveData.suppRollNo" style="width: 369px"></el-input>
  169. </el-form-item>
  170. </el-form>
  171. <el-footer style="height:10px;margin-top: 20px;text-align:center">
  172. </el-footer>
  173. </el-dialog>
  174. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  175. </div>
  176. </template>
  177. <script>
  178. import {
  179. getPartNoDetail,
  180. checkCustomerID,
  181. getSupplierDetail,
  182. } from "@/api/base/site.js"
  183. /*打印标签专用的js*/
  184. import {
  185. printMaterialLabel,
  186. } from "@/views/modules/yieldReport/print_roll_label.js"
  187. import {
  188. searchSAPPurchaseOrder,
  189. searchCRollInfoDetail,
  190. saveCRollData,
  191. saveSuppRollNo,
  192. doSaveSuppRollNo,
  193. getReferenceData
  194. } from "@/api/purchasingManagement/materialSplit.js"
  195. import Chooselist from '@/views/modules/common/Chooselist'
  196. export default {
  197. name: "BeginMaterialSlittedSet",
  198. components: {
  199. Chooselist
  200. },
  201. data() {
  202. return {
  203. height: 200,
  204. modelFlag: false,
  205. modelFlag2: false,
  206. modelInputFlag: true,
  207. selectList: [],
  208. activeName: 'first',
  209. buttons: {
  210. search: '查询',
  211. },
  212. saveData: {
  213. site:'',
  214. rollNo:'',
  215. suppRollNo:''
  216. },
  217. dataForm: {
  218. site: this.$store.state.user.site,
  219. orderNo: '',
  220. orderItemNo: '',
  221. supplierID: '',
  222. supplierName: '',
  223. partNo: '',
  224. partDescription: '',
  225. spec: '',
  226. receive: new Date(),
  227. suppDeliveryNote: '*',
  228. rollQty: '',
  229. rollNumber: '',
  230. customerID: '全部',
  231. fGPartNo: '全部',
  232. referencePartDesc: '',
  233. checked: false,
  234. referenceSupplierID:'',
  235. referenceSupplierName:'',
  236. suppRollNo: ''
  237. },
  238. sum1: 0,
  239. sum2: 0,
  240. sum3: 0,
  241. sum4: 0,
  242. dataList: [],
  243. dataList3: [],
  244. dataList1: [],
  245. dataListLoading: false,
  246. columnList: [
  247. {
  248. userId: this.$store.state.user.name,
  249. functionId: 6034,
  250. serialNumber: '6034TableOrderNo',
  251. tableId: "6034Table",
  252. tableName: "查询SAP采购订单表",
  253. columnProp: "orderNo",
  254. headerAlign: "center",
  255. align: "left",
  256. columnLabel: "采购订单号",
  257. columnHidden: false,
  258. columnImage: false,
  259. columnSortable: false,
  260. sortLv: 0,
  261. status: true,
  262. fixed: false,
  263. columnWidth: 120
  264. },
  265. {
  266. userId: this.$store.state.user.name,
  267. functionId: 6034,
  268. serialNumber: '6034TableOrderDate',
  269. tableId: "6034Table",
  270. tableName: "查询SAP采购订单表",
  271. columnProp: "orderDate",
  272. headerAlign: "center",
  273. align: "left",
  274. columnLabel: "订单日期",
  275. columnHidden: false,
  276. columnImage: false,
  277. columnSortable: false,
  278. sortLv: 0,
  279. status: true,
  280. fixed: false,
  281. columnWidth: 120
  282. },
  283. {
  284. userId: this.$store.state.user.name,
  285. functionId: 6034,
  286. serialNumber: '6034TablePlanReceiptDate',
  287. tableId: "6034Table",
  288. tableName: "查询SAP采购订单表",
  289. columnProp: "planReceiptDate",
  290. headerAlign: "center",
  291. align: "left",
  292. columnLabel: "要求交货日期",
  293. columnHidden: false,
  294. columnImage: false,
  295. columnSortable: false,
  296. sortLv: 0,
  297. status: true,
  298. fixed: false,
  299. columnWidth: 120
  300. },
  301. {
  302. userId: this.$store.state.user.name,
  303. functionId: 6034,
  304. serialNumber: '6034TableSupplierID',
  305. tableId: "6034Table",
  306. tableName: "查询SAP采购订单表",
  307. columnProp: "supplierID",
  308. headerAlign: "center",
  309. align: "left",
  310. columnLabel: "供应商编码",
  311. columnHidden: false,
  312. columnImage: false,
  313. columnSortable: false,
  314. sortLv: 0,
  315. status: true,
  316. fixed: false,
  317. columnWidth: 120
  318. },
  319. {
  320. userId: this.$store.state.user.name,
  321. functionId: 6034,
  322. serialNumber: '6034TableStatus',
  323. tableId: "6034Table",
  324. tableName: "查询SAP采购订单表",
  325. columnProp: "status",
  326. headerAlign: "center",
  327. align: "left",
  328. columnLabel: "订单状态",
  329. columnHidden: false,
  330. columnImage: false,
  331. columnSortable: false,
  332. sortLv: 0,
  333. status: true,
  334. fixed: false,
  335. columnWidth: 70
  336. },
  337. {
  338. userId: this.$store.state.user.name,
  339. functionId: 6034,
  340. serialNumber: '6034TableSupplierName',
  341. tableId: "6034Table",
  342. tableName: "查询SAP采购订单表",
  343. columnProp: "supplierName",
  344. headerAlign: "center",
  345. align: "left",
  346. columnLabel: "供应商名称",
  347. columnHidden: false,
  348. columnImage: false,
  349. columnSortable: false,
  350. sortLv: 0,
  351. status: true,
  352. fixed: false,
  353. columnWidth: 300
  354. },
  355. {
  356. userId: this.$store.state.user.name,
  357. functionId: 6034,
  358. serialNumber: '6034TableOrderItemNo',
  359. tableId: "6034Table",
  360. tableName: "查询SAP采购订单表",
  361. columnProp: "orderItemNo",
  362. headerAlign: "center",
  363. align: "left",
  364. columnLabel: "订单序号",
  365. columnHidden: false,
  366. columnImage: false,
  367. columnSortable: false,
  368. sortLv: 0,
  369. status: true,
  370. fixed: false,
  371. columnWidth: 70
  372. },
  373. {
  374. userId: this.$store.state.user.name,
  375. functionId: 6034,
  376. serialNumber: '6034TablePartNo',
  377. tableId: "6034Table",
  378. tableName: "查询SAP采购订单表",
  379. columnProp: "partNo",
  380. headerAlign: "center",
  381. align: "left",
  382. columnLabel: "物料编码",
  383. columnHidden: false,
  384. columnImage: false,
  385. columnSortable: false,
  386. sortLv: 0,
  387. status: true,
  388. fixed: false,
  389. columnWidth: 160
  390. },
  391. {
  392. userId: this.$store.state.user.name,
  393. functionId: 6034,
  394. serialNumber: '6034TablePartDescription',
  395. tableId: "6034Table",
  396. tableName: "查询SAP采购订单表",
  397. columnProp: "partDescription",
  398. headerAlign: "center",
  399. align: "left",
  400. columnLabel: "物料名称",
  401. columnHidden: false,
  402. columnImage: false,
  403. columnSortable: false,
  404. sortLv: 0,
  405. status: true,
  406. fixed: false,
  407. columnWidth: 300
  408. },
  409. {
  410. userId: this.$store.state.user.name,
  411. functionId: 6034,
  412. serialNumber: '6034TableQuantity',
  413. tableId: "6034Table",
  414. tableName: "查询SAP采购订单表",
  415. columnProp: "quantity",
  416. headerAlign: "center",
  417. align: "right",
  418. columnLabel: "订单数量",
  419. columnHidden: false,
  420. columnImage: false,
  421. columnSortable: false,
  422. sortLv: 0,
  423. status: true,
  424. fixed: false,
  425. columnWidth: 120
  426. },
  427. {
  428. userId: this.$store.state.user.name,
  429. functionId: 6034,
  430. serialNumber: '6034TableCancelledFlag',
  431. tableId: "6034Table",
  432. tableName: "查询SAP采购订单表",
  433. columnProp: "cancelledFlag",
  434. headerAlign: "center",
  435. align: "left",
  436. columnLabel: "是否取消",
  437. columnHidden: false,
  438. columnImage: false,
  439. columnSortable: false,
  440. sortLv: 0,
  441. status: true,
  442. fixed: false,
  443. columnWidth: 70
  444. },
  445. {
  446. userId: this.$store.state.user.name,
  447. functionId: 6034,
  448. serialNumber: '6034TableSAPOrderNo',
  449. tableId: "6034Table",
  450. tableName: "查询SAP采购订单表",
  451. columnProp: "sAPOrderNo",
  452. headerAlign: "center",
  453. align: "left",
  454. columnLabel: "SAP订单标识号",
  455. columnHidden: false,
  456. columnImage: false,
  457. columnSortable: false,
  458. sortLv: 0,
  459. status: true,
  460. fixed: false,
  461. columnWidth: 120
  462. },
  463. {
  464. userId: this.$store.state.user.name,
  465. functionId: 6034,
  466. serialNumber: '6034TableSite',
  467. tableId: "6034Table",
  468. tableName: "查询SAP采购订单表",
  469. columnProp: "site",
  470. headerAlign: "center",
  471. align: "left",
  472. columnLabel: "工厂编号",
  473. columnHidden: false,
  474. columnImage: false,
  475. columnSortable: false,
  476. sortLv: 0,
  477. status: true,
  478. fixed: false,
  479. columnWidth: 70
  480. }
  481. ],
  482. columnList1: [
  483. {
  484. userId: this.$store.state.user.name,
  485. functionId: 6034,
  486. serialNumber: '6034Table1Number',
  487. tableId: "6034Table1",
  488. tableName: "查询SAP采购订单待分卷左表",
  489. columnProp: "number",
  490. headerAlign: "center",
  491. align: "right",
  492. columnLabel: "次序号",
  493. columnHidden: false,
  494. columnImage: false,
  495. columnSortable: false,
  496. sortLv: 0,
  497. status: true,
  498. fixed: false,
  499. columnWidth: 100
  500. },
  501. {
  502. userId: this.$store.state.user.name,
  503. functionId: 6034,
  504. serialNumber: '6034Table1RollQty',
  505. tableId: "6034Table1",
  506. tableName: "查询SAP采购订单待分卷左表",
  507. columnProp: "rollQty",
  508. headerAlign: "center",
  509. align: "right",
  510. columnLabel: "每卷数量",
  511. columnHidden: false,
  512. columnImage: false,
  513. columnSortable: false,
  514. sortLv: 0,
  515. status: true,
  516. fixed: false,
  517. columnWidth: 250
  518. },
  519. {
  520. userId: this.$store.state.user.name,
  521. functionId: 6034,
  522. serialNumber: '6034Table1RollNumber',
  523. tableId: "6034Table1",
  524. tableName: "查询SAP采购订单待分卷左表",
  525. columnProp: "rollNumber",
  526. headerAlign: "center",
  527. align: "left",
  528. columnLabel: "卷数",
  529. columnHidden: false,
  530. columnImage: false,
  531. columnSortable: false,
  532. sortLv: 0,
  533. status: true,
  534. fixed: false,
  535. columnWidth: 250
  536. },
  537. {
  538. userId: this.$store.state.user.name,
  539. functionId: 6034,
  540. serialNumber: '6034Table1ALLRollQty',
  541. tableId: "6034Table1",
  542. tableName: "查询SAP采购订单待分卷左表",
  543. columnProp: "allRollQty",
  544. headerAlign: "center",
  545. align: "left",
  546. columnLabel: "总数量",
  547. columnHidden: false,
  548. columnImage: false,
  549. columnSortable: false,
  550. sortLv: 0,
  551. status: true,
  552. fixed: false,
  553. columnWidth: 249
  554. }
  555. ],
  556. columnList3: [
  557. {
  558. userId: this.$store.state.user.name,
  559. functionId: 6034,
  560. serialNumber: '6034Table3RollNo',
  561. tableId: "6034Table",
  562. tableName: "查询SAP采购订单已分卷表",
  563. columnProp: "rollNo",
  564. headerAlign: "center",
  565. align: "left",
  566. columnLabel: "卷号",
  567. columnHidden: false,
  568. columnImage: false,
  569. columnSortable: false,
  570. sortLv: 0,
  571. status: true,
  572. fixed: false,
  573. columnWidth: 80
  574. },
  575. {
  576. userId: this.$store.state.user.name,
  577. functionId: 6034,
  578. serialNumber: '6034Table3RollQty',
  579. tableId: "6034Table",
  580. tableName: "查询SAP采购订单已分卷表",
  581. columnProp: "rollQty",
  582. headerAlign: "center",
  583. align: "right",
  584. columnLabel: "卷数量",
  585. columnHidden: false,
  586. columnImage: false,
  587. columnSortable: false,
  588. sortLv: 0,
  589. status: true,
  590. fixed: false,
  591. columnWidth: 60
  592. },
  593. {
  594. userId: this.$store.state.user.name,
  595. functionId: 6034,
  596. serialNumber: '6034Table3SuppDeliveryNote',
  597. tableId: "6034Table",
  598. tableName: "查询SAP采购订单已分卷表",
  599. columnProp: "suppDeliveryNote",
  600. headerAlign: "center",
  601. align: "left",
  602. columnLabel: "供应商送货单号",
  603. columnHidden: false,
  604. columnImage: false,
  605. columnSortable: false,
  606. sortLv: 0,
  607. status: true,
  608. fixed: false,
  609. columnWidth: 100
  610. },
  611. {
  612. userId: this.$store.state.user.name,
  613. functionId: 6034,
  614. serialNumber: '6034Table3RollDate',
  615. tableId: "6034Table",
  616. tableName: "查询SAP采购订单已分卷表",
  617. columnProp: "rollDate",
  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: false,
  627. columnWidth: 120
  628. },
  629. {
  630. userId: this.$store.state.user.name,
  631. functionId: 6034,
  632. serialNumber: '6034Table3CreatedDate',
  633. tableId: "6034Table",
  634. tableName: "查询SAP采购订单已分卷表",
  635. columnProp: "createdDate",
  636. headerAlign: "center",
  637. align: "left",
  638. columnLabel: "分卷日期",
  639. columnHidden: false,
  640. columnImage: false,
  641. columnSortable: false,
  642. sortLv: 0,
  643. status: true,
  644. fixed: false,
  645. columnWidth: 120
  646. },
  647. {
  648. userId: this.$store.state.user.name,
  649. functionId: 6034,
  650. serialNumber: '6034Table3CreatedBy',
  651. tableId: "6034Table",
  652. tableName: "查询SAP采购订单已分卷表",
  653. columnProp: "createdBy",
  654. headerAlign: "center",
  655. align: "left",
  656. columnLabel: "分卷人",
  657. columnHidden: false,
  658. columnImage: false,
  659. columnSortable: false,
  660. sortLv: 0,
  661. status: true,
  662. fixed: false,
  663. columnWidth: 60
  664. },
  665. {
  666. userId: this.$store.state.user.name,
  667. functionId: 6034,
  668. serialNumber: '6034Table3SuppRollNoFlag',
  669. tableId: "6034Table",
  670. tableName: "查询SAP采购订单已分卷表",
  671. columnProp: "suppRollNoFlag",
  672. headerAlign: "center",
  673. align: "left",
  674. columnLabel: "已录入供应商批号",
  675. columnHidden: false,
  676. columnImage: false,
  677. columnSortable: false,
  678. sortLv: 0,
  679. status: true,
  680. fixed: false,
  681. columnWidth: 120
  682. },
  683. {
  684. userId: this.$store.state.user.name,
  685. functionId: 6034,
  686. serialNumber: '6034Table3SuppRollNo',
  687. tableId: "6034Table",
  688. tableName: "查询SAP采购订单已分卷表",
  689. columnProp: "suppRollNo",
  690. headerAlign: "center",
  691. align: "left",
  692. columnLabel: "供应商批号",
  693. columnHidden: false,
  694. columnImage: false,
  695. columnSortable: false,
  696. sortLv: 0,
  697. status: true,
  698. fixed: false,
  699. columnWidth: 300
  700. }
  701. ],
  702. tagNo:'',
  703. tagNo2:'',
  704. }
  705. },
  706. watch: {
  707. dataForm: {
  708. deep: true,
  709. handler: function (newV, oldV) {
  710. this.dataForm.orderNo = this.dataForm.orderNo.toUpperCase()
  711. this.dataForm.supplierID = this.dataForm.supplierID.toUpperCase()
  712. this.dataForm.fGPartNo = this.dataForm.fGPartNo.toUpperCase()
  713. this.dataForm.customerID = this.dataForm.customerID.toUpperCase()
  714. this.dataForm.partNo = this.dataForm.partNo.toUpperCase()
  715. }
  716. }
  717. },
  718. mounted() {
  719. this.$nextTick(() => {
  720. this.height = window.innerHeight - 330;
  721. })
  722. },
  723. methods: {
  724. getBaseData(val){
  725. if (this.tagNo === 92){
  726. this.dataForm.customerID = val.ConfigurationTemplateID
  727. this.getReferenceData()
  728. }
  729. if (this.tagNo === 5){
  730. if(this.tagNo2===1){
  731. this.dataForm.fGPartNo = val.PartNo
  732. this.getReferenceData();
  733. // this.getFGPartNo();
  734. }else {
  735. this.dataForm.partNo = val.PartNo
  736. this.getPartNo2()
  737. }
  738. }
  739. if (this.tagNo === 3){
  740. this.dataForm.supplierID = val.SupplierID
  741. this.dataForm.supplierName=val.SupplierName
  742. }
  743. },
  744. // 获取基础数据列表
  745. getBaseList(val1,val2){
  746. this.tagNo = val1
  747. this.$nextTick(() => {
  748. let strVal = "";
  749. if (val1 === 92){
  750. strVal = this.dataForm.customerID
  751. }
  752. if (val1 === 5){
  753. if(val2 === 1){
  754. strVal = this.dataForm.fGPartNo
  755. this.tagNo2=1;
  756. }else {
  757. strVal = this.dataForm.partNo
  758. this.tagNo2=2;
  759. }
  760. }
  761. if (val1 === 3){
  762. strVal = this.dataForm.supplierID
  763. }
  764. this.$refs.baseList.init(val1,strVal)
  765. })
  766. },
  767. insertData() {
  768. if (this.dataForm.orderNo == '' || this.dataForm.orderNo == null) {
  769. this.$alert("请输入采购订单号!", '错误', {
  770. confirmButtonText: '确定'
  771. })
  772. return false;
  773. }
  774. if (this.dataForm.supplierID == '' || this.dataForm.supplierID == null) {
  775. this.$alert("请输入供应商编码!", '错误', {
  776. confirmButtonText: '确定'
  777. })
  778. return false;
  779. }
  780. if (this.dataForm.partNo == '' || this.dataForm.partNo == null) {
  781. this.$alert("请输入材料编码!", '错误', {
  782. confirmButtonText: '确定'
  783. })
  784. return false;
  785. }
  786. if (this.dataForm.suppDeliveryNote == '' || this.dataForm.suppDeliveryNote == null) {
  787. this.$alert("请输入送货单号!", '错误', {
  788. confirmButtonText: '确定'
  789. })
  790. return false;
  791. }
  792. if (this.dataForm.rollQty == '' || this.dataForm.rollQty == null || this.dataForm.rollQty <= 0) {
  793. this.$alert("请输入正确的每卷数量!", '错误', {
  794. confirmButtonText: '确定'
  795. })
  796. return false;
  797. }
  798. if (this.dataForm.rollNumber == '' || this.dataForm.rollQty == null || this.dataForm.rollNumber <= 0) {
  799. this.$alert("请输入正确的卷数!", '错误', {
  800. confirmButtonText: '确定'
  801. })
  802. return false;
  803. }
  804. let newDate = {
  805. number: this.dataList1.length + 1,
  806. allRollQty: this.dataForm.rollQty * this.dataForm.rollNumber,
  807. site: this.dataForm.site,
  808. rollQty: this.dataForm.rollQty,
  809. rollNumber: this.dataForm.rollNumber,
  810. partNo: this.dataForm.partNo,
  811. supplierID: this.dataForm.supplierID,
  812. orderRef1: this.dataForm.orderNo,
  813. orderRef2: this.dataForm.orderNo,
  814. orderRef3: 0,
  815. orderRef4: 'B',
  816. suppDeliveryNote: this.dataForm.suppDeliveryNote,
  817. rollDate: this.dataForm.receive,
  818. createdBy: this.$store.state.user.name,
  819. statusDb: 'I',
  820. status: '已入库',
  821. suppRollNoFlag: 'N',
  822. sourceType: '期初入库',
  823. rolltype: '合格卷',
  824. rolltypeDb: 0,
  825. parttypeFlag: 'R',
  826. customerID: this.dataForm.customerID,
  827. fGPartNo: this.dataForm.fGPartNo,
  828. refPartDesc:this.dataForm.referencePartDesc,
  829. refSupplierID:this.dataForm.referenceSupplierID,
  830. }
  831. this.dataList1.push(newDate)
  832. this.sum1 = Number(this.sum1)+ Number(newDate.rollNumber);
  833. this.sum2 = Number(this.sum2)+ Number(newDate.allRollQty);
  834. },
  835. remove(row){
  836. this.$confirm('确认删除记录吗?', '提示', {
  837. confirmButtonText: '确定',
  838. cancelButtonText: '取消',
  839. type: 'warning'
  840. }).then(() => {
  841. this.sum1 = Number(this.sum1) - Number(row.rollNumber);
  842. this.sum2 = Number(this.sum2) - Number(row.allRollQty);
  843. this.dataList1 = this.dataList1.filter(item => item.number!=row.number)
  844. })
  845. },
  846. saveCRoll() {
  847. if(this.dataForm.checked==true){
  848. this.$alert('打印机连接失败!', '错误', {
  849. confirmButtonText: '确定'
  850. })
  851. return false;
  852. }
  853. let inData = {
  854. site: this.dataForm.site,
  855. partNo: this.dataForm.partNo
  856. }
  857. getPartNoDetail(inData).then(({data}) => {
  858. if (data.total > 0) {
  859. this.dataForm.partDescription=data.rows[0].partDescription;
  860. //this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  861. let inData2={
  862. site : this.dataForm.site,
  863. supplierID : this.dataForm.supplierID
  864. }
  865. getSupplierDetail(inData2).then(({data}) => {
  866. let outList = data.rows
  867. if (outList.length>0){
  868. this.dataForm.supplierName=outList[0].supplierName;
  869. // this.$set(this.dataForm,'supplierName',outList[0].supplierName)
  870. let inData3 = {
  871. site: this.dataForm.site,
  872. partNo: this.dataForm.fGPartNo
  873. }
  874. getPartNoDetail(inData3).then(({data}) => {
  875. if (data.total > 0||this.dataForm.fGPartNo=='无') {
  876. let inData4 = {
  877. site: this.dataForm.site,
  878. configurationTemplateID: this.dataForm.customerID,
  879. }
  880. checkCustomerID(inData4).then(({data}) => {
  881. if (data.total > 0) {
  882. if (this.dataList1.length == 0&&this.dataForm.customerID!='无') {
  883. this.$alert("没有待分卷信息!", '错误', {
  884. confirmButtonText: '确定'
  885. })
  886. return false;
  887. }else {
  888. this.doSaveCRoll()
  889. }
  890. } else {
  891. this.dataForm.customerID = '';
  892. this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  893. this.$alert('该客户编号不存在或不可用', '错误', {
  894. confirmButtonText: '确定'
  895. })
  896. return false;
  897. }
  898. })
  899. } else {
  900. this.dataForm.fGPartNo = '';
  901. this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  902. this.$alert('该物料编码不存在或不可用', '错误', {
  903. confirmButtonText: '确定'
  904. })
  905. return false;
  906. }
  907. })
  908. }
  909. else {
  910. this.dataForm.supplierName='';
  911. this.dataForm.supplierID='';
  912. this.$alert('该供应商不存在或不可用', '错误', {
  913. confirmButtonText: '确定'
  914. })
  915. return false;
  916. }
  917. })
  918. }
  919. else {
  920. this.dataForm.partNo = '';
  921. this.$alert('该物料编码不存在或不可用', '错误', {
  922. confirmButtonText: '确定'
  923. })
  924. return false;
  925. }
  926. })
  927. },
  928. doSaveCRoll() {
  929. let dto = this.dataList1.map(item => {
  930. item.suppRollNo = this.dataForm.suppRollNo
  931. item.suppRollNoFlag = 'Y'
  932. return item;
  933. })
  934. saveCRollData(dto).then(({data}) => {
  935. if (data && data.code == 200) {
  936. this.dataList1 = [];
  937. this.sum1 = 0;
  938. this.sum2 = 0;
  939. let inData = {
  940. site: this.dataForm.site,
  941. orderRef1: this.dataForm.orderNo,
  942. orderRef3: 0,
  943. }
  944. searchCRollInfoDetail(inData).then(({data}) => {
  945. this.dataList3 = data.rows
  946. for (let i = 0; i < data.total; i++) {
  947. this.sum4 += Number(this.dataList3[i].rollQty);
  948. }
  949. this.sum3 = data.total;
  950. })
  951. this.$message.success('操作成功')
  952. //打印材料卷标签
  953. let printList = data.obj;
  954. printMaterialLabel(printList);
  955. //调用打印的方法
  956. /*for(let i = 0; i < printList.length; i++){
  957. printMaterialLabel(printList[i]);
  958. }*/
  959. } else {
  960. this.$alert(data.msg, '错误', {
  961. confirmButtonText: '确定'
  962. })
  963. }
  964. this.dataForm={}
  965. this.dataForm.site=this.$store.state.user.site
  966. this.dataForm.receive=new Date();
  967. this.dataForm.fGPartNo='无';
  968. this.dataForm.customerID='无';
  969. this.dataForm.suppDeliveryNote='*';
  970. this.dataForm=JSON.parse(JSON.stringify(this.dataForm))
  971. })
  972. },
  973. getPartNo() {
  974. let inData = {
  975. site: this.dataForm.site,
  976. partNo: this.dataForm.fGPartNo
  977. }
  978. getPartNoDetail(inData).then(({data}) => {
  979. if (data.total > 0) {
  980. } else {
  981. this.dataForm.fGPartNo = '';
  982. this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  983. this.$alert('该物料编码不存在或不可用', '错误', {
  984. confirmButtonText: '确定'
  985. })
  986. return false;
  987. }
  988. })
  989. },
  990. getPartNo2() {
  991. let inData = {
  992. site: this.dataForm.site,
  993. partNo: this.dataForm.partNo
  994. }
  995. getPartNoDetail(inData).then(({data}) => {
  996. if (data.total > 0) {
  997. this.dataForm.partDescription=data.rows[0].partDescription;
  998. this.dataForm.spec=data.rows[0].spec;
  999. //this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  1000. }
  1001. // else {
  1002. // this.dataForm.partNo = '';
  1003. // this.$alert('该物料编码不存在', '错误', {
  1004. // confirmButtonText: '确定'
  1005. // })
  1006. // }
  1007. })
  1008. this.getReferenceData();
  1009. },
  1010. getCustomerID() {
  1011. let inData = {
  1012. site: this.dataForm.site,
  1013. configurationTemplateID: this.dataForm.customerID,
  1014. }
  1015. checkCustomerID(inData).then(({data}) => {
  1016. if (data.total > 0) {
  1017. } else {
  1018. this.dataForm.customerID = '';
  1019. this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  1020. this.$alert('该客户编号不存在', '错误', {
  1021. confirmButtonText: '确定'
  1022. })
  1023. return false;
  1024. }
  1025. })
  1026. },
  1027. getSupplier(){
  1028. let inData={
  1029. site : this.dataForm.site,
  1030. supplierID : this.dataForm.supplierID
  1031. }
  1032. getSupplierDetail(inData).then(({data}) => {
  1033. let outList = data.rows
  1034. if (outList.length>0){
  1035. this.dataForm.supplierName=outList[0].supplierName;
  1036. // this.$set(this.dataForm,'supplierName',outList[0].supplierName)
  1037. }
  1038. // else {
  1039. // this.dataForm.supplierName='';
  1040. // this.dataForm.supplierID='';
  1041. // this.$alert('该供应商不存在', '错误', {
  1042. // confirmButtonText: '确定'
  1043. // })
  1044. // }
  1045. })
  1046. },
  1047. //供应商批号录入
  1048. getSaveModel() {
  1049. this.saveData = {
  1050. site:this.$store.state.user.site,
  1051. rollNo:'',
  1052. suppRollNo:''
  1053. };
  1054. this.modelFlag2 = true;
  1055. },
  1056. goSaveSuppRollNo() {
  1057. if (this.saveData.site == '' || this.saveData.site == null) {
  1058. this.$alert("请输入工厂编码!", '错误', {
  1059. confirmButtonText: '确定'
  1060. })
  1061. return false;
  1062. }
  1063. if (this.saveData.rollNo == '' || this.saveData.rollNo == null) {
  1064. this.$alert("请输入卷号!", '错误', {
  1065. confirmButtonText: '确定'
  1066. })
  1067. return false;
  1068. }
  1069. if (this.saveData.suppRollNo == '' || this.saveData.suppRollNo == null) {
  1070. this.$alert("请输入供应商批号!", '错误', {
  1071. confirmButtonText: '确定'
  1072. })
  1073. return false;
  1074. }
  1075. saveSuppRollNo(this.saveData).then(({data}) => {
  1076. if (data.rows == null) {
  1077. this.$alert("该卷号不存在,请输入!", '错误', {
  1078. confirmButtonText: '确定'
  1079. })
  1080. return false;
  1081. } else {
  1082. if (data.rows.suppRollNoFlag == 'Y') {
  1083. this.$confirm(`该卷已经录入供应商批号,确认要重新录入吗?`, '提示', {
  1084. confirmButtonText: '确定',
  1085. cancelButtonText: '取消',
  1086. type: 'warning'
  1087. }).then(() => {
  1088. doSaveSuppRollNo(this.saveData).then(({data}) => {
  1089. if (data && data.code == 200) {
  1090. this.modelFlag2 = false
  1091. this.$message.success( '操作成功')
  1092. } else {
  1093. this.$alert(data.msg, '错误', {
  1094. confirmButtonText: '确定'
  1095. })
  1096. }
  1097. })
  1098. })
  1099. }else{
  1100. doSaveSuppRollNo(this.saveData).then(({data}) => {
  1101. if (data && data.code == 200) {
  1102. this.modelFlag2 = false
  1103. this.$message.success( '操作成功')
  1104. } else {
  1105. this.$alert(data.msg, '错误', {
  1106. confirmButtonText: '确定'
  1107. })
  1108. }
  1109. })
  1110. }
  1111. }
  1112. }
  1113. )
  1114. },
  1115. getReferenceData(){
  1116. let inData = {
  1117. site: this.dataForm.site,
  1118. partNo: this.dataForm.partNo,
  1119. partDescription: this.dataForm.partDescription,
  1120. customerID: this.dataForm.customerID,
  1121. fGPartNo: this.dataForm.fGPartNo,
  1122. supplierID: '*',
  1123. }
  1124. getReferenceData(inData).then(({data}) => {
  1125. if (data.success) {
  1126. if (data.rows.length > 0) {
  1127. this.dataForm.referenceSupplierID = data.rows[0].SupplierID;
  1128. this.dataForm.referencePartDesc = data.rows[0].PartDescription;
  1129. this.dataForm.referenceSupplierName = data.rows[0].SupplierDesc;
  1130. }
  1131. }
  1132. })
  1133. },
  1134. },
  1135. created() {
  1136. }
  1137. }
  1138. </script>
  1139. <style scoped>
  1140. /deep/ .customer-tab .el-tabs__content {
  1141. padding: 3px !important;
  1142. }
  1143. /deep/ .el-tabs__item {
  1144. padding: 0 20px;
  1145. height: 30px;
  1146. -webkit-box-sizing: border-box;
  1147. box-sizing: border-box;
  1148. line-height: 30px;
  1149. display: inline-block;
  1150. list-style: none;
  1151. font-size: 12px;
  1152. font-weight: 500;
  1153. color: #303133;
  1154. position: relative;
  1155. }
  1156. </style>