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.

1750 lines
60 KiB

6 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-form-item :label="'工厂编码:'">
  5. <el-input v-model="searchData.site" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'生产订单号:'">
  8. <el-input v-model="searchData.orderNo" style="width: 130px"></el-input>
  9. </el-form-item>
  10. <el-form-item :label="'订单日期:'">
  11. <el-date-picker
  12. style="width: 130px"
  13. v-model="searchData.date1"
  14. value-format="yyyy-MM-dd"
  15. placeholder="选择日期">
  16. </el-date-picker>
  17. </el-form-item>
  18. <el-form-item :label="'至:'">
  19. <el-date-picker
  20. style="width: 130px"
  21. v-model="searchData.date2"
  22. value-format="yyyy-MM-dd"
  23. placeholder="选择日期">
  24. </el-date-picker>
  25. </el-form-item>
  26. <el-form-item :label="'是否分卷:'">
  27. <el-select filterable v-model="searchData.slittedFlag" style="width: 130px">
  28. <el-option label="是" value="Y"></el-option>
  29. <el-option label="否" value="N"></el-option>
  30. </el-select>
  31. <el-button @click="getData()" type="primary" style="margin-left: 10px;margin-top: 0px">{{'查询'}}</el-button>
  32. <download-excel
  33. :fields="fields()"
  34. :data="exportData"
  35. type="xls"
  36. :name="exportName"
  37. :header="exportHeader"
  38. :footer="exportFooter"
  39. :fetch="createExportData"
  40. :before-generate="startDownload"
  41. :before-finish="finishDownload"
  42. worksheet="导出信息"
  43. class="el-button el-button--primary el-button--medium">
  44. {{ buttons.download }}
  45. </download-excel>
  46. </el-form-item>
  47. </el-form>
  48. <el-table
  49. :height="height"
  50. :data="dataList"
  51. border
  52. v-loading="dataListLoading"
  53. style="width: 100%;">
  54. <el-table-column
  55. header-align="center"
  56. align="center"
  57. width="70"
  58. label="操作">
  59. <template slot-scope="scope">
  60. <a type="text" size="small" @click="showModel(scope.row)">创建卷</a>
  61. </template>
  62. </el-table-column>
  63. <el-table-column
  64. v-for="(item,index) in columnList" :key="index"
  65. :sortable="item.columnSortable"
  66. :prop="item.columnProp"
  67. :header-align="item.headerAlign"
  68. :show-overflow-tooltip="item.showOverflowTooltip"
  69. :align="item.align"
  70. :fixed="item.fixed==''?false:item.fixed"
  71. :width="item.columnWidth"
  72. :label="item.columnLabel">
  73. <template slot-scope="scope">
  74. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  75. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  76. style="width: 100px; height: 80px"/></span>
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. <el-dialog width="800px" :title="'创建分卷'" :close-on-click-modal="false" v-drag :visible.sync="modelFlag">
  81. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -10px;">
  82. <el-form-item :label="'工厂编号:'">
  83. <el-input v-model="dataForm.site" readonly style="width: 120px;"></el-input>
  84. </el-form-item>
  85. <el-form-item :label="'关联单号1:'">
  86. <el-input v-model="dataForm.orderNo" readonly style="width: 120px;"></el-input>
  87. </el-form-item>
  88. <el-form-item :label="'关联单号3:'">
  89. <el-input v-model="dataForm.orderItemNo" readonly style="width: 120px;"></el-input>
  90. </el-form-item>
  91. <el-form-item style="margin-top: 30px">
  92. <el-button @click="saveCRoll()" type="primary" style="width: 108px;margin-left: 142px;">创建</el-button>
  93. </el-form-item>
  94. </el-form>
  95. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  96. <el-form-item :label="'供应商编号:'">
  97. <el-input v-model="dataForm.supplierID" readonly style="width: 120px;"></el-input>
  98. </el-form-item>
  99. <el-form-item :label="'供应商名称:'">
  100. <el-input v-model="dataForm.supplierName" readonly style="width: 255px;"></el-input>
  101. </el-form-item>
  102. <el-form-item style="margin-top: 30px">
  103. <el-button @click="modelFlag=false" type="primary" style="width: 108px;margin-left: 142px;">关闭</el-button>
  104. </el-form-item>
  105. </el-form>
  106. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  107. <el-form-item :label="'物料编码:'">
  108. <el-input v-model="dataForm.partNo" readonly style="width: 120px;"></el-input>
  109. </el-form-item>
  110. <el-form-item :label="'物料名称:'">
  111. <el-input v-model="dataForm.partDescription" readonly style="width: 120px;"></el-input>
  112. </el-form-item>
  113. <el-form-item :label="'规格型号:'">
  114. <el-input v-model="dataForm.spec" readonly style="width: 180px;"></el-input>
  115. </el-form-item>
  116. <el-form-item style="margin-top: 30px">
  117. <el-button @click="getSaveModel()" type="primary" style="margin-left: 82px;">供应商批号录入</el-button>
  118. </el-form-item>
  119. </el-form>
  120. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  121. <el-form-item :label="'接收日期:'">
  122. <el-date-picker
  123. style="width: 120px"
  124. v-model="dataForm.receive"
  125. value-format="yyyy-MM-dd"
  126. placeholder="选择日期">
  127. </el-date-picker>
  128. </el-form-item>
  129. <el-form-item :label="'送货单号:'">
  130. <el-input v-model="dataForm.suppDeliveryNote" disabled style="width: 120px;"></el-input>
  131. </el-form-item>
  132. <el-form-item :label="'订单数量:'">
  133. <el-input v-model="dataForm.quantity" readonly style="width: 120px;"></el-input>
  134. </el-form-item>
  135. </el-form>
  136. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  137. <el-form-item :label="'每卷数量:'">
  138. <el-input v-model="dataForm.rollQty" type="number" style="width: 120px;"></el-input>
  139. </el-form-item>
  140. <el-form-item :label="'卷数:'">
  141. <el-input v-model="dataForm.rollNumber" type="number" style="width: 120px;"></el-input>
  142. </el-form-item>
  143. <el-form-item style="margin-top: 30px">
  144. <el-button @click="insertData()" type="primary">插入</el-button>
  145. <el-checkbox style="margin-left: 108px" v-model="dataForm.checked">自动打印标签</el-checkbox>
  146. </el-form-item>
  147. <el-form-item :label="'材料编码:'">
  148. <el-input v-model="dataForm.sOPartNo" style="width: 120px;"></el-input>
  149. </el-form-item>
  150. </el-form>
  151. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  152. <el-form-item >
  153. <span slot="label" style="" @click="getBaseList(92)"><a herf="#">客户编号</a></span>
  154. <el-input v-model="dataForm.customerID" style="width: 120px;" @change="getReferenceData();"></el-input>
  155. </el-form-item>
  156. <el-form-item >
  157. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span>
  158. <el-input v-model="dataForm.fGPartNo" style="width: 120px;" @change="getReferenceData();"></el-input>
  159. </el-form-item>
  160. <el-form-item :label="'参照名称:'">
  161. <el-input v-model="dataForm.referencePartDesc" readonly style="width: 220px;"></el-input>
  162. </el-form-item>
  163. </el-form>
  164. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  165. <el-form-item :label="'供应商编码:'">
  166. <el-input v-model="dataForm.supplierID" readonly style="width: 120px;"></el-input>
  167. </el-form-item>
  168. <el-form-item :label="'供应商名称:'">
  169. <el-input v-model="dataForm.supplierName" readonly style="width: 220px;"></el-input>
  170. </el-form-item>
  171. </el-form>
  172. <el-tabs v-model="activeName" style="font-size: 11px">
  173. <el-tab-pane label="待分卷" name="first">
  174. <div style="width: 775px;margin-top: 8px;">
  175. <div style="width: 40%;float: left">
  176. <el-table
  177. height="200"
  178. :data="dataList1"
  179. border
  180. :vertical-align="'middle'"
  181. style="width: 100%;">
  182. <el-table-column
  183. v-for="(item,index) in columnList1" :key="index"
  184. :sortable="item.columnSortable"
  185. :prop="item.columnProp"
  186. :header-align="item.headerAlign"
  187. :show-overflow-tooltip="item.showOverflowTooltip"
  188. :align="item.align"
  189. :fixed="item.fixed==''?false:item.fixed"
  190. :width="item.columnWidth"
  191. :label="item.columnLabel">
  192. <template slot-scope="scope">
  193. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  194. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  195. style="width: 100px; height: 80px"/></span>
  196. </template>
  197. </el-table-column>
  198. </el-table>
  199. </div>
  200. <div style="width: 58%;float: left">
  201. <el-table
  202. height="200"
  203. :data="dataList2"
  204. border
  205. @row-dblclick="changeData"
  206. :vertical-align="'middle'"
  207. style="width: 100%;">
  208. <el-table-column
  209. v-for="(item,index) in columnList2" :key="index"
  210. :sortable="item.columnSortable"
  211. :prop="item.columnProp"
  212. :header-align="item.headerAlign"
  213. :show-overflow-tooltip="item.showOverflowTooltip"
  214. :align="item.align"
  215. :fixed="item.fixed==''?false:item.fixed"
  216. :width="item.columnWidth"
  217. :label="item.columnLabel">
  218. <template slot-scope="scope">
  219. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  220. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  221. style="width: 100px; height: 80px"/></span>
  222. </template>
  223. </el-table-column>
  224. </el-table>
  225. </div>
  226. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  227. <span style="margin-left: 5px">合计卷数</span>
  228. <el-input v-model="sum1" style="width: 50px;" readonly></el-input>
  229. <span>总数量</span>
  230. <el-input v-model="sum2" style="width: 80px;" readonly></el-input>
  231. </el-form>
  232. </div>
  233. </el-tab-pane>
  234. <el-tab-pane label="已分卷" name="second">
  235. <div style="width: 760px;margin-top: 0px">
  236. <el-table
  237. height="200"
  238. :data="dataList3"
  239. border
  240. :vertical-align="'middle'"
  241. style="width: 100%;">
  242. <el-table-column
  243. v-for="(item,index) in columnList3" :key="index"
  244. :prop="item.columnProp"
  245. :header-align="item.headerAlign"
  246. :align="item.align"
  247. :vertical-align="'middle'"
  248. :min-width="item.columnWidth"
  249. :label="item.columnLabel">
  250. </el-table-column>
  251. </el-table>
  252. <el-form :inline="true" label-position="top" label-width="100px">
  253. <div style="margin-top: 8px">
  254. <span style="margin-left: 5px">合计卷数</span>
  255. <el-input v-model="sum3" style="width: 50px;" readonly></el-input>
  256. <span>总卷数量</span>
  257. <el-input v-model="sum4" style="width: 80px;" readonly></el-input>
  258. </div>
  259. </el-form>
  260. </div>
  261. </el-tab-pane>
  262. <el-tab-pane label="出库卷清单" name="third">
  263. <div style="margin-top: 0px;">
  264. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  265. <span> {{"卷号"}}:</span>
  266. <el-input v-model="dataForm2.rollNo" @change="rollNoOut()" style="width: 120px;"></el-input>
  267. <span>{{"(回车插入记录) 当前卷号:"}}:</span>
  268. <el-input v-model="dataForm2.rollNo2" disabled style="width: 120px;"></el-input>
  269. <span style="margin-left: 20px"> {{"退料数量"}}:</span>
  270. <el-input v-model="dataForm2.fTotalQty2" style="width: 100px;"></el-input>
  271. <el-button @click="checkRoll()" style="margin-left: 10px;margin-top: 0px">{{'结束卷'}}
  272. </el-button>
  273. </el-form>
  274. <el-table
  275. :height="210"
  276. :data="dataList4"
  277. border
  278. v-loading="dataListLoading"
  279. style="width: 100%;">
  280. <el-table-column
  281. v-for="(item,index) in columnList4" :key="index"
  282. :sortable="item.columnSortable"
  283. :prop="item.columnProp"
  284. :header-align="item.headerAlign"
  285. :show-overflow-tooltip="item.showOverflowTooltip"
  286. :align="item.align"
  287. :fixed="item.fixed==''?false:item.fixed"
  288. :width="item.columnWidth"
  289. :label="item.columnLabel">
  290. <template slot-scope="scope">
  291. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  292. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  293. style="width: 100px; height: 80px"/></span>
  294. </template>
  295. </el-table-column>
  296. </el-table>
  297. </div>
  298. </el-tab-pane>
  299. </el-tabs>
  300. <el-footer style="height:10px;margin-top: 0px;text-align:center">
  301. </el-footer>
  302. </el-dialog>
  303. <el-dialog width="430px" :title="'供应商批号录入'" :close-on-click-modal="false" v-drag :visible.sync="modelFlag2">
  304. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  305. <el-form-item :label="'工厂编码:'">
  306. <el-input v-model="saveData.site" style="width: 80px"></el-input>
  307. </el-form-item>
  308. <el-form-item :label="'卷号:'">
  309. <el-input v-model="saveData.rollNo" style="width: 150px"></el-input>
  310. <el-button @click="goSaveSuppRollNo()" type="primary" style="margin-left: 10px;">保存</el-button>
  311. <el-button @click="modelFlag2=false" type="primary" style="margin-left: 10px;">关闭</el-button>
  312. </el-form-item>
  313. </el-form>
  314. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  315. <el-form-item :label="'供应商批号:'">
  316. <el-input v-model="saveData.suppRollNo" style="width: 369px"></el-input>
  317. </el-form-item>
  318. </el-form>
  319. <el-footer style="height:10px;margin-top: 20px;text-align:center">
  320. </el-footer>
  321. </el-dialog>
  322. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  323. </div>
  324. </template>
  325. <script>
  326. import Chooselist from '@/views/modules/common/Chooselist'
  327. import {
  328. getPartNoDetail,
  329. checkCustomerID
  330. } from "@/api/base/site.js"
  331. import {
  332. searchSAPSlittedOrder,
  333. searchCRollInfoDetail,
  334. saveCRollData,
  335. saveSuppRollNo,
  336. doSaveSuppRollNo,
  337. getTransRoll,
  338. saveFinishRoll,
  339. checkFinishRoll,
  340. saveRollNoOut,
  341. getReferenceData,
  342. } from "@/api/purchasingManagement/materialSplit.js"
  343. export default {
  344. //查询-SAP分卷订单
  345. name: "searchSAPSlittedOrder",
  346. components: {
  347. Chooselist
  348. },
  349. watch: {
  350. dataForm: {
  351. deep: true,
  352. handler: function (newV, oldV) {
  353. this.dataForm.customerID = this.dataForm.customerID.toUpperCase()
  354. this.dataForm.fGPartNo = this.dataForm.fGPartNo.toUpperCase()
  355. }
  356. }
  357. },
  358. data() {
  359. return {
  360. tagNo:'',
  361. // 导出 start
  362. exportData: [],
  363. exportName: "SAP分卷订单"+this.dayjs().format('YYYYMMDDHHmmss'),
  364. exportHeader: ["SAP分卷订单"],
  365. exportFooter: [],
  366. // 导出 end
  367. height: 200,
  368. modelFlag: false,
  369. modelFlag2: false,
  370. modelInputFlag: true,
  371. selectList: [],
  372. activeName: 'first',
  373. buttons: {
  374. download:'导出',
  375. },
  376. searchData: {
  377. site: '',
  378. orderNo: '',
  379. date1:new Date(),
  380. date2:'',
  381. slittedFlag: 'N',
  382. user: this.$store.state.user.name
  383. },
  384. saveData: {
  385. site:'',
  386. rollNo:'',
  387. suppRollNo:'',
  388. },
  389. dataForm2: {
  390. rollNo: '',
  391. rollNo2: '',
  392. fTotalQty2: '',
  393. },
  394. dataForm: {
  395. site: '',
  396. orderNo: '',
  397. orderItemNo: '',
  398. supplierID: '',
  399. supplierName: '',
  400. partNo: '',
  401. partDescription: '',
  402. spec: '',
  403. receive: '',
  404. suppDeliveryNote: '',
  405. quantity: '',
  406. rollQty: '',
  407. rollNumber: '',
  408. customerID: '',
  409. fGPartNo: '',
  410. referencePartDesc: '',
  411. checked: false,
  412. referenceSupplierID:'',
  413. referenceSupplierName:'',
  414. sOPartNo: '',
  415. },
  416. sum1: '',
  417. sum2: '',
  418. sum3: '',
  419. sum4: '',
  420. columnList: [
  421. {
  422. userId: this.$store.state.user.name,
  423. functionId: 6033,
  424. serialNumber: '6033TableOrderNo',
  425. tableId: "6033Table",
  426. tableName: "查询SAP分卷订单表",
  427. columnProp: "orderNo",
  428. headerAlign: "center",
  429. align: "left",
  430. columnLabel: "生产订单号",
  431. columnHidden: false,
  432. columnImage: false,
  433. columnSortable: false,
  434. sortLv: 0,
  435. status: true,
  436. fixed: '',
  437. columnWidth: 100
  438. },
  439. {
  440. userId: this.$store.state.user.name,
  441. functionId: 6033,
  442. serialNumber: '6033TableOrderDate',
  443. tableId: "6033Table",
  444. tableName: "查询SAP分卷订单表",
  445. columnProp: "orderDate",
  446. headerAlign: "center",
  447. align: "left",
  448. columnLabel: "订单日期",
  449. columnHidden: false,
  450. columnImage: false,
  451. columnSortable: false,
  452. sortLv: 0,
  453. status: true,
  454. fixed: '',
  455. columnWidth: 120
  456. },
  457. {
  458. userId: this.$store.state.user.name,
  459. functionId: 6033,
  460. serialNumber: '6033TablePlanReceiptDate',
  461. tableId: "6033Table",
  462. tableName: "查询SAP分卷订单表",
  463. columnProp: "planReceiptDate",
  464. headerAlign: "center",
  465. align: "left",
  466. columnLabel: "要求交货日期",
  467. columnHidden: false,
  468. columnImage: false,
  469. columnSortable: false,
  470. sortLv: 0,
  471. status: true,
  472. fixed: '',
  473. columnWidth: 120
  474. },
  475. {
  476. userId: this.$store.state.user.name,
  477. functionId: 6033,
  478. serialNumber: '6033TableSupplierID',
  479. tableId: "6033Table",
  480. tableName: "查询SAP分卷订单表",
  481. columnProp: "supplierID",
  482. headerAlign: "center",
  483. align: "left",
  484. columnLabel: "供应商编码",
  485. columnHidden: false,
  486. columnImage: false,
  487. columnSortable: false,
  488. sortLv: 0,
  489. status: true,
  490. fixed: '',
  491. columnWidth: 80
  492. },
  493. {
  494. userId: this.$store.state.user.name,
  495. functionId: 6033,
  496. serialNumber: '6033TableStatus',
  497. tableId: "6033Table",
  498. tableName: "查询SAP分卷订单表",
  499. columnProp: "status",
  500. headerAlign: "center",
  501. align: "left",
  502. columnLabel: "订单状态",
  503. columnHidden: false,
  504. columnImage: false,
  505. columnSortable: false,
  506. sortLv: 0,
  507. status: true,
  508. fixed: '',
  509. columnWidth: 70
  510. },
  511. {
  512. userId: this.$store.state.user.name,
  513. functionId: 6033,
  514. serialNumber: '6033TableSupplierName',
  515. tableId: "6033Table",
  516. tableName: "查询SAP分卷订单表",
  517. columnProp: "supplierName",
  518. headerAlign: "center",
  519. align: "left",
  520. columnLabel: "供应商名称",
  521. columnHidden: false,
  522. columnImage: false,
  523. columnSortable: false,
  524. sortLv: 0,
  525. status: true,
  526. fixed: '',
  527. columnWidth: 300
  528. },
  529. {
  530. userId: this.$store.state.user.name,
  531. functionId: 6033,
  532. serialNumber: '6033TableOrderItemNo',
  533. tableId: "6033Table",
  534. tableName: "查询SAP分卷订单表",
  535. columnProp: "orderItemNo",
  536. headerAlign: "center",
  537. align: "left",
  538. columnLabel: "订单序号",
  539. columnHidden: false,
  540. columnImage: false,
  541. columnSortable: false,
  542. sortLv: 0,
  543. status: true,
  544. fixed: '',
  545. columnWidth: 70
  546. },
  547. {
  548. userId: this.$store.state.user.name,
  549. functionId: 6033,
  550. serialNumber: '6033TablePartNo',
  551. tableId: "6033Table",
  552. tableName: "查询SAP分卷订单表",
  553. columnProp: "partNo",
  554. headerAlign: "center",
  555. align: "left",
  556. columnLabel: "物料编码",
  557. columnHidden: false,
  558. columnImage: false,
  559. columnSortable: false,
  560. sortLv: 0,
  561. status: true,
  562. fixed: '',
  563. columnWidth: 120
  564. },
  565. {
  566. userId: this.$store.state.user.name,
  567. functionId: 6033,
  568. serialNumber: '6033TablePartDescription',
  569. tableId: "6033Table",
  570. tableName: "查询SAP分卷订单表",
  571. columnProp: "partDescription",
  572. headerAlign: "center",
  573. align: "left",
  574. columnLabel: "物料名称",
  575. columnHidden: false,
  576. columnImage: false,
  577. columnSortable: false,
  578. sortLv: 0,
  579. status: true,
  580. fixed: '',
  581. columnWidth: 300
  582. },
  583. {
  584. userId: this.$store.state.user.name,
  585. functionId: 6033,
  586. serialNumber: '6033TableQuantity',
  587. tableId: "6033Table",
  588. tableName: "查询SAP分卷订单表",
  589. columnProp: "quantity",
  590. headerAlign: "center",
  591. align: "right",
  592. columnLabel: "订单数量",
  593. columnHidden: false,
  594. columnImage: false,
  595. columnSortable: false,
  596. sortLv: 0,
  597. status: true,
  598. fixed: '',
  599. columnWidth: 100
  600. },
  601. {
  602. userId: this.$store.state.user.name,
  603. functionId: 6033,
  604. serialNumber: '6033TableCancelledFlag',
  605. tableId: "6033Table",
  606. tableName: "查询SAP分卷订单表",
  607. columnProp: "cancelledFlag",
  608. headerAlign: "center",
  609. align: "left",
  610. columnLabel: "是否取消",
  611. columnHidden: false,
  612. columnImage: false,
  613. columnSortable: false,
  614. sortLv: 0,
  615. status: true,
  616. fixed: '',
  617. columnWidth: 70
  618. },
  619. {
  620. userId: this.$store.state.user.name,
  621. functionId: 6033,
  622. serialNumber: '6033TableSAPOrderNo',
  623. tableId: "6033Table",
  624. tableName: "查询SAP分卷订单表",
  625. columnProp: "sAPOrderNo",
  626. headerAlign: "center",
  627. align: "left",
  628. columnLabel: "SAP订单识别号",
  629. columnHidden: false,
  630. columnImage: false,
  631. columnSortable: false,
  632. sortLv: 0,
  633. status: true,
  634. fixed: '',
  635. columnWidth: 120
  636. },
  637. {
  638. userId: this.$store.state.user.name,
  639. functionId: 6033,
  640. serialNumber: '6033TableSite',
  641. tableId: "6033Table",
  642. tableName: "查询SAP分卷订单表",
  643. columnProp: "site",
  644. headerAlign: "center",
  645. align: "left",
  646. columnLabel: "工厂编号",
  647. columnHidden: false,
  648. columnImage: false,
  649. columnSortable: false,
  650. sortLv: 0,
  651. status: true,
  652. fixed: '',
  653. columnWidth: 70
  654. },
  655. ],
  656. dataList: [],
  657. dataList3: [],
  658. dataList2: [],
  659. dataList1: [],
  660. dataList4: [],
  661. dataListLoading: false,
  662. columnList1: [
  663. {
  664. userId: this.$store.state.user.name,
  665. functionId: 6033,
  666. serialNumber: '6033Table1Number',
  667. tableId: "6033Table1",
  668. tableName: "查询SAP分卷订单待分卷左表",
  669. columnProp: "number",
  670. headerAlign: "center",
  671. align: "right",
  672. columnLabel: "次序号",
  673. columnHidden: false,
  674. columnImage: false,
  675. columnSortable: false,
  676. sortLv: 0,
  677. status: true,
  678. fixed: '',
  679. columnWidth: 50
  680. },
  681. {
  682. userId: this.$store.state.user.name,
  683. functionId: 6033,
  684. serialNumber: '6033Table1RollQty',
  685. tableId: "6033Table1",
  686. tableName: "查询SAP分卷订单待分卷左表",
  687. columnProp: "rollQty",
  688. headerAlign: "center",
  689. align: "right",
  690. columnLabel: "每卷数量",
  691. columnHidden: false,
  692. columnImage: false,
  693. columnSortable: false,
  694. sortLv: 0,
  695. status: true,
  696. fixed: '',
  697. columnWidth: 80
  698. },
  699. {
  700. userId: this.$store.state.user.name,
  701. functionId: 6033,
  702. serialNumber: '6033Table1RollNumber',
  703. tableId: "6033Table1",
  704. tableName: "查询SAP分卷订单待分卷左表",
  705. columnProp: "rollNumber",
  706. headerAlign: "center",
  707. align: "left",
  708. columnLabel: "卷数",
  709. columnHidden: false,
  710. columnImage: false,
  711. columnSortable: false,
  712. sortLv: 0,
  713. status: true,
  714. fixed: '',
  715. columnWidth: 50
  716. },
  717. {
  718. userId: this.$store.state.user.name,
  719. functionId: 6033,
  720. serialNumber: '6033Table1ALLRollQty',
  721. tableId: "6033Table1",
  722. tableName: "查询SAP分卷订单待分卷左表",
  723. columnProp: "allRollQty",
  724. headerAlign: "center",
  725. align: "left",
  726. columnLabel: "总数量",
  727. columnHidden: false,
  728. columnImage: false,
  729. columnSortable: false,
  730. sortLv: 0,
  731. status: true,
  732. fixed: '',
  733. columnWidth: 80
  734. }
  735. ],
  736. columnList2: [
  737. {
  738. userId: this.$store.state.user.name,
  739. functionId: 6033,
  740. serialNumber: '6033Table2PartNo',
  741. tableId: "6033Table2",
  742. tableName: "查询SAP分卷订单待分卷右表",
  743. columnProp: "partNo",
  744. headerAlign: "center",
  745. align: "left",
  746. columnLabel: "物料编码",
  747. columnHidden: false,
  748. columnImage: false,
  749. columnSortable: false,
  750. sortLv: 0,
  751. status: true,
  752. fixed: '',
  753. columnWidth: 120
  754. },
  755. {
  756. userId: this.$store.state.user.name,
  757. functionId: 6033,
  758. serialNumber: '6033Table2PartDescription',
  759. tableId: "6033Table2",
  760. tableName: "查询SAP分卷订单待分卷右表",
  761. columnProp: "partDescription",
  762. headerAlign: "center",
  763. align: "left",
  764. columnLabel: "物料名称",
  765. columnHidden: false,
  766. columnImage: false,
  767. columnSortable: false,
  768. sortLv: 0,
  769. status: true,
  770. fixed: '',
  771. columnWidth: 168
  772. },
  773. {
  774. userId: this.$store.state.user.name,
  775. functionId: 6033,
  776. serialNumber: '6033Table2OrderItemNo',
  777. tableId: "6033Table2",
  778. tableName: "查询SAP分卷订单待分卷右表",
  779. columnProp: "orderItemNo",
  780. headerAlign: "center",
  781. align: "left",
  782. columnLabel: "订单序号",
  783. columnHidden: false,
  784. columnImage: false,
  785. columnSortable: false,
  786. sortLv: 0,
  787. status: true,
  788. fixed: '',
  789. columnWidth: 80
  790. },
  791. {
  792. userId: this.$store.state.user.name,
  793. functionId: 6033,
  794. serialNumber: '6033Table2Quantity',
  795. tableId: "6033Table2",
  796. tableName: "查询SAP分卷订单待分卷右表",
  797. columnProp: "quantity",
  798. headerAlign: "center",
  799. align: "left",
  800. columnLabel: "订单数量",
  801. columnHidden: false,
  802. columnImage: false,
  803. columnSortable: false,
  804. sortLv: 0,
  805. status: true,
  806. fixed: '',
  807. columnWidth: 80
  808. }
  809. ],
  810. columnList3: [
  811. {
  812. userId: this.$store.state.user.name,
  813. functionId: 6033,
  814. serialNumber: '6033Table3RollNo',
  815. tableId: "6033Table",
  816. tableName: "查询SAP分卷订单已分卷表",
  817. columnProp: "rollNo",
  818. headerAlign: "center",
  819. align: "left",
  820. columnLabel: "卷号",
  821. columnHidden: false,
  822. columnImage: false,
  823. columnSortable: false,
  824. sortLv: 0,
  825. status: true,
  826. fixed: '',
  827. columnWidth: 80
  828. },
  829. {
  830. userId: this.$store.state.user.name,
  831. functionId: 6033,
  832. serialNumber: '6033Table3RollQty',
  833. tableId: "6033Table",
  834. tableName: "查询SAP分卷订单已分卷表",
  835. columnProp: "rollQty",
  836. headerAlign: "center",
  837. align: "right",
  838. columnLabel: "卷数量",
  839. columnHidden: false,
  840. columnImage: false,
  841. columnSortable: false,
  842. sortLv: 0,
  843. status: true,
  844. fixed: '',
  845. columnWidth: 60
  846. },
  847. {
  848. userId: this.$store.state.user.name,
  849. functionId: 6033,
  850. serialNumber: '6033Table3SuppDeliveryNote',
  851. tableId: "6033Table",
  852. tableName: "查询SAP分卷订单已分卷表",
  853. columnProp: "suppDeliveryNote",
  854. headerAlign: "center",
  855. align: "left",
  856. columnLabel: "供应商送货单号",
  857. columnHidden: false,
  858. columnImage: false,
  859. columnSortable: false,
  860. sortLv: 0,
  861. status: true,
  862. fixed: '',
  863. columnWidth: 100
  864. },
  865. {
  866. userId: this.$store.state.user.name,
  867. functionId: 6033,
  868. serialNumber: '6033Table3RollDate',
  869. tableId: "6033Table",
  870. tableName: "查询SAP分卷订单已分卷表",
  871. columnProp: "rollDate",
  872. headerAlign: "center",
  873. align: "left",
  874. columnLabel: "入库日期",
  875. columnHidden: false,
  876. columnImage: false,
  877. columnSortable: false,
  878. sortLv: 0,
  879. status: true,
  880. fixed: '',
  881. columnWidth: 120
  882. },
  883. {
  884. userId: this.$store.state.user.name,
  885. functionId: 6033,
  886. serialNumber: '6033Table3CreatedDate',
  887. tableId: "6033Table",
  888. tableName: "查询SAP分卷订单已分卷表",
  889. columnProp: "createdDate",
  890. headerAlign: "center",
  891. align: "left",
  892. columnLabel: "分卷日期",
  893. columnHidden: false,
  894. columnImage: false,
  895. columnSortable: false,
  896. sortLv: 0,
  897. status: true,
  898. fixed: '',
  899. columnWidth: 120
  900. },
  901. {
  902. userId: this.$store.state.user.name,
  903. functionId: 6033,
  904. serialNumber: '6033Table3CreatedBy',
  905. tableId: "6033Table",
  906. tableName: "查询SAP分卷订单已分卷表",
  907. columnProp: "createdBy",
  908. headerAlign: "center",
  909. align: "left",
  910. columnLabel: "分卷人",
  911. columnHidden: false,
  912. columnImage: false,
  913. columnSortable: false,
  914. sortLv: 0,
  915. status: true,
  916. fixed: '',
  917. columnWidth: 60
  918. },
  919. {
  920. userId: this.$store.state.user.name,
  921. functionId: 6033,
  922. serialNumber: '6033Table3SuppRollNoFlag',
  923. tableId: "6033Table",
  924. tableName: "查询SAP分卷订单已分卷表",
  925. columnProp: "suppRollNoFlag",
  926. headerAlign: "center",
  927. align: "left",
  928. columnLabel: "已录入供应商批号",
  929. columnHidden: false,
  930. columnImage: false,
  931. columnSortable: false,
  932. sortLv: 0,
  933. status: true,
  934. fixed: '',
  935. columnWidth: 120
  936. },
  937. {
  938. userId: this.$store.state.user.name,
  939. functionId: 6033,
  940. serialNumber: '6033Table3SuppRollNo',
  941. tableId: "6033Table",
  942. tableName: "查询SAP分卷订单已分卷表",
  943. columnProp: "suppRollNo",
  944. headerAlign: "center",
  945. align: "left",
  946. columnLabel: "供应商批号",
  947. columnHidden: false,
  948. columnImage: false,
  949. columnSortable: false,
  950. sortLv: 0,
  951. status: true,
  952. fixed: '',
  953. columnWidth: 300
  954. }
  955. ],
  956. columnList4: [
  957. {
  958. userId: this.$store.state.user.name,
  959. functionId: 6033,
  960. serialNumber: '6033Table4TransNo',
  961. tableId: "6033Table",
  962. tableName: "查询SAP分卷订单出库卷清单表",
  963. columnProp: "transNo",
  964. headerAlign: "center",
  965. align: "left",
  966. columnLabel: "出库单号",
  967. columnHidden: false,
  968. columnImage: false,
  969. columnSortable: false,
  970. sortLv: 0,
  971. status: true,
  972. fixed: '',
  973. columnWidth: 120
  974. },
  975. {
  976. userId: this.$store.state.user.name,
  977. functionId: 6033,
  978. serialNumber: '6033Table4TransDate',
  979. tableId: "6033Table",
  980. tableName: "查询SAP分卷订单出库卷清单表",
  981. columnProp: "transDate",
  982. headerAlign: "center",
  983. align: "left",
  984. columnLabel: "出库日期",
  985. columnHidden: false,
  986. columnImage: false,
  987. columnSortable: false,
  988. sortLv: 0,
  989. status: true,
  990. fixed: '',
  991. columnWidth: 95
  992. },
  993. {
  994. userId: this.$store.state.user.name,
  995. functionId: 6033,
  996. serialNumber: '6033Table4SubNo',
  997. tableId: "6033Table",
  998. tableName: "查询SAP分卷订单出库卷清单表",
  999. columnProp: "subNo",
  1000. headerAlign: "center",
  1001. align: "left",
  1002. columnLabel: "卷号",
  1003. columnHidden: false,
  1004. columnImage: false,
  1005. columnSortable: false,
  1006. sortLv: 0,
  1007. status: true,
  1008. fixed: '',
  1009. columnWidth: 150
  1010. },
  1011. {
  1012. userId: this.$store.state.user.name,
  1013. functionId: 6033,
  1014. serialNumber: '6033Table4SubQty',
  1015. tableId: "6033Table",
  1016. tableName: "查询SAP分卷订单出库卷清单表",
  1017. columnProp: "subQty",
  1018. headerAlign: "center",
  1019. align: "right",
  1020. columnLabel: "卷数量",
  1021. columnHidden: false,
  1022. columnImage: false,
  1023. columnSortable: false,
  1024. sortLv: 0,
  1025. status: true,
  1026. fixed: '',
  1027. columnWidth: 60
  1028. },
  1029. {
  1030. userId: this.$store.state.user.name,
  1031. functionId: 6033,
  1032. serialNumber: '6033Table4TransTypeDb',
  1033. tableId: "6033Table",
  1034. tableName: "查询SAP分卷订单出库卷清单表",
  1035. columnProp: "transTypeDb",
  1036. headerAlign: "center",
  1037. align: "left",
  1038. columnLabel: "出入库类型",
  1039. columnHidden: false,
  1040. columnImage: false,
  1041. columnSortable: false,
  1042. sortLv: 0,
  1043. status: true,
  1044. fixed: '',
  1045. columnWidth: 100
  1046. },
  1047. {
  1048. userId: this.$store.state.user.name,
  1049. functionId: 6033,
  1050. serialNumber: '6033Table4UserName',
  1051. tableId: "6033Table",
  1052. tableName: "查询SAP分卷订单出库卷清单表",
  1053. columnProp: "userName",
  1054. headerAlign: "center",
  1055. align: "left",
  1056. columnLabel: "经手人",
  1057. columnHidden: false,
  1058. columnImage: false,
  1059. columnSortable: false,
  1060. sortLv: 0,
  1061. status: true,
  1062. fixed: '',
  1063. columnWidth: 80
  1064. },
  1065. {
  1066. userId: this.$store.state.user.name,
  1067. functionId: 6033,
  1068. serialNumber: '6033Table4PartNo',
  1069. tableId: "6033Table",
  1070. tableName: "查询SAP分卷订单出库卷清单表",
  1071. columnProp: "partNo",
  1072. headerAlign: "center",
  1073. align: "left",
  1074. columnLabel: "材料编码",
  1075. columnHidden: false,
  1076. columnImage: false,
  1077. columnSortable: false,
  1078. sortLv: 0,
  1079. status: true,
  1080. fixed: '',
  1081. columnWidth: 150
  1082. }
  1083. ],
  1084. }
  1085. },
  1086. mounted() {
  1087. this.$nextTick(() => {
  1088. this.height = window.innerHeight - 200;
  1089. })
  1090. },
  1091. methods: {
  1092. getBaseData(val){
  1093. if (this.tagNo === 92){
  1094. this.dataForm.customerID = val.ConfigurationTemplateID
  1095. this.getReferenceData();
  1096. }
  1097. if (this.tagNo === 5){
  1098. this.dataForm.fGPartNo = val.PartNo
  1099. this.getReferenceData();
  1100. }
  1101. },
  1102. // 获取基础数据列表
  1103. getBaseList(val){
  1104. this.tagNo = val
  1105. this.$nextTick(() => {
  1106. let strVal = "";
  1107. if (val === 5){
  1108. strVal = this.dataForm.fGPartNo
  1109. }
  1110. if (val === 92){
  1111. strVal = this.dataForm.customerID
  1112. }
  1113. this.$refs.baseList.init(val,strVal)
  1114. })
  1115. },
  1116. getData() {
  1117. searchSAPSlittedOrder(this.searchData).then(({data}) => {
  1118. this.dataList = data.rows
  1119. })
  1120. },
  1121. showModel(row) {
  1122. this.dataForm2={};
  1123. this.dataList1 = [];
  1124. this.sum1 = 0;
  1125. this.sum2 = 0;
  1126. this.sum3 = 0;
  1127. this.sum4 = 0;
  1128. // this.dataForm = JSON.parse(JSON.stringify(row))
  1129. // this.dataForm.fGPartNo='无';
  1130. // this.dataForm.customerID='无';
  1131. // this.dataForm.suppDeliveryNote='*';
  1132. this.dataForm={
  1133. site: row.site,
  1134. orderNo: row.orderNo,
  1135. orderItemNo: row.orderItemNo,
  1136. supplierID: row.supplierID,
  1137. supplierName: row.supplierName,
  1138. partNo: row.partNo,
  1139. partDescription: row.partDescription,
  1140. spec: row.spec,
  1141. receive: row.receive,
  1142. suppDeliveryNote: '*',
  1143. quantity: row.quantity,
  1144. rollQty: row.rollQty,
  1145. rollNumber: row.rollNumber,
  1146. customerID: '无',
  1147. fGPartNo: '无',
  1148. referencePartDesc: '',
  1149. checked: false,
  1150. sOPartNo: row.sOPartNo,
  1151. };
  1152. var year = new Date().getFullYear(); //获取完整的年份(4位,1970-????)
  1153. var month = new Date().getMonth() + 1; //获取当前月份(0-11,0代表1月)
  1154. var day = new Date().getDate(); //获取当前日(1-31)
  1155. if (month < 10) {
  1156. month = "0" + month;
  1157. }
  1158. if (day < 10) {
  1159. day = "0" + day;
  1160. }
  1161. var dateString = year + "-" + month + "-" + day;
  1162. this.$set(this.dataForm, 'receive', dateString)
  1163. this.getReferenceData();
  1164. let inData = {
  1165. site: row.site,
  1166. orderRef1: row.orderNo,
  1167. orderRef2: row.orderItemNo,
  1168. }
  1169. searchCRollInfoDetail(inData).then(({data}) => {
  1170. this.dataList3 = data.rows
  1171. for (let i = 0; i < data.total; i++) {
  1172. this.sum4 += this.dataList3[i].rollQty;
  1173. }
  1174. this.sum3 = data.total;
  1175. })
  1176. this.getAllThePartNo();
  1177. this.getTransRoll();
  1178. this.modelFlag = true;
  1179. },
  1180. insertData(){
  1181. if (this.dataForm.rollQty == '' || this.dataForm.rollQty == null || this.dataForm.rollQty <= 0) {
  1182. this.$alert("请输入正确的每卷数量!", '错误', {
  1183. confirmButtonText: '确定'
  1184. })
  1185. return false;
  1186. }
  1187. if (this.dataForm.rollNumber == '' || this.dataForm.rollQty == null || this.dataForm.rollNumber <= 0) {
  1188. this.$alert("请输入正确的卷数!", '错误', {
  1189. confirmButtonText: '确定'
  1190. })
  1191. return false;
  1192. }
  1193. if(this.dataList3.length>0){
  1194. this.$confirm(`该订单已有分切卷,是否继续?`, '提示', {
  1195. confirmButtonText: '确定',
  1196. cancelButtonText: '取消',
  1197. type: 'warning'
  1198. }).then(() => {
  1199. this.insertData2();
  1200. })
  1201. }else {
  1202. this.insertData2();
  1203. }
  1204. },
  1205. insertData2() {
  1206. let newDate = {
  1207. number: this.dataList1.length + 1,
  1208. allRollQty: this.dataForm.rollQty * this.dataForm.rollNumber,
  1209. site: this.dataForm.site,
  1210. rollQty: this.dataForm.rollQty,
  1211. rollNumber: this.dataForm.rollNumber,
  1212. partNo: this.dataForm.partNo,
  1213. supplierID: this.dataForm.supplierID,
  1214. orderRef1: this.dataForm.orderNo,
  1215. orderRef2: this.dataForm.orderNo,
  1216. orderRef3: this.dataForm.orderItemNo,
  1217. orderRef4: 'S',
  1218. // suppDeliveryNote: this.dataForm.suppDeliveryNote,
  1219. rollDate: this.dataForm.receive,
  1220. createdBy: this.$store.state.user.name,
  1221. statusDb: 'I',
  1222. status: '已入库',
  1223. suppRollNoFlag: 'N',
  1224. sourceType: '分切入库',
  1225. rolltype: '合格卷',
  1226. rolltypeDb: 0,
  1227. parttypeFlag: 'R',
  1228. customerID: this.dataForm.customerID,
  1229. refPartDesc:this.dataForm.referencePartDesc,
  1230. refSupplierID:this.dataForm.referenceSupplierID,
  1231. fGPartNo: this.dataForm.fGPartNo,
  1232. orderRef5: this.dataForm.sOPartNo,
  1233. }
  1234. this.dataList1.push(newDate)
  1235. this.sum1 = Number(this.sum1)+ Number(newDate.rollNumber);
  1236. this.sum2 = Number(this.sum2)+ Number(newDate.allRollQty);
  1237. },
  1238. saveCRoll() {
  1239. let inData = {
  1240. site: this.dataForm.site,
  1241. partNo: this.dataForm.fGPartNo
  1242. }
  1243. getPartNoDetail(inData).then(({data}) => {
  1244. if (data.total > 0||this.dataForm.fGPartNo=='无') {
  1245. let inData2 = {
  1246. site: this.dataForm.site,
  1247. configurationTemplateID: this.dataForm.customerID,
  1248. }
  1249. checkCustomerID(inData2).then(({data}) => {
  1250. if (data.total > 0||this.dataForm.customerID=='无') {
  1251. if(this.dataForm2.rollNo2==""||this.dataForm2.rollNo2==null){
  1252. this.$alert("该订单下,该用户下没有扫描出库卷,不能分切 !", '错误', {
  1253. confirmButtonText: '确定'
  1254. })
  1255. return false;
  1256. }
  1257. if (this.dataList1.length == 0) {
  1258. this.$alert("没有待分卷信息!", '错误', {
  1259. confirmButtonText: '确定'
  1260. })
  1261. return false;
  1262. }
  1263. if (this.sum2 + this.sum4 < this.dataForm.quantity) {
  1264. this.$confirm(`累计分切数量小于订单数量,是否继续?`, '提示', {
  1265. confirmButtonText: '确定',
  1266. cancelButtonText: '取消',
  1267. type: 'warning'
  1268. }).then(() => {
  1269. this.doSaveCRoll()
  1270. })
  1271. }
  1272. if (this.sum2 + this.sum4 === this.dataForm.quantity){
  1273. this.doSaveCRoll()
  1274. }
  1275. if (this.sum2 + this.sum4 > this.dataForm.quantity) {
  1276. this.$confirm(`累计分切数量大于订单数量,是否继续?`, '提示', {
  1277. confirmButtonText: '确定',
  1278. cancelButtonText: '取消',
  1279. type: 'warning'
  1280. }).then(() => {
  1281. this.doSaveCRoll()
  1282. })
  1283. }
  1284. } else {
  1285. this.$alert('该客户编号不存在', '错误', {
  1286. confirmButtonText: '确定'
  1287. })
  1288. return false;
  1289. }
  1290. })
  1291. } else {
  1292. this.$alert('该物料编码不存在', '错误', {
  1293. confirmButtonText: '确定'
  1294. })
  1295. return false;
  1296. }
  1297. })
  1298. },
  1299. doSaveCRoll() {
  1300. saveCRollData(this.dataList1).then(({data}) => {
  1301. if (data && data.code == 200) {
  1302. this.dataList1 = [];
  1303. this.sum1 = 0;
  1304. this.sum2 = 0;
  1305. let inData = {
  1306. site: this.dataForm.site,
  1307. orderRef1: this.dataForm.orderNo,
  1308. orderRef3: this.dataForm.orderItemNo,
  1309. }
  1310. searchCRollInfoDetail(inData).then(({data}) => {
  1311. this.dataList3 = data.rows
  1312. for (let i = 0; i < data.total; i++) {
  1313. this.sum4 = Number(this.sum4)+ Number(this.dataList3[i].rollQty);
  1314. }
  1315. this.sum3 = data.total;
  1316. })
  1317. this.$message.success( '操作成功')
  1318. } else {
  1319. this.$alert(data.msg, '错误', {
  1320. confirmButtonText: '确定'
  1321. })
  1322. }
  1323. })
  1324. },
  1325. getPartNo() {
  1326. let inData = {
  1327. site: this.dataForm.site,
  1328. partNo: this.dataForm.fGPartNo
  1329. }
  1330. getPartNoDetail(inData).then(({data}) => {
  1331. if (data.total > 0||this.dataForm.fGPartNo=='无') {
  1332. } else {
  1333. this.dataForm.fGPartNo = '';
  1334. this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  1335. this.$alert('该物料编码不存在', '错误', {
  1336. confirmButtonText: '确定'
  1337. })
  1338. }
  1339. })
  1340. },
  1341. getCustomerID() {
  1342. let inData = {
  1343. site: this.dataForm.site,
  1344. configurationTemplateID: this.dataForm.customerID,
  1345. }
  1346. checkCustomerID(inData).then(({data}) => {
  1347. if (data.total > 0||this.dataForm.customerID=='无') {
  1348. } else {
  1349. this.dataForm.customerID = '';
  1350. this.dataForm = JSON.parse(JSON.stringify(this.dataForm));
  1351. this.$alert('该客户编号不存在', '错误', {
  1352. confirmButtonText: '确定'
  1353. })
  1354. }
  1355. })
  1356. },
  1357. getAllThePartNo() {
  1358. let list = [];
  1359. for (let i = 0; i < this.dataList.length; i++) {
  1360. if (this.dataList[i].orderNo == this.dataForm.orderNo) {
  1361. list.push(this.dataList[i]);
  1362. }
  1363. }
  1364. this.dataList2 = list;
  1365. },
  1366. //双击切换订单
  1367. changeData(row) {
  1368. if (this.dataList1.length > 0) {
  1369. this.$confirm(`切换订单将会清空待分卷信息,是否继续?`, '提示', {
  1370. confirmButtonText: '确定',
  1371. cancelButtonText: '取消',
  1372. type: 'warning'
  1373. }).then(() => {
  1374. this.sum1 = 0;
  1375. this.sum2 = 0;
  1376. this.sum3 = 0;
  1377. this.sum4 = 0;
  1378. this.dataList1 = [];
  1379. this.dataForm = {
  1380. site: row.site,
  1381. orderNo: row.orderNo,
  1382. orderItemNo: row.orderItemNo,
  1383. supplierID: row.supplierID,
  1384. supplierName: row.supplierName,
  1385. partNo: row.partNo,
  1386. partDescription: row.partDescription,
  1387. spec: row.spec,
  1388. receive: row.receive,
  1389. suppDeliveryNote: '*',
  1390. quantity: row.quantity,
  1391. rollQty: row.rollQty,
  1392. rollNumber: row.rollNumber,
  1393. customerID: '无',
  1394. fGPartNo: '无',
  1395. referencePartDesc: '',
  1396. checked: false,
  1397. sOPartNo: row.sOPartNo,
  1398. };
  1399. this.getReferenceData();
  1400. this.$set(this.dataForm, 'receive', new Date());
  1401. let inData = {
  1402. site: this.dataForm.site,
  1403. orderRef1: this.dataForm.orderNo,
  1404. orderRef3: this.dataForm.orderItemNo,
  1405. }
  1406. searchCRollInfoDetail(inData).then(({data}) => {
  1407. this.dataList3 = data.rows
  1408. for (let i = 0; i < data.total; i++) {
  1409. this.sum4 = Number(this.sum4) +Number(this.dataList3[i].rollQty);
  1410. }
  1411. this.sum3 = data.total;
  1412. })
  1413. })
  1414. } else {
  1415. this.sum1 = 0;
  1416. this.sum2 = 0;
  1417. this.sum3 = 0;
  1418. this.sum4 = 0;
  1419. this.dataList1 = [];
  1420. this.dataForm = {
  1421. site: row.site,
  1422. orderNo: row.orderNo,
  1423. orderItemNo: row.orderItemNo,
  1424. supplierID: row.supplierID,
  1425. supplierName: row.supplierName,
  1426. partNo: row.partNo,
  1427. partDescription: row.partDescription,
  1428. spec: row.spec,
  1429. receive: row.receive,
  1430. suppDeliveryNote: '*',
  1431. quantity: row.quantity,
  1432. rollQty: row.rollQty,
  1433. rollNumber: row.rollNumber,
  1434. customerID: '无',
  1435. fGPartNo: '无',
  1436. referencePartDesc: '',
  1437. checked: false,
  1438. sOPartNo: row.sOPartNo,
  1439. };
  1440. this.getReferenceData();
  1441. this.$set(this.dataForm, 'receive', new Date());
  1442. let inData = {
  1443. site: this.dataForm.site,
  1444. orderRef1: this.dataForm.orderNo,
  1445. orderRef3: this.dataForm.orderItemNo,
  1446. }
  1447. searchCRollInfoDetail(inData).then(({data}) => {
  1448. this.dataList3 = data.rows
  1449. for (let i = 0; i < data.total; i++) {
  1450. this.sum4 += this.dataList3[i].rollQty;
  1451. }
  1452. this.sum3 = data.total;
  1453. })
  1454. }
  1455. },
  1456. //供应商批号录入
  1457. getSaveModel() {
  1458. this.saveData = {
  1459. site:this.$store.state.user.site,
  1460. rollNo:'',
  1461. suppRollNo:''
  1462. };
  1463. this.modelFlag2 = true;
  1464. },
  1465. goSaveSuppRollNo() {
  1466. if (this.saveData.site == '' || this.saveData.site == null) {
  1467. this.$alert("请输入工厂编码!", '错误', {
  1468. confirmButtonText: '确定'
  1469. })
  1470. return false;
  1471. }
  1472. if (this.saveData.rollNo == '' || this.saveData.rollNo == null) {
  1473. this.$alert("请输入卷号!", '错误', {
  1474. confirmButtonText: '确定'
  1475. })
  1476. return false;
  1477. }
  1478. if (this.saveData.suppRollNo == '' || this.saveData.suppRollNo == null) {
  1479. this.$alert("请输入供应商批号!", '错误', {
  1480. confirmButtonText: '确定'
  1481. })
  1482. return false;
  1483. }
  1484. saveSuppRollNo(this.saveData).then(({data}) => {
  1485. if (data.rows == null) {
  1486. this.$alert("该卷号不存在,请输入!", '错误', {
  1487. confirmButtonText: '确定'
  1488. })
  1489. return false;
  1490. } else {
  1491. if (data.rows.suppRollNoFlag == 'Y') {
  1492. this.$confirm(`该卷已经录入供应商批号,确认要重新录入吗?`, '提示', {
  1493. confirmButtonText: '确定',
  1494. cancelButtonText: '取消',
  1495. type: 'warning'
  1496. }).then(() => {
  1497. doSaveSuppRollNo(this.saveData).then(({data}) => {
  1498. if (data && data.code == 200) {
  1499. this.modelFlag2 = false
  1500. this.$message({
  1501. message: '操作成功',
  1502. type: 'success',
  1503. duration: 1500,
  1504. onClose: () => {
  1505. }
  1506. })
  1507. } else {
  1508. this.$alert(data.msg, '错误', {
  1509. confirmButtonText: '确定'
  1510. })
  1511. }
  1512. })
  1513. })
  1514. } else {
  1515. doSaveSuppRollNo(this.saveData).then(({data}) => {
  1516. if (data && data.code == 200) {
  1517. this.modelFlag2 = false
  1518. this.$message({
  1519. message: '操作成功',
  1520. type: 'success',
  1521. duration: 1500,
  1522. onClose: () => {
  1523. }
  1524. })
  1525. } else {
  1526. this.$alert(data.msg, '错误', {
  1527. confirmButtonText: '确定'
  1528. })
  1529. }
  1530. })
  1531. }
  1532. }
  1533. }
  1534. )
  1535. },
  1536. //出库卷清单
  1537. getTransRoll() {
  1538. let inData = {
  1539. site: this.dataForm.site,
  1540. orderRef1: this.dataForm.orderNo,
  1541. partNo: this.dataForm.sOPartNo,
  1542. user:this.$store.state.user.name,
  1543. }
  1544. getTransRoll(inData).then(({data}) => {
  1545. this.dataList4 = data.rows
  1546. if(data.row2!=null) {
  1547. this.dataForm2.rollNo2 = data.row2.rollNo
  1548. }
  1549. })
  1550. },
  1551. //结束卷
  1552. checkRoll() {
  1553. if (this.dataList1.length > 0) {
  1554. this.$alert("该界面存在分卷尚未创建,请先创建!!", '错误', {
  1555. confirmButtonText: '确定'
  1556. })
  1557. return false;
  1558. }
  1559. if(this.dataForm2.rollNo2 ==""||this.dataForm2.rollNo2 ==null){
  1560. this.$alert("请选择卷号!", '错误', {
  1561. confirmButtonText: '确定'
  1562. })
  1563. return false;
  1564. }
  1565. if (this.dataForm2.fTotalQty2 <= 0 || this.dataForm2.fTotalQty2 ==""||this.dataForm2.fTotalQty2 ==null) {
  1566. this.$alert("请输入正确的每卷数量!", '错误', {
  1567. confirmButtonText: '确定'
  1568. })
  1569. return false;
  1570. }
  1571. let inData = {
  1572. site: this.dataForm.site,
  1573. orderRef1: this.dataForm.orderNo,
  1574. orderRef3: this.dataForm.orderItemNo,
  1575. rollNo:this.dataForm2.rollNo2,
  1576. fTotalQty2:this.dataForm2.fTotalQty2,
  1577. sOPartNo:this.dataForm.sOPartNo,
  1578. userId:this.$store.state.user.name,
  1579. }
  1580. checkFinishRoll(inData).then(({data}) => {
  1581. if (data && data.code == 200) {
  1582. console.log(data.obj)
  1583. if(data.obj.successFlag=='Y'){
  1584. this.saveRoll();
  1585. }else {
  1586. if(data.obj.ableFlag=='Y'){
  1587. this.$confirm(data.obj.messageBox+`,是否继续`, '提示', {
  1588. confirmButtonText: '确定',
  1589. cancelButtonText: '取消',
  1590. type: 'warning'
  1591. }).then(() => {
  1592. this.saveRoll();
  1593. })
  1594. }else {
  1595. this.$alert(data.obj.messageBox, '错误', {
  1596. confirmButtonText: '确定'
  1597. })
  1598. return false;
  1599. }
  1600. }
  1601. } else {
  1602. this.$alert(data.msg, '错误', {
  1603. confirmButtonText: '确定'
  1604. })
  1605. }
  1606. })
  1607. },
  1608. saveRoll(){
  1609. let inData = {
  1610. site: this.dataForm.site,
  1611. orderRef1: this.dataForm.orderNo,
  1612. orderRef3: this.dataForm.orderItemNo,
  1613. rollNo:this.dataForm2.rollNo2,
  1614. fTotalQty2:this.dataForm2.fTotalQty2,
  1615. sOPartNo:this.dataForm.sOPartNo,
  1616. userId:this.$store.state.user.name,
  1617. }
  1618. saveFinishRoll(inData).then(({data}) => {
  1619. if (data && data.code == 200) {
  1620. let newData={
  1621. transNo:data.obj.transNo,
  1622. transDate:data.obj.transDate,
  1623. subNo:this.dataForm2.rollNo2,
  1624. subQty:this.dataForm2.fTotalQty2,
  1625. transTypeDb:"SIR",
  1626. userName:this.$store.state.user.name,
  1627. partNo:this.dataForm.sOPartNo,
  1628. }
  1629. this.dataList4.push(newData);
  1630. this.dataForm2={};
  1631. this.$message.success('操作成功')
  1632. } else {
  1633. this.$alert(data.msg, '错误', {
  1634. confirmButtonText: '确定'
  1635. })
  1636. }
  1637. })
  1638. },
  1639. rollNoOut(){
  1640. if (this.dataForm2.rollNo == '' || this.dataForm2.rollNo == null) {
  1641. this.$alert("卷号不能为空,请输入!", '错误', {
  1642. confirmButtonText: '确定'
  1643. })
  1644. return false;
  1645. }
  1646. let inData={
  1647. site:this.dataForm.site,
  1648. partNo:this.dataForm.partNo,
  1649. fGPartNo:this.dataForm.sOPartNo,
  1650. rollNo:this.dataForm2.rollNo,
  1651. orderRef1:this.dataForm.orderNo,
  1652. orderRef3:this.dataForm.orderItemNo,
  1653. user:this.$store.state.user.name,
  1654. }
  1655. saveRollNoOut(inData).then(({data}) => {
  1656. if (data && data.code == 200) {
  1657. let newData={
  1658. transNo:data.obj.transNo,
  1659. transDate:data.obj.transDate,
  1660. subNo:this.dataForm2.rollNo,
  1661. subQty:data.obj.qty,
  1662. transTypeDb:"SI",
  1663. userName:this.$store.state.user.name,
  1664. partNo:this.dataForm.sOPartNo,
  1665. }
  1666. this.dataList4.push(newData);
  1667. this.dataForm2.rollNo2=this.dataForm2.rollNo;
  1668. this.dataForm2.rollNo='';
  1669. this.$message.success('操作成功')
  1670. } else {
  1671. this.dataForm2.rollNo='';
  1672. this.$alert(data.msg, '错误', {
  1673. confirmButtonText: '确定'
  1674. })
  1675. }
  1676. })
  1677. },
  1678. //导出excel
  1679. createExportData() {
  1680. return this.dataList;
  1681. },
  1682. startDownload() {
  1683. // this.exportData = this.dataList
  1684. },
  1685. finishDownload() {
  1686. },
  1687. fields() {
  1688. let json = "{"
  1689. this.columnList.forEach((item, index) => {
  1690. if (index == this.columnList.length - 1) {
  1691. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1692. } else {
  1693. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1694. }
  1695. })
  1696. json += "}"
  1697. let s = eval("(" + json + ")")
  1698. return s
  1699. },
  1700. // 导出 end
  1701. getReferenceData(){
  1702. let inData = {
  1703. site: this.dataForm.site,
  1704. partNo: this.dataForm.partNo,
  1705. partDescription: this.dataForm.partDescription,
  1706. customerID: this.dataForm.customerID,
  1707. fGPartNo: this.dataForm.fGPartNo,
  1708. supplierID: '*',
  1709. }
  1710. getReferenceData(inData).then(({data}) => {
  1711. if (data.success) {
  1712. if (data.rows.length > 0) {
  1713. this.dataForm.referenceSupplierID = data.rows[0].SupplierID;
  1714. this.dataForm.referencePartDesc = data.rows[0].PartDescription;
  1715. this.dataForm.referenceSupplierName = data.rows[0].SupplierDesc;
  1716. }
  1717. }
  1718. })
  1719. },
  1720. },
  1721. created() {
  1722. }
  1723. }
  1724. </script>
  1725. <style>
  1726. .el-textarea__inner {
  1727. padding: 5px 5px;
  1728. }
  1729. </style>