adPaList-clothes.vue 37 KB

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