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.

1680 lines
56 KiB

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