adPaList-clothes.vue 39 KB

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