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.

1140 lines
37 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  5. <el-form-item :label="'申请单号'">
  6. <el-input v-model="searchData.notifyNo" style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'申请账号'">
  9. <el-input v-model="searchData.userName" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'申请单日期'">
  12. <el-date-picker
  13. style="width: 120px"
  14. v-model="searchData.startDate"
  15. type="date"
  16. value-format="yyyy-MM-dd"
  17. placeholder="选择日期">
  18. </el-date-picker>
  19. </el-form-item>
  20. <el-form-item style="margin-top: 23px;">
  21. <label style="margin-left: 0px;font-size: 19px">&#10142</label>
  22. </el-form-item>
  23. <el-form-item :label="' '">
  24. <el-date-picker
  25. style="width: 120px"
  26. v-model="searchData.endDate"
  27. type="date"
  28. value-format="yyyy-MM-dd"
  29. placeholder="选择日期">
  30. </el-date-picker>
  31. </el-form-item>
  32. <el-form-item label="是否领料" >
  33. <el-select v-model="searchData.issueFlag" placeholder="请选择" style="width: 120px">
  34. <el-option label="全部" value=""></el-option>
  35. <el-option label="Y" value="Y"></el-option>
  36. <el-option label="N" value="N"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item label="领料结果" >
  40. <el-select v-model="searchData.issueResult" placeholder="请选择" style="width: 120px">
  41. <el-option label="全部" value=""></el-option>
  42. <el-option label="部分发料" value="部分发料"></el-option>
  43. <el-option label="全部发料" value="全部发料"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item :label="' '">
  47. <el-button type="primary" @click="searchTable()">查询</el-button>
  48. <download-excel
  49. :fields="fields()"
  50. :data="exportData"
  51. type="xls"
  52. :name="exportName"
  53. :header="exportHeader"
  54. :footer="exportFooter"
  55. :fetch="createExportData"
  56. :before-generate="startDownload"
  57. :before-finish="finishDownload"
  58. worksheet="导出信息"
  59. class="el-button el-button--primary el-button--medium">
  60. {{ '导出' }}
  61. </download-excel>
  62. </el-form-item>
  63. </el-form>
  64. </el-form>
  65. <el-table
  66. :data="dataList"
  67. @row-click="changeData"
  68. :height="height"
  69. border
  70. highlight-current-row
  71. ref="mainTable"
  72. v-loading="dataListLoading"
  73. style="width: 100%; ">
  74. <el-table-column
  75. v-for="(item,index) in columnList1" :key="index"
  76. :sortable="item.columnSortable"
  77. :prop="item.columnProp"
  78. :header-align="item.headerAlign"
  79. :show-overflow-tooltip="item.showOverflowTooltip"
  80. :align="item.align"
  81. :fixed="item.fixed==''?false:item.fixed"
  82. :min-width="item.columnWidth"
  83. :label="item.columnLabel">
  84. <template slot-scope="scope">
  85. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  86. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  87. style="width: 100px; height: 80px"/></span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column
  91. header-align="center"
  92. align="center"
  93. width="80"
  94. fixed="left"
  95. label="操作">
  96. <template slot-scope="scope">
  97. <a type="text" size="small" v-if="scope.row.status==='已下达'" @click="closeNotify(scope.row)">结束</a>
  98. <a type="text" size="small" v-if="scope.row.status==='已关闭'" @click="openNotify(scope.row)">打开</a>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. <el-pagination
  103. @size-change="sizeChangeHandle"
  104. @current-change="currentChangeHandle"
  105. :current-page="pageIndex"
  106. :page-sizes="[20, 50, 100, 1000]"
  107. :page-size="pageSize"
  108. :total="totalPage"
  109. layout="total, sizes, prev, pager, next, jumper">
  110. </el-pagination>
  111. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  112. <el-tab-pane label="派工单明细" name="detail">
  113. <el-table
  114. :data="dataList2"
  115. :height="height"
  116. border
  117. v-loading="dataListLoading"
  118. style="width: 100%; ">
  119. <el-table-column
  120. v-for="(item,index) in columnList2" :key="index"
  121. :sortable="item.columnSortable"
  122. :prop="item.columnProp"
  123. :header-align="item.headerAlign"
  124. :show-overflow-tooltip="item.showOverflowTooltip"
  125. :align="item.align"
  126. :fixed="item.fixed==''?false:item.fixed"
  127. :min-width="item.columnWidth"
  128. :label="item.columnLabel">
  129. <template slot-scope="scope">
  130. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  131. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  132. style="width: 100px; height: 80px"/></span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column
  136. header-align="center"
  137. align="center"
  138. width="80"
  139. fixed="left"
  140. label="操作">
  141. <template slot-scope="scope">
  142. <a type="text" size="small" v-if="currentRow.status==='已下达'" @click="deleteNotifySOSPlus(scope.row)">删除</a>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. </el-tab-pane>
  147. <el-tab-pane label="材料明细" name="sub">
  148. <el-table
  149. :data="dataList3"
  150. :height="height"
  151. border
  152. v-loading="dataListLoading"
  153. style="width: 100%; ">
  154. <!-- <el-table-column-->
  155. <!-- header-align="center"-->
  156. <!-- align="center"-->
  157. <!-- width="80"-->
  158. <!-- fixed="left"-->
  159. <!-- label="操作">-->
  160. <!-- <template slot-scope="scope">-->
  161. <!-- <a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>-->
  162. <!-- </template>-->
  163. <!-- </el-table-column>-->
  164. <el-table-column
  165. v-for="(item,index) in columnList3" :key="index"
  166. :sortable="item.columnSortable"
  167. :prop="item.columnProp"
  168. :header-align="item.headerAlign"
  169. :show-overflow-tooltip="item.showOverflowTooltip"
  170. :align="item.align"
  171. :fixed="item.fixed==''?false:item.fixed"
  172. :min-width="item.columnWidth"
  173. :label="item.columnLabel">
  174. <template slot-scope="scope">
  175. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  176. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  177. style="width: 100px; height: 80px"/></span>
  178. </template>
  179. </el-table-column>
  180. <el-table-column
  181. header-align="center"
  182. align="center"
  183. width="80"
  184. fixed="left"
  185. label="操作">
  186. <template slot-scope="scope">
  187. <a type="text" size="small" v-if="currentRow.status==='已下达'" @click="deleteNotifyMaterial(scope.row)">删除</a>
  188. </template>
  189. </el-table-column>
  190. </el-table>
  191. </el-tab-pane>
  192. <el-tab-pane label="材料汇总" name="sum">
  193. <el-table
  194. :data="dataList4"
  195. :height="height"
  196. border
  197. v-loading="dataListLoading"
  198. style="width: 100%; ">
  199. <!-- <el-table-column-->
  200. <!-- header-align="center"-->
  201. <!-- align="center"-->
  202. <!-- width="80"-->
  203. <!-- fixed="left"-->
  204. <!-- label="操作">-->
  205. <!-- <template slot-scope="scope">-->
  206. <!-- <a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>-->
  207. <!-- </template>-->
  208. <!-- </el-table-column>-->
  209. <el-table-column
  210. v-for="(item,index) in columnList4" :key="index"
  211. :sortable="item.columnSortable"
  212. :prop="item.columnProp"
  213. :header-align="item.headerAlign"
  214. :show-overflow-tooltip="item.showOverflowTooltip"
  215. :align="item.align"
  216. :fixed="item.fixed==''?false:item.fixed"
  217. :min-width="item.columnWidth"
  218. :label="item.columnLabel">
  219. <template slot-scope="scope">
  220. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  221. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  222. style="width: 100px; height: 80px"/></span>
  223. </template>
  224. </el-table-column>
  225. </el-table>
  226. </el-tab-pane>
  227. </el-tabs>
  228. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  229. </div>
  230. </template>
  231. <script>
  232. import {
  233. searchNotifyHeader
  234. ,searchNotifyOrderList
  235. ,searchNotifyMaterialList
  236. ,searchSumNotifyMaterialList
  237. ,deleteNotifySOSPlus
  238. ,updateNotifyStatus
  239. ,deleteNotifyMaterial
  240. }from "@/api/orderIssure/soIssueNotify.js"
  241. import Chooselist from '@/views/modules/common/Chooselist'
  242. export default {
  243. components: {
  244. Chooselist
  245. },
  246. data() {
  247. return {
  248. height:200,
  249. modelFlag:false,
  250. activeName: 'detail',
  251. dataList: [],
  252. dataList2: [],
  253. dataList3: [],
  254. dataList4: [],
  255. addOrUpdateVisible:false,
  256. searchData: {
  257. page: 1,
  258. limit: 100,
  259. site:this.$store.state.user.site,
  260. userName: '',
  261. notifyNo: '',
  262. issueFlag: '',
  263. issueResult: '',
  264. startDate: this.dayjs().format("YYYY-MM-DD"),
  265. endDate: this.dayjs().format("YYYY-MM-DD"),
  266. sql: " and a.status!='已计划' ",
  267. },
  268. exportList:[],
  269. pageIndex: 1,
  270. pageSize: 100,
  271. totalPage: 0,
  272. dataListLoading: false,
  273. currentRow:'',
  274. headerData:'',
  275. columnList1:[
  276. {
  277. userId: this.$store.state.user.name,
  278. functionId: 701002,
  279. serialNumber: '701002Table1NotifyNo',
  280. tableId: "701002Table1",
  281. tableName: "领料申请主表",
  282. columnProp: "notifyNo",
  283. headerAlign: "center",
  284. align: "center",
  285. columnLabel: "申请单单号",
  286. columnHidden: false,
  287. columnImage: false,
  288. columnSortable: false,
  289. sortLv: 0,
  290. status: true,
  291. fixed: '',
  292. columnWidth: 100
  293. },{
  294. userId: this.$store.state.user.name,
  295. functionId: 701002,
  296. serialNumber: '701002Table1NotifyDate',
  297. tableId: "701002Table1",
  298. tableName: "领料申请主表",
  299. columnProp: "notifyDate",
  300. headerAlign: "center",
  301. align: "center",
  302. columnLabel: "申请日期",
  303. columnHidden: false,
  304. columnImage: false,
  305. columnSortable: false,
  306. sortLv: 0,
  307. status: true,
  308. fixed: '',
  309. columnWidth: 100
  310. },{
  311. userId: this.$store.state.user.name,
  312. functionId: 701002,
  313. serialNumber: '701002Table1UserName',
  314. tableId: "701002Table1",
  315. tableName: "领料申请主表",
  316. columnProp: "userName",
  317. headerAlign: "center",
  318. align: "left",
  319. columnLabel: "申请账号",
  320. columnHidden: false,
  321. columnImage: false,
  322. columnSortable: false,
  323. sortLv: 0,
  324. status: true,
  325. fixed: '',
  326. columnWidth: 100
  327. },{
  328. userId: this.$store.state.user.name,
  329. functionId: 701002,
  330. serialNumber: '701002Table1UserName',
  331. tableId: "701002Table1",
  332. tableName: "领料申请主表",
  333. columnProp: "userDisplay",
  334. headerAlign: "center",
  335. align: "left",
  336. columnLabel: "申请人姓名",
  337. columnHidden: false,
  338. columnImage: false,
  339. columnSortable: false,
  340. sortLv: 0,
  341. status: true,
  342. fixed: '',
  343. columnWidth: 100
  344. },{
  345. userId: this.$store.state.user.name,
  346. functionId: 701002,
  347. serialNumber: '701002Table1IssueFlag',
  348. tableId: "701002Table1",
  349. tableName: "领料申请主表",
  350. columnProp: "issueFlag",
  351. headerAlign: "center",
  352. align: "center",
  353. columnLabel: "是否领料",
  354. columnHidden: false,
  355. columnImage: false,
  356. columnSortable: false,
  357. sortLv: 0,
  358. status: true,
  359. fixed: '',
  360. columnWidth: 60
  361. },{
  362. userId: this.$store.state.user.name,
  363. functionId: 701002,
  364. serialNumber: '701002Table1IssueResult',
  365. tableId: "701002Table1",
  366. tableName: "领料申请主表",
  367. columnProp: "issueResult",
  368. headerAlign: "center",
  369. align: "left",
  370. columnLabel: "领料结果",
  371. columnHidden: false,
  372. columnImage: false,
  373. columnSortable: false,
  374. sortLv: 0,
  375. status: true,
  376. fixed: '',
  377. columnWidth: 120
  378. // },{
  379. // userId: this.$store.state.user.name,
  380. // functionId: 701002,
  381. // serialNumber: '701002Table1PlanIssueDate',
  382. // tableId: "701002Table1",
  383. // tableName: "领料申请主表",
  384. // columnProp: "planIssueDate",
  385. // headerAlign: "center",
  386. // align: "left",
  387. // columnLabel: "计划领料日期",
  388. // columnHidden: false,
  389. // columnImage: false,
  390. // columnSortable: false,
  391. // sortLv: 0,
  392. // status: true,
  393. // fixed: '',
  394. // columnWidth: 100
  395. // },{
  396. // userId: this.$store.state.user.name,
  397. // functionId: 701002,
  398. // serialNumber: '701002Table1RealIssueDate',
  399. // tableId: "701002Table1",
  400. // tableName: "领料申请主表",
  401. // columnProp: "realIssueDate",
  402. // headerAlign: "center",
  403. // align: "left",
  404. // columnLabel: "实际领料日期",
  405. // columnHidden: false,
  406. // columnImage: false,
  407. // columnSortable: false,
  408. // sortLv: 0,
  409. // status: true,
  410. // fixed: '',
  411. // columnWidth: 100
  412. },{
  413. userId: this.$store.state.user.name,
  414. functionId: 701002,
  415. serialNumber: '701002Table1Status',
  416. tableId: "701002Table1",
  417. tableName: "领料申请主表",
  418. columnProp: "status",
  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: 80
  429. },{
  430. userId: this.$store.state.user.name,
  431. functionId: 701002,
  432. serialNumber: '701002Table1Remark',
  433. tableId: "701002Table1",
  434. tableName: "领料申请主表",
  435. columnProp: "remark",
  436. headerAlign: "center",
  437. align: "left",
  438. columnLabel: "备注",
  439. columnHidden: false,
  440. columnImage: false,
  441. columnSortable: false,
  442. sortLv: 0,
  443. status: true,
  444. fixed: '',
  445. columnWidth: 200
  446. },
  447. ],
  448. columnList2:[
  449. {
  450. userId: this.$store.state.user.name,
  451. functionId: 701002,
  452. serialNumber: '701002Table2ItemNo',
  453. tableId: "701002Table2",
  454. tableName: "申请单派工单明细表",
  455. columnProp: "itemNo",
  456. headerAlign: "center",
  457. align: "right",
  458. columnLabel: "序号",
  459. columnHidden: false,
  460. columnImage: false,
  461. columnSortable: false,
  462. sortLv: 0,
  463. status: true,
  464. fixed: '',
  465. columnWidth: 40
  466. },{
  467. userId: this.$store.state.user.name,
  468. functionId: 701002,
  469. serialNumber: '701002Table2SOOrderNo',
  470. tableId: "701002Table2",
  471. tableName: "申请单派工单明细表",
  472. columnProp: "sOOrderNo",
  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. userId: this.$store.state.user.name,
  485. functionId: 701002,
  486. serialNumber: '701002Table2OpsItemNo',
  487. tableId: "701002Table2",
  488. tableName: "申请单派工单明细表",
  489. columnProp: "opsItemNo",
  490. headerAlign: "center",
  491. align: "right",
  492. columnLabel: "工序",
  493. columnHidden: false,
  494. columnImage: false,
  495. columnSortable: false,
  496. sortLv: 0,
  497. status: true,
  498. fixed: '',
  499. columnWidth: 50
  500. },{
  501. userId: this.$store.state.user.name,
  502. functionId: 701002,
  503. serialNumber: '701002Table2ItemDesc',
  504. tableId: "701002Table2",
  505. tableName: "申请单派工单明细表",
  506. columnProp: "itemDesc",
  507. headerAlign: "center",
  508. align: "left",
  509. columnLabel: "工序名称",
  510. columnHidden: false,
  511. columnImage: false,
  512. columnSortable: false,
  513. sortLv: 0,
  514. status: true,
  515. fixed: '',
  516. columnWidth: 120
  517. },{
  518. userId: this.$store.state.user.name,
  519. functionId: 701002,
  520. serialNumber: '701002Table2SeqNo',
  521. tableId: "701002Table2",
  522. tableName: "申请单派工单明细表",
  523. columnProp: "seqNo",
  524. headerAlign: "center",
  525. align: "left",
  526. columnLabel: "派工单号",
  527. columnHidden: false,
  528. columnImage: false,
  529. columnSortable: false,
  530. sortLv: 0,
  531. status: true,
  532. fixed: '',
  533. columnWidth: 150
  534. }, {
  535. userId: this.$store.state.user.name,
  536. functionId: 701002,
  537. serialNumber: '701002Table2FGPartNo',
  538. tableId: "701002Table2",
  539. tableName: "申请单派工单明细表",
  540. columnProp: "fGPartNo",
  541. headerAlign: "center",
  542. align: "left",
  543. columnLabel: "派工单物料",
  544. columnHidden: false,
  545. columnImage: false,
  546. columnSortable: false,
  547. sortLv: 0,
  548. status: true,
  549. fixed: '',
  550. columnWidth: 80
  551. }, {
  552. userId: this.$store.state.user.name,
  553. functionId: 701002,
  554. serialNumber: '701002Table2PartDesc',
  555. tableId: "701002Table2",
  556. tableName: "申请单派工单明细表",
  557. columnProp: "partDesc",
  558. headerAlign: "center",
  559. align: "left",
  560. columnLabel: "物料名称",
  561. columnHidden: false,
  562. columnImage: false,
  563. columnSortable: false,
  564. sortLv: 0,
  565. status: true,
  566. fixed: '',
  567. columnWidth: 200
  568. },
  569. {
  570. userId: this.$store.state.user.name,
  571. functionId: 701002,
  572. serialNumber: '701002Table2LocationNo',
  573. tableId: "701002Table2",
  574. tableName: "领料申请派工单子表",
  575. columnProp: 'locationNo',
  576. headerAlign: "center",
  577. align: "left",
  578. columnLabel: '库位编码',
  579. columnHidden: false,
  580. columnImage: false,
  581. columnSortable: false,
  582. sortLv: 0,
  583. status: true,
  584. fixed: '',
  585. columnWidth: 80,
  586. },
  587. {
  588. userId: this.$store.state.user.name,
  589. functionId: 701002,
  590. serialNumber: '701002Table2NeedDate',
  591. tableId: "701002Table2",
  592. tableName: "领料申请派工单子表",
  593. columnProp: 'needDate',
  594. headerAlign: "center",
  595. align: "left",
  596. columnLabel: '要求发料时间',
  597. columnHidden: false,
  598. columnImage: false,
  599. columnSortable: false,
  600. sortLv: 0,
  601. status: true,
  602. fixed: '',
  603. columnWidth: 80,
  604. },
  605. {
  606. userId: this.$store.state.user.name,
  607. functionId: 701002,
  608. serialNumber: '701002Table2IssureQty',
  609. tableId: "701002Table2",
  610. tableName: "申请单派工单明细表",
  611. columnProp: "issureQty",
  612. headerAlign: "center",
  613. align: "right",
  614. columnLabel: "发料数量",
  615. columnHidden: false,
  616. columnImage: false,
  617. columnSortable: false,
  618. sortLv: 0,
  619. status: true,
  620. fixed: '',
  621. columnWidth: 80
  622. },
  623. ],
  624. columnList3:[
  625. {
  626. userId: this.$store.state.user.name,
  627. functionId: 701002,
  628. serialNumber: '701002Table3ItemNo',
  629. tableId: "701002Table3",
  630. tableName: "申请单材料明细表",
  631. columnProp: "itemNo",
  632. headerAlign: "center",
  633. align: "right",
  634. columnLabel: "申请单序号",
  635. columnHidden: false,
  636. columnImage: false,
  637. columnSortable: false,
  638. sortLv: 0,
  639. status: true,
  640. fixed: '',
  641. columnWidth: 80
  642. },{
  643. userId: this.$store.state.user.name,
  644. functionId: 701002,
  645. serialNumber: '701002Table3SOOrderNo',
  646. tableId: "701002Table3",
  647. tableName: "申请单材料明细表",
  648. columnProp: "orderNo",
  649. headerAlign: "center",
  650. align: "left",
  651. columnLabel: "生产订单",
  652. columnHidden: false,
  653. columnImage: false,
  654. columnSortable: false,
  655. sortLv: 0,
  656. status: true,
  657. fixed: '',
  658. columnWidth: 120
  659. },{
  660. userId: this.$store.state.user.name,
  661. functionId: 701002,
  662. serialNumber: '701002Table3OpsItemNo',
  663. tableId: "701002Table3",
  664. tableName: "申请单材料明细表",
  665. columnProp: "opsItemNo",
  666. headerAlign: "center",
  667. align: "right",
  668. columnLabel: "工序",
  669. columnHidden: false,
  670. columnImage: false,
  671. columnSortable: false,
  672. sortLv: 0,
  673. status: true,
  674. fixed: '',
  675. columnWidth: 50
  676. },{
  677. userId: this.$store.state.user.name,
  678. functionId: 701002,
  679. serialNumber: '701002Table3SeqNo',
  680. tableId: "701002Table3",
  681. tableName: "申请单材料明细表",
  682. columnProp: "seqNo",
  683. headerAlign: "center",
  684. align: "left",
  685. columnLabel: "派工单号",
  686. columnHidden: false,
  687. columnImage: false,
  688. columnSortable: false,
  689. sortLv: 0,
  690. status: true,
  691. fixed: '',
  692. columnWidth: 150
  693. },{
  694. userId: this.$store.state.user.name,
  695. functionId: 701002,
  696. serialNumber: '701002Table3BOMItemNo',
  697. tableId: "701002Table3",
  698. tableName: "申请单材料明细表",
  699. columnProp: "bOMItemNo",
  700. headerAlign: "center",
  701. align: "right",
  702. columnLabel: "BOM序号",
  703. columnHidden: false,
  704. columnImage: false,
  705. columnSortable: false,
  706. sortLv: 0,
  707. status: true,
  708. fixed: '',
  709. columnWidth: 80
  710. },{
  711. userId: this.$store.state.user.name,
  712. functionId: 701002,
  713. serialNumber: '701002Table3ComponentPartNo',
  714. tableId: "701002Table3",
  715. tableName: "申请单材料明细表",
  716. columnProp: "componentPartNo",
  717. headerAlign: "center",
  718. align: "center",
  719. columnLabel: "材料编码",
  720. columnHidden: false,
  721. columnImage: false,
  722. columnSortable: false,
  723. sortLv: 0,
  724. status: true,
  725. fixed: '',
  726. columnWidth: 100
  727. },{
  728. userId: this.$store.state.user.name,
  729. functionId: 701002,
  730. serialNumber: '701002Table3PartDesc',
  731. tableId: "701002Table3",
  732. tableName: "申请单材料明细表",
  733. columnProp: "partDesc",
  734. headerAlign: "center",
  735. align: "left",
  736. columnLabel: "材料名称",
  737. columnHidden: false,
  738. columnImage: false,
  739. columnSortable: false,
  740. sortLv: 0,
  741. status: true,
  742. fixed: '',
  743. columnWidth: 130
  744. },{
  745. userId: this.$store.state.user.name,
  746. functionId: 701002,
  747. serialNumber: '701002Table3QtyToIssue',
  748. tableId: "701002Table3",
  749. tableName: "申请单材料明细表",
  750. columnProp: "qtyToIssue",
  751. headerAlign: "center",
  752. align: "right",
  753. columnLabel: "申请数量",
  754. columnHidden: false,
  755. columnImage: false,
  756. columnSortable: false,
  757. sortLv: 0,
  758. status: true,
  759. fixed: '',
  760. columnWidth: 80
  761. },{
  762. userId: this.$store.state.user.name,
  763. functionId: 701002,
  764. serialNumber: '701002Table3QtyToIssueOriginal',
  765. tableId: "701002Table3",
  766. tableName: "申请单材料明细表",
  767. columnProp: "qtyToIssueOriginal",
  768. headerAlign: "center",
  769. align: "right",
  770. columnLabel: "已发数量",
  771. columnHidden: false,
  772. columnImage: false,
  773. columnSortable: false,
  774. sortLv: 0,
  775. status: true,
  776. fixed: '',
  777. columnWidth: 80
  778. },
  779. ],
  780. columnList4:[
  781. {
  782. userId: this.$store.state.user.name,
  783. functionId: 701002,
  784. serialNumber: '701002Table3ComponentPartNo',
  785. tableId: "701002Table4",
  786. tableName: "申请单材料明细表",
  787. columnProp: "componentPartNo",
  788. headerAlign: "center",
  789. align: "center",
  790. columnLabel: "材料编码",
  791. columnHidden: false,
  792. columnImage: false,
  793. columnSortable: false,
  794. sortLv: 0,
  795. status: true,
  796. fixed: '',
  797. columnWidth: 100
  798. },{
  799. userId: this.$store.state.user.name,
  800. functionId: 701002,
  801. serialNumber: '701002Table3PartDesc',
  802. tableId: "701002Table4",
  803. tableName: "申请单材料明细表",
  804. columnProp: "partDesc",
  805. headerAlign: "center",
  806. align: "left",
  807. columnLabel: "材料名称",
  808. columnHidden: false,
  809. columnImage: false,
  810. columnSortable: false,
  811. sortLv: 0,
  812. status: true,
  813. fixed: '',
  814. columnWidth: 130
  815. },{
  816. userId: this.$store.state.user.name,
  817. functionId: 701002,
  818. serialNumber: '701002Table3QtyToIssue',
  819. tableId: "701002Table4",
  820. tableName: "申请单材料明细表",
  821. columnProp: "qtyToIssue",
  822. headerAlign: "center",
  823. align: "right",
  824. columnLabel: "合计申请数量",
  825. columnHidden: false,
  826. columnImage: false,
  827. columnSortable: false,
  828. sortLv: 0,
  829. status: true,
  830. fixed: '',
  831. columnWidth: 80
  832. },{
  833. userId: this.$store.state.user.name,
  834. functionId: 701002,
  835. serialNumber: '701002Table3QtyToIssueOriginal',
  836. tableId: "701002Table4",
  837. tableName: "申请单材料明细表",
  838. columnProp: "qtyToIssueOriginal",
  839. headerAlign: "center",
  840. align: "right",
  841. columnLabel: "合计已发数量",
  842. columnHidden: false,
  843. columnImage: false,
  844. columnSortable: false,
  845. sortLv: 0,
  846. status: true,
  847. fixed: '',
  848. columnWidth: 80
  849. },
  850. ],
  851. dataRole: {
  852. partTypeDesc: [
  853. {
  854. required: true,
  855. message: ' ',
  856. trigger: 'change'
  857. }
  858. ],
  859. partName: [
  860. {
  861. required: true,
  862. message: ' ',
  863. trigger: 'change'
  864. }
  865. ],
  866. },
  867. // 导出 start
  868. exportData: [],
  869. exportName: '发料申请单'+this.dayjs().format('YYYYMMDDHHmmss'),
  870. exportHeader: ["发料申请单"],
  871. exportFooter: [],
  872. // 导出 end
  873. }
  874. },
  875. mounted () {
  876. this.$nextTick(() => {
  877. this.height = (window.innerHeight- 260) / 2
  878. })
  879. },
  880. // watch: {
  881. // searchData: {
  882. // deep: true,
  883. // handler: function (newV, oldV) {
  884. // this.searchData.partNo = this.searchData.partNo.toUpperCase()
  885. // }
  886. // },
  887. // },
  888. methods: {
  889. // 获取基础数据列表S
  890. getBaseList (val, type) {
  891. this.tagNo = val
  892. this.tagNo1 = type
  893. this.$nextTick(() => {
  894. let strVal = ''
  895. if (val === 1013) {
  896. if(type==23) {
  897. strVal = this.modelData.supplierId
  898. }
  899. }
  900. this.$refs.baseList.init(val, strVal)
  901. })
  902. },
  903. /* 列表方法的回调 */
  904. getBaseData (val) {
  905. if (this.tagNo === 23) {
  906. if(this.tagNo1==1) {
  907. this.modelData.supplierId = val.SupplierID
  908. this.modelData.supplierName = val.SupplierName
  909. }
  910. }
  911. },
  912. // 每页数
  913. sizeChangeHandle (val) {
  914. this.pageSize = val
  915. this.pageIndex = 1
  916. this.searchTable()
  917. },
  918. // 当前页
  919. currentChangeHandle (val) {
  920. this.pageIndex = val
  921. this.searchTable()
  922. },
  923. tabClick (tab, event) {
  924. // 刷新列表数据
  925. this.refreshCurrentTabTable()
  926. },
  927. changeData(row){
  928. this.currentRow = JSON.parse(JSON.stringify(row));
  929. this.headerData=row;
  930. this.refreshCurrentTabTable ();
  931. },
  932. refreshCurrentTabTable(){
  933. if(this.currentRow===''||this.currentRow===null){
  934. this.currentRow={site:'',notifyNo:''}
  935. }
  936. if(this.activeName==='detail'){
  937. searchNotifyOrderList(this.currentRow).then(({data}) => {
  938. //区分请求成功和失败的状况
  939. if (data && data.code == 0) {
  940. this.dataList2 = data.rows
  941. } else {
  942. this.dataList2 = [];
  943. }
  944. });
  945. }else if(this.activeName==='sub'){
  946. searchNotifyMaterialList(this.currentRow).then(({data}) => {
  947. //区分请求成功和失败的状况
  948. if (data && data.code == 0) {
  949. this.dataList3 = data.rows
  950. } else {
  951. this.dataList3 = [];
  952. }
  953. });
  954. }else {
  955. searchSumNotifyMaterialList(this.currentRow).then(({data}) => {
  956. //区分请求成功和失败的状况
  957. if (data && data.code == 0) {
  958. this.dataList4 = data.rows
  959. } else {
  960. this.dataList4 = [];
  961. }
  962. });
  963. }
  964. },
  965. searchTable(){
  966. this.searchData.limit = this.pageSize
  967. this.searchData.page = this.pageIndex
  968. searchNotifyHeader(this.searchData).then(({data}) => {
  969. //区分请求成功和失败的状况
  970. if (data && data.code == 0) {
  971. this.dataList = data.page.list
  972. this.pageIndex = data.page.currPage
  973. this.pageSize = data.page.pageSize
  974. this.totalPage = data.page.totalCount
  975. if(this.dataList.length>0){
  976. this.$refs.mainTable.setCurrentRow(this.dataList[0]);
  977. this.changeData(this.dataList[0])
  978. }else {
  979. this.changeData(null)
  980. }
  981. } else {
  982. this.dataList = [];
  983. }
  984. });
  985. },
  986. closeNotify(row){
  987. this.$confirm('确认关闭?', '提示', {
  988. confirmButtonText: '确定',
  989. cancelButtonText: '取消',
  990. type: 'warning'
  991. }).then(() => {
  992. let inData={
  993. site:row.site,
  994. notifyNo:row.notifyNo,
  995. status:'已关闭',
  996. }
  997. updateNotifyStatus(inData).then(({data}) => {
  998. if (data && data.code === 0) {
  999. this.searchTable()
  1000. this.$message({
  1001. message: '操作成功',
  1002. type: 'success',
  1003. duration: 1500,
  1004. onClose: () => {}
  1005. })
  1006. } else {
  1007. this.$alert(data.msg, '错误', {
  1008. confirmButtonText: '确定'
  1009. })
  1010. }
  1011. })
  1012. })
  1013. },
  1014. openNotify(row){
  1015. this.$confirm('确认打开?', '提示', {
  1016. confirmButtonText: '确定',
  1017. cancelButtonText: '取消',
  1018. type: 'warning'
  1019. }).then(() => {
  1020. let inData={
  1021. site:row.site,
  1022. notifyNo:row.notifyNo,
  1023. status:'已下达',
  1024. }
  1025. updateNotifyStatus(inData).then(({data}) => {
  1026. if (data && data.code === 0) {
  1027. this.searchTable()
  1028. this.$message({
  1029. message: '操作成功',
  1030. type: 'success',
  1031. duration: 1500,
  1032. onClose: () => {}
  1033. })
  1034. } else {
  1035. this.$alert(data.msg, '错误', {
  1036. confirmButtonText: '确定'
  1037. })
  1038. }
  1039. })
  1040. })
  1041. },
  1042. deleteNotifyMaterial(row){
  1043. this.$confirm('确认删除?', '提示', {
  1044. confirmButtonText: '确定',
  1045. cancelButtonText: '取消',
  1046. type: 'warning'
  1047. }).then(() => {
  1048. deleteNotifyMaterial(row).then(({data}) => {
  1049. if (data && data.code === 0) {
  1050. this.refreshCurrentTabTable()
  1051. this.$message({
  1052. message: '操作成功',
  1053. type: 'success',
  1054. duration: 1500,
  1055. onClose: () => {}
  1056. })
  1057. } else {
  1058. this.$alert(data.msg, '错误', {
  1059. confirmButtonText: '确定'
  1060. })
  1061. }
  1062. })
  1063. })
  1064. },
  1065. deleteNotifySOSPlus(row){
  1066. this.$confirm('确认删除?', '提示', {
  1067. confirmButtonText: '确定',
  1068. cancelButtonText: '取消',
  1069. type: 'warning'
  1070. }).then(() => {
  1071. deleteNotifySOSPlus(row).then(({data}) => {
  1072. if (data && data.code === 0) {
  1073. this.refreshCurrentTabTable()
  1074. this.$message({
  1075. message: '操作成功',
  1076. type: 'success',
  1077. duration: 1500,
  1078. onClose: () => {}
  1079. })
  1080. } else {
  1081. this.$alert(data.msg, '错误', {
  1082. confirmButtonText: '确定'
  1083. })
  1084. }
  1085. })
  1086. })
  1087. },
  1088. //导出excel
  1089. //导出excel
  1090. async createExportData() {
  1091. this.searchData.limit = -1
  1092. this.searchData.page = 1
  1093. await searchNotifyHeader(this.searchData).then(({data}) => {
  1094. this.exportList= data.page.list;
  1095. })
  1096. return this.exportList;
  1097. },
  1098. startDownload() {
  1099. // this.exportData = this.dataList
  1100. },
  1101. finishDownload() {
  1102. },
  1103. fields() {
  1104. let json = "{"
  1105. this.columnList1.forEach((item, index) => {
  1106. if (index == this.columnList1.length - 1) {
  1107. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1108. } else {
  1109. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1110. }
  1111. })
  1112. json += "}"
  1113. let s = eval("(" + json + ")")
  1114. return s
  1115. },
  1116. },
  1117. }
  1118. </script>
  1119. <style scoped>
  1120. </style>