clothes-list.vue 34 KB

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