clothes-list.vue 33 KB

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