clothes-list.vue 37 KB

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