clothes-list.vue 39 KB

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