clothes-list.vue 32 KB

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