clothes-list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. <template>
  2. <!-- 装箱单-成衣 -->
  3. <div id="clothesList">
  4. <!-- 查询 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <!-- <a-col :md="6" :sm="8">
  10. <a-form-item label="单据号">
  11. <a-input placeholder="请输入订单号" v-model="queryParam.documentNo"></a-input>
  12. </a-form-item>
  13. </a-col> -->
  14. <a-col :md="6" :sm="8">
  15. <a-form-item label="订单号">
  16. <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="8">
  20. <a-form-item label="款号">
  21. <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
  22. </a-form-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-item label="分销点">
  26. <!-- <a-input placeholder="请输入分销点" v-model="queryParam.distributionPoint"></a-input> -->
  27. <j-search-select-tag
  28. placeholder="请选择分销点"
  29. v-model="queryParam.distributionPoint"
  30. dict="view_distributionpoint,distributionpoint,distributionpoint">
  31. </j-search-select-tag>
  32. </a-form-item>
  33. </a-col>
  34. <template v-if="toggleSearchStatus">
  35. <!-- <a-col :md="6" :sm="8">
  36. <a-form-item label="托书号">
  37. <a-input placeholder="请输入托书号" v-model="queryParam.shippingOrderNumber"></a-input>
  38. </a-form-item>
  39. </a-col> -->
  40. <!-- <a-col :md="6" :sm="8">
  41. <a-form-item label="品名">
  42. <a-input placeholder="请输入品名" v-model="queryParam.productName"></a-input>
  43. </a-form-item>
  44. </a-col> -->
  45. <a-col :md="6" :sm="8">
  46. <a-form-item label="小po">
  47. <a-input placeholder="请输入小po" v-model="queryParam.smallPo"></a-input>
  48. </a-form-item>
  49. </a-col>
  50. <a-col :md="6" :sm="8">
  51. <a-form-item label="预托书号">
  52. <a-input placeholder="请输入预托书号" v-model="queryParam.depositaryReceiptNo"></a-input>
  53. </a-form-item>
  54. </a-col>
  55. <a-col :md="6" :sm="8">
  56. <a-form-item label="供应商">
  57. <!-- <a-input placeholder="请输入供应商" v-model="queryParam.garmentFactory"></a-input> -->
  58. <j-search-select-tag
  59. placeholder="请选择供应商"
  60. v-model="queryParam.garmentFactory"
  61. dict="view_supplier,supplier,supplier">
  62. </j-search-select-tag>
  63. </a-form-item>
  64. </a-col>
  65. <a-col :md="6" :sm="8">
  66. <a-form-item label="预发货日期">
  67. <a-range-picker
  68. :placeholder="['开始时间', '结束时间']"
  69. format="YYYY-MM-DD"
  70. style="width: 100%"
  71. v-model="preDeliveryDate"
  72. @change="onDateChange"
  73. />
  74. </a-form-item>
  75. </a-col>
  76. </template>
  77. <a-col :md="6" :sm="8">
  78. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  79. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  80. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  81. <a @click="handleToggleSearch" style="margin-left: 8px">
  82. {{ toggleSearchStatus ? '收起' : '展开' }}
  83. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  84. </a>
  85. </span>
  86. </a-col>
  87. </a-row>
  88. </a-form>
  89. </div>
  90. </a-card>
  91. <!-- 操作按钮区域 推送 导入 新增-->
  92. <a-card :bordered="false" style="marginTop:10px;">
  93. <div class="table-operator">
  94. <a-button type="primary" @click="openClothesAdd" icon="plus">新增</a-button>
  95. <a-button type="primary" @click="push" icon="export">推送</a-button>
  96. <a-button type="primary" @click="bitchSubmit" icon="check">批量提交</a-button>
  97. <a-button type="primary" @click="bitchCanelSubmit" icon="close">批量取消提交</a-button>
  98. <!-- <a-button type="primary" icon="download" @click="handleExportXls('装箱单-成衣')">装箱单成衣导出</a-button> -->
  99. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel" >
  100. <a-button type="primary" icon="import">导入-来源预装箱单</a-button>
  101. </a-upload>
  102. </div>
  103. <!-- table rowKey="id"-->
  104. <a-table
  105. bordered
  106. :columns="clothesListColumns"
  107. :data-source="clothesListData"
  108. :loading="loading"
  109. :pagination="pagination"
  110. :row-key="record => record.id"
  111. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  112. @change="handleTableChange"
  113. :scroll="{ x: 1500, y: 500 }"
  114. >
  115. <!-- 集装箱号 输入框-->
  116. <!-- <a-form-model
  117. slot="containerNo"
  118. slot-scope="text, record"
  119. :ref="record.index"
  120. :model="record"
  121. style="width:100%;height:40px"
  122. >
  123. <a-form-model-item prop="containerNo">
  124. <a-input style="width:100%" v-model="record.containerNo" />
  125. </a-form-model-item>
  126. </a-form-model> -->
  127. <!-- 预托书号 -->
  128. <!-- <a-form-model
  129. slot="preBookNum"
  130. slot-scope="text, record"
  131. :ref="record.index"
  132. :model="record"
  133. style="width:100%;height:40px"
  134. >
  135. <a-form-model-item prop="preBookNum">
  136. <a-input style="width:100%" v-model="record.preBookNum" readOnly/>
  137. </a-form-model-item>
  138. </a-form-model> -->
  139. <!-- 状态 -->
  140. <!-- slot-scope="text, record" -->
  141. <span slot="stateSlot" slot-scope="text, record">
  142. <!-- v-if="record.isRelease == '0'" -->
  143. <a-tag color="orange" v-if="record.status == '0' || record.status == null">未提交</a-tag>
  144. <a-tag color="green" v-if="record.status == '1'">已提交</a-tag>
  145. <!-- <a-tag color="#87d068" v-else>已提交</a-tag> -->
  146. </span>
  147. <!-- 推送状态 -->
  148. <span slot="pushState" slot-scope="text, record" :title ="record.cause">
  149. <!-- v-if="record.isRelease == '0'" -->
  150. <a-tag color="#f50" :title="record.cause">保存</a-tag>
  151. <!-- <a-tag color="#87d068" v-else>已提交</a-tag> -->
  152. </span>
  153. <!-- 单据状态 -->
  154. <!-- <span slot="documentState"> -->
  155. <!-- v-if="record.isRelease == '0'" -->
  156. <!-- <a-tag color="#f50">提交</a-tag> -->
  157. <!-- <a-tag color="#87d068" v-else>已提交</a-tag> -->
  158. <!-- </span> -->
  159. <!-- 操作 -->
  160. <span slot="operationSlot" slot-scope="text, record">
  161. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="enclosureUrl" @change="handleImportExcel" :data="{id:record.id}" >
  162. <a style="color:green;" >附件上传</a>
  163. </a-upload>
  164. <a-divider type="vertical" />
  165. <!-- 未提交 -->
  166. <a-dropdown>
  167. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  168. <a-menu slot="overlay" v-if="record.status == '0' || record.status == null">
  169. <!-- <a-menu-item><a @click="submit(record)">提交</a></a-menu-item> -->
  170. <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
  171. <a-menu-item><a @click="edit(record)">编辑</a></a-menu-item>
  172. <!-- <a-menu-item><a @click="itemXls(record)">导出</a></a-menu-item> -->
  173. <a-menu-item>
  174. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
  175. <a href="javascript:void(0);" style="color:red;">删除</a>
  176. </a-popconfirm>
  177. </a-menu-item>
  178. </a-menu>
  179. <!-- 已提交 -->
  180. <a-menu slot="overlay" v-if="record.status == '1'">
  181. <a-menu-item>
  182. <a @click="details(record)">详情</a>
  183. </a-menu-item>
  184. <!-- <a-menu-item><a @click="itemXls(record)">导出</a></a-menu-item> -->
  185. <!-- <a-menu-item>
  186. <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
  187. <a href="javascript:void(0);" style="color:red;">取消提交</a>
  188. </a-popconfirm>
  189. </a-menu-item> -->
  190. <!-- <a-menu-item>
  191. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  192. <a href="javascript:void(0);" style="color:green;">推送</a>
  193. </a-popconfirm>
  194. </a-menu-item> -->
  195. </a-menu>
  196. </a-dropdown>
  197. </span>
  198. </a-table>
  199. </a-card>
  200. <!-- 子表 -->
  201. <!-- 抽屉 -->
  202. <div>
  203. <clothesAdd-drawer ref="clothesAddDrawer" :fatherList="getSpltList" @ok="modalFormOk"></clothesAdd-drawer>
  204. <detailsClothes-drawer ref="detailsClothesDrawer" :father="bb" @ok="modalFormOk"></detailsClothes-drawer>
  205. <!-- <editClothes-drawer ref="editClothesDrawer" :father="cc" @ok="modalFormOk"></editClothes-drawer> -->
  206. </div>
  207. </div>
  208. </template>
  209. <script>
  210. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  211. import { downFile } from '@/api/manage'
  212. import JEllipsis from '@/components/jeecg/JEllipsis'
  213. import clothesAddDrawer from '@views/packing-list/packinglist-clothes/clothesAddDrawer.vue'
  214. import detailsClothesDrawer from '@views/packing-list/packinglist-clothes/detailsClothesDrawer.vue'
  215. import editClothesDrawer from '@views/packing-list/packinglist-clothes/editClothesDrawer.vue'
  216. import { spltList,deleteSpltList,spltListId,SubmitList,cancelSubmitList,bitchSubmitList,bitchCancelSubmitList} from '@api/document/packing-list/packinglist-clothes'
  217. export default {
  218. name: 'ClothesList', // 装箱单-成衣
  219. mixins: [JeecgListMixin],
  220. components: { JEllipsis, clothesAddDrawer, detailsClothesDrawer, editClothesDrawer },
  221. data() {
  222. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  223. return {
  224. // 表头
  225. clothesListColumns: [
  226. {
  227. title: '预托书号',
  228. dataIndex: 'depositaryReceiptNo',
  229. width: 160,
  230. ellipsis: true,
  231. // scopedSlots: { customRender: 'preBookNum' },
  232. className: 'replacecolor'
  233. },
  234. {
  235. title: '托书号',
  236. dataIndex: 'shippingOrderNumber',
  237. width: 120,
  238. ellipsis: true,
  239. className: 'replacecolor'
  240. },
  241. {
  242. title: '集装箱代号',
  243. dataIndex: 'containerCode',
  244. width: 120,
  245. ellipsis: true,
  246. className: 'replacecolor'
  247. },
  248. {
  249. title: '集装箱号',
  250. dataIndex: 'containerNumber',
  251. width: 140,
  252. ellipsis: true,
  253. // scopedSlots: { customRender: 'containerNo' },
  254. className: 'replacecolor'
  255. },
  256. {
  257. title: '单据号',
  258. dataIndex: 'documentNo',
  259. width: 120,
  260. ellipsis: true,
  261. className: 'replacecolor'
  262. },
  263. {
  264. title: '订单号',
  265. dataIndex: 'orderNumber',
  266. width: 220,
  267. ellipsis: true,
  268. // fixed: 'left',
  269. className: 'replacecolor'
  270. },
  271. {
  272. title: '款号',
  273. ellipsis: true,
  274. dataIndex: 'itemNumber',
  275. width: 120,
  276. // fixed: 'left',
  277. className: 'replacecolor'
  278. },
  279. {
  280. title: '客户简称',
  281. dataIndex: 'customerAbbreviation',
  282. width: 120,
  283. ellipsis: true,
  284. // fixed: 'left',
  285. className: 'replacecolor'
  286. },
  287. {
  288. title: '预发货日期',
  289. dataIndex: 'hod',
  290. width: 120,
  291. ellipsis: true,
  292. className: 'replacecolor'
  293. },
  294. {
  295. title: '小po',
  296. dataIndex: 'smallPo',
  297. width: 120,
  298. ellipsis: true,
  299. className: 'replacecolor'
  300. },
  301. {
  302. title: '分销点',
  303. dataIndex: 'distributionPoint',
  304. width: 120,
  305. ellipsis: true,
  306. className: 'replacecolor'
  307. },
  308. {
  309. title: '数量(按合并规则累计)',
  310. dataIndex: 'total',
  311. width: 200,
  312. ellipsis: true,
  313. className: 'replacecolor'
  314. },
  315. {
  316. title: '箱数',
  317. dataIndex: 'totalBoxes',
  318. width: 90,
  319. ellipsis: true,
  320. className: 'replacecolor'
  321. },
  322. {
  323. title: '总净重',
  324. dataIndex: 'totalNetWeight',
  325. width: 120,
  326. ellipsis: true,
  327. className: 'replacecolor'
  328. },
  329. {
  330. title: '总毛重',
  331. dataIndex: 'totalGrossWeight',
  332. width: 120,
  333. ellipsis: true,
  334. className: 'replacecolor'
  335. },
  336. {
  337. title: '总体积',
  338. dataIndex: 'totalVolume',
  339. width: 120,
  340. ellipsis: true,
  341. className: 'replacecolor'
  342. },
  343. // {
  344. // title: '存货名称',
  345. // dataIndex: 'inventoryName',
  346. // width: 120,
  347. // className: 'replacecolor'
  348. // },
  349. // {
  350. // title: '颜色',
  351. // dataIndex: 'colour',
  352. // width: 120,
  353. // className: 'replacecolor'
  354. // },
  355. {
  356. title: '采购/委外订单号',
  357. dataIndex: 'purchase',
  358. width: 160,
  359. ellipsis: true,
  360. className: 'replacecolor'
  361. },
  362. {
  363. title: '成衣工厂',
  364. dataIndex: 'garmentFactory',
  365. width: 140,
  366. ellipsis: true,
  367. customRender: t => ellipsis(t),
  368. className: 'replacecolor'
  369. },
  370. // {
  371. // title: '订单类型',
  372. // dataIndex: 'orderType',
  373. // width: 120,
  374. // className: 'replacecolor'
  375. // },
  376. // {
  377. // title: '工厂单价',
  378. // dataIndex: 'factoryUnitPrice',
  379. // width: 120,
  380. // className: 'replacecolor'
  381. // },
  382. // {
  383. // title: '总价',
  384. // dataIndex: 'totalPrice',
  385. // width: 120,
  386. // className: 'replacecolor'
  387. // },
  388. {
  389. title: '推送状态',
  390. dataIndex: 'pushState',
  391. width: 90,
  392. scopedSlots: { customRender: 'pushState' },
  393. className: 'replacecolor'
  394. },
  395. // {
  396. // title: '单据状态',
  397. // dataIndex: 'theDocumentsState',
  398. // width: 90,
  399. // scopedSlots: { customRender: 'documentState' },
  400. // className: 'replacecolor'
  401. // },
  402. // {
  403. // title: '原因',
  404. // dataIndex: 'cause',
  405. // width: 180,
  406. // customRender: t => ellipsis(t),
  407. // className: 'replacecolor'
  408. // },
  409. {
  410. title: '是否云工厂推送',
  411. dataIndex: 'whetherCloudFactoryPush ',
  412. width: 90,
  413. // scopedSlots: { customRender: 'isPushCloudfactory' },
  414. className: 'replacecolor'
  415. },
  416. {
  417. title: '外销发票号',
  418. dataIndex: 'exportInvoiceNo',
  419. width: 120,
  420. ellipsis: true,
  421. className: 'replacecolor'
  422. },
  423. {
  424. title: '单据状态',
  425. dataIndex: 'status',
  426. width: 80,
  427. // fixed: 'right',
  428. scopedSlots: { customRender: 'stateSlot' },
  429. className: 'replacecolor'
  430. },
  431. {
  432. title: '操作',
  433. dataIndex: 'operation',
  434. scopedSlots: { customRender: 'operationSlot' },
  435. width: 160,
  436. fixed: 'right',
  437. className: 'replacecolor'
  438. }
  439. ],
  440. clothesListData: [],
  441. selectedRowKeys: [], // 勾选航
  442. loading: false, // 表格加载
  443. // 查询条件
  444. queryParam: {
  445. pageNo: '' // 初始页
  446. },
  447. preDeliveryDate:[],
  448. pagination: {
  449. // pageSize:20
  450. // total: '',
  451. // current: 0,
  452. // pageSize: 0
  453. },
  454. url: {
  455. // syncUser: '/act/process/extActProcess/doSyncUser',
  456. list: '/sys/user/list',
  457. // delete: '/sys/user/delete',
  458. // deleteBatch: '/sys/user/deleteBatch',
  459. exportXlsUrl: '/sys/user/exportXls', // 导出
  460. importExcelUrl: '/splt/syPackingListTailoring/importExcel3' ,// 导入
  461. enclosureUrl:'splt/syPackingListTailoring/upload' //附件上传
  462. }
  463. }
  464. },
  465. created() {
  466. this.getSpltList()
  467. },
  468. methods: {
  469. //分页查询
  470. getSpltList() {
  471. var that = this;
  472. this.$nextTick(() => {
  473. this.queryParam.pageSize=20
  474. spltList(this.queryParam).then(res => {
  475. if (res.success) {
  476. that.clothesListData = res.result.records;
  477. that.clothesListData.map(item => {
  478. var str =item.hod
  479. var n=str.split(" ");
  480. item.hod = n[0]
  481. })
  482. that.pagination = {
  483. total: res.result.total,
  484. current: res.result.current,
  485. pageSize: res.result.size
  486. }
  487. }else{
  488. that.$message.error(res.message);
  489. }
  490. })
  491. })
  492. },
  493. // 查询按钮
  494. searchQuery() {
  495. this.toggleSearchStatus = false
  496. this.queryParam.pageNo = ''
  497. this.getSpltList()
  498. },
  499. searchReset() {
  500. // console.log('>>>>重置')
  501. this.queryParam = {}
  502. this.preDeliveryDate = []
  503. this.getSpltList()
  504. },
  505. // 推送
  506. push() {},
  507. //批量提交
  508. bitchSubmit(){
  509. for(var i =0;i<this.selectedRows.length;i++){
  510. var tickRow = this.selectedRows[i]
  511. if(tickRow.status === '1'){
  512. this.$message.error("部分数据是已提交,请勿重复提交!");
  513. return
  514. }
  515. }
  516. var ids = this.selectedRowKeys.toString()
  517. bitchSubmitList({ids : ids}).then(res =>{
  518. if (res.success) {
  519. this.getSpltList()
  520. this.selectedRowKeys = []
  521. this.$message.success('提交成功');
  522. }else{
  523. this.$message.error(res.message);
  524. }
  525. })
  526. },
  527. //批量取消提交
  528. bitchCanelSubmit(){
  529. for(var i =0;i<this.selectedRows.length;i++){
  530. var tickRow = this.selectedRows[i]
  531. if(tickRow.status === '0'){
  532. this.$message.error("含未提交数据,请重新选择!");
  533. return
  534. }
  535. }
  536. var ids = this.selectedRowKeys.toString()
  537. bitchCancelSubmitList({ids : ids}).then(res =>{
  538. if (res.success) {
  539. this.getSpltList()
  540. this.selectedRowKeys = []
  541. this.$message.success('取消提交成功');
  542. }else{
  543. this.$message.error(res.message);
  544. }
  545. })
  546. },
  547. // 导入
  548. importData() {},
  549. // 新增
  550. openClothesAdd() {
  551. console.log('新增-装箱单 成衣')
  552. this.$refs.clothesAddDrawer.visible = true
  553. },
  554. // --------------------------------------
  555. // 操作 附件上传
  556. accessoryUpload() {},
  557. // 列表导出
  558. handleExportXls(fileName) {
  559. downFile('/splt/syPackingListTailoring/exportXls',this.queryParam).then(data => {
  560. if (!data) {
  561. this.$message.warning('文件下载失败')
  562. return
  563. }
  564. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  565. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  566. } else {
  567. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  568. let link = document.createElement('a')
  569. link.style.display = 'none'
  570. link.href = url
  571. link.setAttribute('download', fileName + '.xls')
  572. document.body.appendChild(link)
  573. link.click()
  574. document.body.removeChild(link) // 下载完成移除元素
  575. window.URL.revokeObjectURL(url) // 释放掉blob对象
  576. }
  577. })
  578. },
  579. // 操作 单条数据导出
  580. itemXls(record) {
  581. downFile('/splt/syPackingListTailoring/exportXls',{id:record.id}).then(data => {
  582. if (!data) {
  583. this.$message.warning('文件下载失败')
  584. return
  585. }
  586. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  587. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), item + '.xlsx')
  588. }else {
  589. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  590. let link = document.createElement('a')
  591. link.style.display = 'none'
  592. link.href = url
  593. link.setAttribute('download', '装箱单' + '.xlsx')
  594. document.body.appendChild(link)
  595. link.click()
  596. document.body.removeChild(link) // 下载完成移除元素
  597. window.URL.revokeObjectURL(url) // 释放掉blob对象
  598. }
  599. })
  600. },
  601. // 操作 提交
  602. submit(record) {
  603. SubmitList({id:record.id}).then(res =>{
  604. if (res.success) {
  605. record.status=1;
  606. this.$message.success('提交成功');
  607. }else{
  608. this.$message.error(res.message);
  609. }
  610. })
  611. },
  612. //操作 取消提交
  613. cancelSubmit(record){
  614. cancelSubmitList({id:record.id}).then(res =>{
  615. if (res.success) {
  616. record.status=0;
  617. this.$message.success('取消提交成功');
  618. }else{
  619. this.$message.error(res.message);
  620. }
  621. })
  622. },
  623. // 操作 详情
  624. details(record) {
  625. spltListId({id:record.id}).then(res => {
  626. if (res.success) {
  627. var editData = res.result
  628. this.$refs.detailsClothesDrawer.visible = true
  629. this.$refs.detailsClothesDrawer.editDecide = 'edit';
  630. this.$refs.detailsClothesDrawer.dynamicColumns(editData.sizeTables)
  631. this.$refs.detailsClothesDrawer.clothesAdd = {
  632. orderNum:editData.orderNumber,
  633. styleNum:editData.itemNumber,
  634. name:editData.productName,
  635. englishProductName:editData.englishProductName,
  636. sizeRange:editData.sizeRange,
  637. customer:editData.customer,
  638. containerCode:editData.containerCode,
  639. containerNo:editData.containerNumber,
  640. note:editData.u8Remarks,
  641. clothesFactory:editData.garmentFactory,
  642. exportInvoiceNo:editData.exportInvoiceNo,
  643. bookNum:editData.shippingOrderNumber,
  644. id:editData.id,
  645. totalBoxes:editData.totalBoxes,
  646. totalGrossWeight:editData.totalGrossWeight,
  647. totalNetWeight:editData.totalNetWeight,
  648. totalVolume:editData.totalVolume,
  649. totalPrice:editData.totalPrice,
  650. depositaryReceiptNo:editData.depositaryReceiptNo,
  651. total:editData.total,
  652. };
  653. this.$refs.detailsClothesDrawer.accessory = (editData.accessory!=='' && editData.accessory) ? (editData.accessory.split(",")) :''
  654. this.$refs.detailsClothesDrawer.clothesAddData = editData.syPackingListTailoringItemList
  655. for (var i=0; i<res.result.syPackingListTailoringItemList.length;i++){
  656. var row = res.result.syPackingListTailoringItemList[i];
  657. var sizeTables = row.sizeTables;
  658. for (var j=0; j<sizeTables.length;j++){
  659. row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
  660. }
  661. }
  662. }
  663. })
  664. },
  665. // 操作 编辑
  666. edit(record) {
  667. console.log('编辑')
  668. spltListId({id:record.id}).then(res => {
  669. if (res.success) {
  670. var editData = res.result
  671. this.$refs.clothesAddDrawer.visible = true
  672. this.$refs.clothesAddDrawer.editDecide = 'edit';
  673. this.$refs.clothesAddDrawer.dynamicColumns(editData.sizeTables)
  674. this.$refs.clothesAddDrawer.clothesAdd = {
  675. orderNum:editData.orderNumber,
  676. styleNum:editData.itemNumber,
  677. name:editData.productName,
  678. englishProductName:editData.englishProductName,
  679. sizeRange:editData.sizeRange,
  680. customer:editData.customer,
  681. containerCode:editData.containerCode,
  682. containerNo:editData.containerNumber,
  683. note:editData.u8Remarks,
  684. clothesFactory:editData.garmentFactory,
  685. exportInvoiceNo:editData.exportInvoiceNo,
  686. bookNum:editData.shippingOrderNumber,
  687. id:editData.id,
  688. totalBoxes:editData.totalBoxes,
  689. totalGrossWeight:editData.totalGrossWeight,
  690. totalNetWeight:editData.totalNetWeight,
  691. totalVolume:editData.totalVolume,
  692. totalPrice:editData.totalPrice,
  693. depositaryReceiptNo:editData.depositaryReceiptNo,
  694. total:editData.total
  695. };
  696. this.$refs.clothesAddDrawer.clothesAddData = editData.syPackingListTailoringItemList
  697. for (var i=0; i<res.result.syPackingListTailoringItemList.length;i++){
  698. var row = res.result.syPackingListTailoringItemList[i];
  699. var sizeTables = row.sizeTables;
  700. for (var j=0; j<sizeTables.length;j++){
  701. row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
  702. }
  703. }
  704. }
  705. })
  706. },
  707. // 操作 删除
  708. handleDelete(record) {
  709. console.log('点击删除项id:', record)
  710. this.$nextTick(() => {
  711. if(this.queryParam.pageNo > 1 && this.clothesListData.length === 1){
  712. this.queryParam.pageNo = this.queryParam.pageNo -1
  713. }
  714. deleteSpltList({ id: record }).then(res => {
  715. if (res.success) {
  716. this.getSpltList()
  717. this.$message.success('删除成功')
  718. } else {
  719. this.$message.error('删除成功')
  720. }
  721. })
  722. })
  723. },
  724. onDateChange(value, dateString) {
  725. this.queryParam.stratDate = dateString[0]
  726. this.queryParam.endDate = dateString[1]
  727. },
  728. // --------------------------------------
  729. // ??
  730. modalFormOk() {},
  731. // 选中行
  732. onSelectChange(keys, rows) {
  733. this.selectedRowKeys = keys
  734. this.selectedRows = rows
  735. },
  736. // --------------------------------------
  737. aa() {},
  738. bb() {},
  739. cc() {},
  740. // 分页、排序、筛选变化时触发
  741. handleTableChange(pagination, filters, sorter) {
  742. // console.log('当前页信息>>>>',pagination)
  743. this.queryParam.pageNo = pagination.current
  744. this.getSpltList()
  745. }
  746. },
  747. computed: {
  748. // 导入
  749. importExcelUrl: function() {
  750. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  751. },
  752. // 导入
  753. enclosureUrl: function() {
  754. return `${window._CONFIG['domianURL']}/${this.url.enclosureUrl}`
  755. },
  756. // 选中项
  757. rowSelection() {
  758. return {
  759. onChange: (selectedRowKeys, selectedRows) => {
  760. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  761. },
  762. getCheckboxProps: record => ({
  763. props: {
  764. disabled: record.title === 'Disabled User',
  765. // Column configuration not to be checked
  766. title: record.title
  767. }
  768. })
  769. }
  770. }
  771. },
  772. mounted() {}
  773. }
  774. </script>
  775. <style lang="less" scoped>
  776. @import '~@assets/less/common.less';
  777. @import '~@assets/less/overwriter.less';
  778. /deep/ .ant-table-thead > tr > th {
  779. text-align: center;
  780. // font-weight: 700;
  781. }
  782. /deep/ .ant-table-tbody {
  783. text-align: center;
  784. }
  785. // /deep/ th.replacecolor {
  786. // background-color: #ccc;
  787. // }
  788. </style>