adPaList-clothes.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  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: 90,
  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.syPreAssembledPackingListItemList[0].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.syPreAssembledPackingListItemList[0].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. for(var i =0;i<this.selectedRows.length;i++){
  949. var tickRow = this.selectedRows[i]
  950. var clo = i+1
  951. if(tickRow.status == '0'){
  952. this.$message.error("勾选的第"+clo+"行数据未提交,不能推送!");
  953. return
  954. }
  955. if(tickRow.status === '1' && tickRow.pushStatus === '1'){
  956. this.$message.error("勾选的第"+clo+"行数据是已推送!");
  957. return
  958. }
  959. }
  960. var ids = this.selectedRowKeys.toString()
  961. batchPush({ id: ids }).then(res => {
  962. if (res.success) {
  963. this.selectedRows.map(item=>{
  964. item.pushStatus = 1
  965. })
  966. this.$message.success('批量推送成功');
  967. }else {
  968. this.$message.error(res.message);
  969. this.selectedRows.map(item=>{
  970. item.pushStatus = 2
  971. })
  972. this.$message.error(res.message);
  973. }
  974. })
  975. this.selectedRowKeys = []
  976. })
  977. },
  978. //批量删除
  979. majorityDelet(){
  980. var ids = this.selectedRowKeys.toString()
  981. deleteBatch({ ids: ids }).then(res => {
  982. if (res.success) {
  983. this.$message.success('批量删除成功');
  984. this.getadPaListClothes()
  985. }else {
  986. this.$message.error(res.message);
  987. }
  988. })
  989. this.selectedRowKeys = []
  990. },
  991. //推送
  992. push(record){
  993. this.$nextTick(() => {
  994. push({ id: record.id }).then(res => {
  995. if (res.success) {
  996. record.pushStatus=1;
  997. this.$message.success('推送成功');
  998. }else{
  999. record.pushStatus = 2
  1000. this.$message.error(res.message);
  1001. }
  1002. })
  1003. })
  1004. },
  1005. // 选中行
  1006. onSelectChange(keys, rows) {
  1007. this.selectedRowKeys = keys
  1008. this.selectedRows = rows
  1009. },
  1010. handleTableChange(pagination, filters, sorter) {
  1011. // console.log('当前页信息>>>>',pagination)
  1012. this.queryParam.pageNo = pagination.current
  1013. this.queryParam.pageSize =pagination.pageSize
  1014. this.getadPaListClothes()
  1015. },
  1016. aa() {},
  1017. onDateChange(value, dateString) {
  1018. this.queryParam.startTime = dateString[0]
  1019. this.queryParam.endTime = dateString[1]
  1020. },
  1021. rangeSelectChange(value) {
  1022. this.range = value
  1023. if (value.length == 0){
  1024. this.queryParam.stratDate = "";
  1025. this.queryParam.endDate = "";
  1026. }else{
  1027. this.queryParam.stratDate = value[0].format('YYYY-MM-DD');
  1028. this.queryParam.endDate = value[1].format('YYYY-MM-DD');
  1029. }
  1030. },
  1031. createTimeChange(){
  1032. this.queryParam.createTime = this.queryParam.createTime.format('YYYY-MM-DD')
  1033. }
  1034. },
  1035. computed: {
  1036. // 导入
  1037. importExcelUrl() {
  1038. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  1039. // this.
  1040. },
  1041. // 选中项
  1042. rowSelection() {
  1043. return {
  1044. onChange: (selectedRowKeys, selectedRows) => {
  1045. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  1046. },
  1047. getCheckboxProps: record => ({
  1048. props: {
  1049. disabled: record.title === 'Disabled User',
  1050. // Column configuration not to be checked
  1051. title: record.title
  1052. }
  1053. })
  1054. }
  1055. }
  1056. }
  1057. }
  1058. </script>
  1059. <style lang="less" scoped>
  1060. @import '~@assets/less/common.less';
  1061. @import '~@assets/less/overwriter.less';
  1062. /deep/ .ant-table-thead > tr > th {
  1063. text-align: center;
  1064. // font-weight: 700;
  1065. }
  1066. /deep/ .ant-table-tbody {
  1067. text-align: center;
  1068. }
  1069. // /deep/ th.replacecolor {
  1070. // background-color: #ccc;
  1071. // }
  1072. /deep/ .ant-table-tbody .ant-table-row td{
  1073. padding-top: 8px;
  1074. padding-bottom: 8px;
  1075. }
  1076. /deep/.ant-card-body{
  1077. padding-top: 10px !important;
  1078. padding-bottom: 0px !important;
  1079. }
  1080. /deep/.table-operator .ant-btn{
  1081. margin: 0 8px 3px 0;
  1082. }
  1083. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  1084. margin-bottom: 10px;
  1085. }
  1086. /deep/.table-page-search-wrapper .table-page-search-submitButtons{
  1087. margin-bottom: 10px;
  1088. }
  1089. /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
  1090. width: min-content;
  1091. }
  1092. /deep/ thead.ant-table-thead>tr{
  1093. height: 0 !important;
  1094. }
  1095. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  1096. padding: 9px 16px
  1097. }
  1098. </style>