adPaList-clothes.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  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="ipagination"
  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: 125,
  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. selectedRowKeys: [], // 勾选航
  522. dateFormat: 'YYYY-MM-DD',
  523. url: {
  524. list: '/sys/user/list',
  525. importExcelUrl: '/spapl/syPreAssembledPackingList/importExcel3' // 导入
  526. },
  527. }
  528. },
  529. created() {
  530. this.getadPaListClothes()
  531. },
  532. watch:{
  533. selectedRowKeys(newVal){
  534. this.selectedNumber =newVal.length
  535. }
  536. },
  537. methods: {
  538. // 分页查询 预装箱单-成衣
  539. getadPaListClothes() {
  540. console.log(this.queryParam)
  541. this.$nextTick(() => {
  542. this.loading = true
  543. getadPaList(this.queryParam).then(res => {
  544. this.loading = false
  545. if (res.success) {
  546. this.adPaListClothesData = [];
  547. if (res.result.records != null){
  548. this.adPaListClothesData = res.result.records;
  549. }
  550. this.selectedRowKeys = []
  551. this.ipagination = {
  552. total: res.result.total,
  553. current: res.result.current,
  554. pageSize: res.result.size,
  555. pageSizeOptions: ["50", "100", "150"],
  556. showSizeChanger: true,
  557. }
  558. }else{
  559. this.$message.error(res.message);
  560. }
  561. })
  562. })
  563. },
  564. // 编辑
  565. edit(record) {
  566. itemByMainId({id:record.id}).then(res => {
  567. if (res.success) {
  568. this.$refs.addAdpackingDrawer.visible = true;
  569. this.$refs.addAdpackingDrawer.editDecide = 'edit';
  570. this.$refs.addAdpackingDrawer.addAdpacking = res.result; //接口参数
  571. this.$refs.addAdpackingDrawer.addState = '0';
  572. this.$refs.addAdpackingDrawer.loadSizeTables(res.result.sizeTables);
  573. // var totalNetWeight = 0;
  574. // var totalGrossWeight = 0;
  575. // var totalVolume = 0;
  576. // var totalPrice = 0;
  577. // var total = 0;
  578. for (var i=0; i<res.result.syPreAssembledPackingListItemList.length;i++){
  579. var row = res.result.syPreAssembledPackingListItemList[i];
  580. var sizeTables = row.sizeTables;
  581. for (var j=0; j<sizeTables.length;j++){
  582. row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
  583. }
  584. // totalNetWeight += row.totalNetWeight*1;
  585. // totalGrossWeight += row.totalGrossWeight*1;
  586. // totalVolume += row.totalVolume*1;
  587. // totalPrice += row.totalPrice*1;
  588. // total += row.total*1
  589. }
  590. // res.result.totalNetWeight = totalNetWeight;
  591. // res.result.totalGrossWeight = totalGrossWeight;
  592. // res.result.totalVolume = totalVolume;
  593. // res.result.totalPrice = totalPrice;
  594. // res.result.total = total;
  595. }else{
  596. this.$message.error(res.message);
  597. }
  598. });
  599. },
  600. // 详情
  601. details(record) {
  602. itemByMainId({id:record.id}).then(res => {
  603. if (res.success) {
  604. this.$refs.detailsAdpackingDrawer.visible = true;
  605. res.result.syPreAssembledPackingListItemList.map(item=>item.hod = moment(item.hod).format('YYYY-MM-DD'))
  606. this.$refs.detailsAdpackingDrawer.addAdpacking = res.result; //接口参数
  607. this.$refs.detailsAdpackingDrawer.loadSizeTables(res.result.sizeTables);
  608. var totalNetWeight = 0;
  609. var totalGrossWeight = 0;
  610. var totalVolume = 0;
  611. var totalPrice = 0;
  612. for (var i=0; i<res.result.syPreAssembledPackingListItemList.length;i++){
  613. var row = res.result.syPreAssembledPackingListItemList[i];
  614. var sizeTables = row.sizeTables;
  615. for (var j=0; j<sizeTables.length;j++){
  616. row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
  617. }
  618. // totalNetWeight += row.totalNetWeight*1;
  619. // totalGrossWeight += row.totalGrossWeight*1;
  620. // totalVolume += row.totalVolume*1;
  621. // totalPrice += row.totalPrice*1;
  622. }
  623. // res.result.totalNetWeight = totalNetWeight;
  624. // res.result.totalGrossWeight = totalGrossWeight;
  625. // res.result.totalVolume = totalVolume;
  626. // res.result.totalPrice = totalPrice;
  627. }else{
  628. this.$message.error(res.message);
  629. }
  630. });
  631. },
  632. // 新增
  633. addAdpacking() {
  634. this.$refs.addAdpackingDrawer.visible = true;
  635. this.$refs.addAdpackingDrawer.addState = '0';
  636. },
  637. // 列表导出
  638. handleExportXls(fileName,sta) {
  639. // const data = this.queryParam
  640. // data['status'] = sta
  641. var obj ={}
  642. if(this.selectedRowKeys.length == this.ipagination.pageSize || this.selectedRowKeys.length==this.adPaListClothesData.length){
  643. obj=this.queryParam
  644. obj.selectAll = '1'
  645. }else{
  646. var arr =[]
  647. this.adPaListClothesData.map(item=>{
  648. this.selectedRowKeys.map(e=>{
  649. if(item.id == e){
  650. arr.push(item.id)
  651. }
  652. })
  653. })
  654. obj.ids = arr.toString()
  655. obj.selectAll = '2'
  656. }
  657. downFile('/spapl/syPreAssembledPackingList/exportXls',obj).then(data => {
  658. if (!data) {
  659. this.$message.warning('文件下载失败')
  660. return
  661. }
  662. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  663. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  664. } else {
  665. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  666. let link = document.createElement('a')
  667. link.style.display = 'none'
  668. link.href = url
  669. link.setAttribute('download', fileName + '.xlsx')
  670. document.body.appendChild(link)
  671. link.click()
  672. document.body.removeChild(link) // 下载完成移除元素
  673. window.URL.revokeObjectURL(url) // 释放掉blob对象
  674. }
  675. })
  676. },
  677. // 列表导出
  678. handleExportXls1(fileName,sta) {
  679. // const data = this.queryParam
  680. var obj ={}
  681. if(this.selectedRowKeys.length == this.ipagination.pageSize || this.selectedRowKeys.length==this.adPaListClothesData.length){
  682. obj=this.queryParam
  683. obj.selectAll = '1'
  684. }else{
  685. var arr =[]
  686. this.adPaListClothesData.map(item=>{
  687. this.selectedRowKeys.map(e=>{
  688. if(item.id == e){
  689. arr.push(item.id)
  690. }
  691. })
  692. })
  693. obj.ids = arr.toString()
  694. obj.selectAll = '2'
  695. }
  696. downFile('/spapl/syPreAssembledPackingList/exportXls2',obj).then(data => {
  697. if (!data) {
  698. this.$message.warning('文件下载失败')
  699. return
  700. }
  701. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  702. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  703. } else {
  704. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  705. let link = document.createElement('a')
  706. link.style.display = 'none'
  707. link.href = url
  708. link.setAttribute('download', fileName + '.xlsx')
  709. document.body.appendChild(link)
  710. link.click()
  711. document.body.removeChild(link) // 下载完成移除元素
  712. window.URL.revokeObjectURL(url) // 释放掉blob对象
  713. }
  714. })
  715. },
  716. handleExportXls2(fileName) {
  717. // const data = this.queryParam
  718. var obj ={}
  719. if(this.selectedRowKeys.length == this.ipagination.pageSize || this.selectedRowKeys.length==this.adPaListClothesData.length){
  720. obj=this.queryParam
  721. obj.selectAll = '1'
  722. }else{
  723. var arr =[]
  724. this.adPaListClothesData.map(item=>{
  725. this.selectedRowKeys.map(e=>{
  726. if(item.id == e){
  727. arr.push(item.id)
  728. }
  729. })
  730. })
  731. obj.ids = arr.toString()
  732. obj.selectAll = '2'
  733. }
  734. downFile('/spapl/syPreAssembledPackingList/exportXls3',obj).then(data => {
  735. if (!data) {
  736. this.$message.warning('文件下载失败')
  737. return
  738. }
  739. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  740. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  741. } else {
  742. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  743. let link = document.createElement('a')
  744. link.style.display = 'none'
  745. link.href = url
  746. link.setAttribute('download', fileName + '.xlsx')
  747. document.body.appendChild(link)
  748. link.click()
  749. document.body.removeChild(link) // 下载完成移除元素
  750. window.URL.revokeObjectURL(url) // 释放掉blob对象
  751. }
  752. })
  753. },
  754. // 导入信息
  755. uploadFlie(file) {
  756. const formData = new FormData()
  757. formData.append('file',file.file)
  758. fileDetail(formData).then(res => {
  759. if (res.success) {
  760. this.visible = true
  761. this.message = res.message.split(';').filter((element) => {
  762. return element !== "";
  763. });
  764. this.file = file
  765. }else{
  766. this.loading = false
  767. this.$message.error(res.message);
  768. }
  769. })},
  770. //继续导入
  771. handleOk(){
  772. this.handleOkButton = true
  773. const formData = new FormData()
  774. formData.append('file', this.file.file)
  775. upload(formData).then(res => {
  776. this.visible = false
  777. if (res.success) {
  778. this.getadPaListClothes()
  779. this.$message.success('导入成功')
  780. this.handleOkButton = false
  781. }else{
  782. this.loading = false
  783. this.$message.error(res.message);
  784. this.handleOkButton = false
  785. }
  786. })
  787. },
  788. //取消导入
  789. handleCancel(){
  790. this.visible = false
  791. this.loading = false
  792. },
  793. // 删除
  794. handleDelete(record) {
  795. console.log('点击删除项id:', record.id)
  796. this.$nextTick(() => {
  797. if(this.queryParam.pageNo > 1 && this.adPaListClothesData.length === 1){
  798. this.queryParam.pageNo = this.queryParam.pageNo -1
  799. }
  800. deleteAdPaList({ id: record.id }).then(res => {
  801. if (res.success) {
  802. console.log('res:', res)
  803. this.getadPaListClothes()
  804. this.$message.success('删除成功')
  805. } else {
  806. this.$message.error('删除成功')
  807. }
  808. })
  809. })
  810. },
  811. searchQuery() {
  812. this.toggleSearchStatus = false
  813. this.queryParam.pageNo = ''
  814. this.getadPaListClothes()
  815. },
  816. searchReset() {
  817. this.range = []
  818. var dd = this.queryParam
  819. this.queryParam = {
  820. isReference:'0',
  821. pageSize:this.queryParam.pageSize
  822. }
  823. this.getadPaListClothes()
  824. },
  825. // 操作 单条数据导出
  826. itemXls(record,sta) {
  827. var data = sta
  828. downFile('/spapl/syPreAssembledPackingList/exportXls',{id:record.id,selectAll:data}).then(data => {
  829. if (!data) {
  830. this.$message.warning('文件下载失败')
  831. return
  832. }
  833. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  834. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), item + '.xlsx')
  835. }else {
  836. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  837. let link = document.createElement('a')
  838. link.style.display = 'none'
  839. link.href = url
  840. link.setAttribute('download', '预装箱单' + '.xlsx')
  841. document.body.appendChild(link)
  842. link.click()
  843. document.body.removeChild(link) // 下载完成移除元素
  844. window.URL.revokeObjectURL(url) // 释放掉blob对象
  845. }
  846. })
  847. },
  848. // 提交
  849. submit(record) {
  850. var that = this;
  851. this.$nextTick(() => {
  852. submit({ id: record.id }).then(res => {
  853. if (res.success) {
  854. this.adPaListClothesData.map(item =>{
  855. if(item.id == record.id){
  856. item.status = 1
  857. }
  858. })
  859. this.$forceUpdate()
  860. that.$message.success('提交成功');
  861. }else{
  862. that.$message.error(res.message);
  863. }
  864. })
  865. })
  866. },
  867. // // 取消提交
  868. // cancelSubmit(record){
  869. // var that = this;
  870. // this.$nextTick(() => {
  871. // if(record.isReference == 2){
  872. // that.$message.error('不可取消提交!');
  873. // }else {
  874. // cancelSubmit({ id: record.id }).then(res => {
  875. // if (res.success) {
  876. // record.status=0;
  877. // that.$message.success('取消提交成功');
  878. // }else{
  879. // that.$message.error(res.message);
  880. // }
  881. // })
  882. // }
  883. // })
  884. // },
  885. //批量提交
  886. batchSubmit(){
  887. this.$nextTick(() => {
  888. // for(var i =0;i<this.selectedRows.length;i++){
  889. // var tickRow = this.selectedRows[i]
  890. // if(tickRow.status === '1'){
  891. // var clo = i+1
  892. // this.$message.error("部分数据是已提交,请勿重复提交!");
  893. // return
  894. // }
  895. // }
  896. var ids = this.selectedRowKeys.toString()
  897. batchSubmit({ id: ids }).then(res => {
  898. if (res.success) {
  899. this.getadPaListClothes()
  900. this.$message.success('批量提交成功');
  901. this.selectedRowKeys = []
  902. }else {
  903. this.$message.error(res.message);
  904. }
  905. })
  906. })
  907. },
  908. //批量取消提交
  909. batchCanelSubmit(){
  910. this.$nextTick(() => {
  911. // for(var i =0;i<this.selectedRows.length;i++){
  912. // var tickRow = this.selectedRows[i]
  913. // if(tickRow.status === '0'){
  914. // this.$message.error("含有未提交数据,请重新选择!");
  915. // return
  916. // }
  917. // }
  918. var ids = this.selectedRowKeys.toString()
  919. batchCanelSubmit({ ids:ids }).then(res => {
  920. if (res.success) {
  921. this.getadPaListClothes()
  922. this.selectedRowKeys = []
  923. this.$message.success('批量取消提交成功');
  924. }else if(res.code == 111){
  925. for(var i=0;i<this.selectedRows.length;i++){
  926. if(res.result.indexOf(this.selectedRows[i].id) !== -1){
  927. this.$message.error(res.message+'(所选第'+(i+1) +'行数据)');
  928. return
  929. }
  930. }
  931. }else {
  932. this.$message.error(res.message);
  933. }
  934. })
  935. })
  936. },
  937. //批量推送
  938. batchPush(){
  939. this.$nextTick(() => {
  940. if(this.selectedRowKeys.length==0){
  941. this.$message.error("请勾选数据");
  942. }else{
  943. for(var i =0;i<this.selectedRows.length;i++){
  944. var tickRow = this.selectedRows[i]
  945. var clo = i+1
  946. if(tickRow.status == '0'){
  947. this.$message.error("勾选的第"+clo+"行数据未提交,不能推送!");
  948. return
  949. }
  950. if(tickRow.status === '1' && tickRow.pushStatus === '1'){
  951. this.$message.error("勾选的第"+clo+"行数据是已推送!");
  952. return
  953. }
  954. }
  955. var ids = this.selectedRowKeys.toString()
  956. batchPush({ id: ids }).then(res => {
  957. if (res.success) {
  958. this.selectedRows.map(item=>{
  959. item.pushStatus = 1
  960. })
  961. this.$message.success('批量推送成功');
  962. }else {
  963. this.$message.error(res.message);
  964. this.selectedRows.map(item=>{
  965. item.pushStatus = 2
  966. })
  967. this.$message.error(res.message);
  968. }
  969. })
  970. this.selectedRowKeys = []
  971. }
  972. })
  973. },
  974. //批量删除
  975. majorityDelet(){
  976. var ids = this.selectedRowKeys.toString()
  977. deleteBatch({ ids: ids }).then(res => {
  978. if (res.success) {
  979. this.$message.success('批量删除成功');
  980. this.getadPaListClothes()
  981. }else {
  982. this.$message.error(res.message);
  983. }
  984. })
  985. this.selectedRowKeys = []
  986. },
  987. //推送
  988. push(record){
  989. this.$nextTick(() => {
  990. push({ id: record.id }).then(res => {
  991. if (res.success) {
  992. record.pushStatus=1;
  993. this.$message.success('推送成功');
  994. }else{
  995. record.pushStatus = 2
  996. this.$message.error(res.message);
  997. }
  998. })
  999. })
  1000. },
  1001. // 选中行
  1002. onSelectChange(keys, rows) {
  1003. this.selectedRowKeys = keys
  1004. this.selectedRows = rows
  1005. },
  1006. handleTableChange(pagination, filters, sorter) {
  1007. // console.log('当前页信息>>>>',pagination)
  1008. this.queryParam.pageNo = pagination.current
  1009. this.queryParam.pageSize =pagination.pageSize
  1010. this.getadPaListClothes()
  1011. },
  1012. aa() {},
  1013. onDateChange(value, dateString) {
  1014. this.queryParam.startTime = dateString[0]
  1015. this.queryParam.endTime = dateString[1]
  1016. },
  1017. rangeSelectChange(value) {
  1018. this.range = value
  1019. if (value.length == 0){
  1020. this.queryParam.stratDate = "";
  1021. this.queryParam.endDate = "";
  1022. }else{
  1023. this.queryParam.stratDate = value[0].format('YYYY-MM-DD');
  1024. this.queryParam.endDate = value[1].format('YYYY-MM-DD');
  1025. }
  1026. },
  1027. createTimeChange(){
  1028. this.queryParam.createTime = this.queryParam.createTime.format('YYYY-MM-DD')
  1029. }
  1030. },
  1031. computed: {
  1032. // 导入
  1033. importExcelUrl() {
  1034. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  1035. // this.
  1036. },
  1037. // 选中项
  1038. rowSelection() {
  1039. return {
  1040. onChange: (selectedRowKeys, selectedRows) => {
  1041. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  1042. },
  1043. getCheckboxProps: record => ({
  1044. props: {
  1045. disabled: record.title === 'Disabled User',
  1046. // Column configuration not to be checked
  1047. title: record.title
  1048. }
  1049. })
  1050. }
  1051. }
  1052. }
  1053. }
  1054. </script>
  1055. <style lang="less" scoped>
  1056. @import '~@assets/less/common.less';
  1057. @import '~@assets/less/overwriter.less';
  1058. /deep/ .ant-table-thead > tr > th {
  1059. text-align: center;
  1060. // font-weight: 700;
  1061. }
  1062. /deep/ .ant-table-tbody {
  1063. text-align: center;
  1064. }
  1065. // /deep/ th.replacecolor {
  1066. // background-color: #ccc;
  1067. // }
  1068. /deep/ .ant-table-tbody .ant-table-row td{
  1069. padding-top: 8px;
  1070. padding-bottom: 8px;
  1071. }
  1072. /deep/.ant-card-body{
  1073. padding-top: 10px !important;
  1074. padding-bottom: 0px !important;
  1075. }
  1076. /deep/.table-operator .ant-btn{
  1077. margin: 0 8px 3px 0;
  1078. }
  1079. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  1080. margin-bottom: 10px;
  1081. }
  1082. /deep/.table-page-search-wrapper .table-page-search-submitButtons{
  1083. margin-bottom: 10px;
  1084. }
  1085. /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
  1086. width: min-content;
  1087. }
  1088. /deep/ thead.ant-table-thead>tr{
  1089. height: 0 !important;
  1090. }
  1091. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  1092. padding: 9px 16px
  1093. }
  1094. </style>