clothes-list.vue 39 KB

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