adPaList-clothes.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  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. <template v-if="toggleSearchStatus">
  25. <!-- <a-col :md="6" :sm="8">
  26. <a-form-item label="单据日期">
  27. <a-range-picker
  28. style="width: 100%"
  29. v-model="timeRange"
  30. format="YYYY-MM-DD"
  31. :placeholder="['开始日期', '结束日期']"
  32. @change="onDateChange"
  33. @ok="onDateOk"
  34. />
  35. </a-form-item>
  36. </a-col> -->
  37. <a-col :md="6" :sm="8">
  38. <a-form-item label="品名">
  39. <a-input placeholder="请输入品名" v-model="queryParam.productName"></a-input>
  40. </a-form-item>
  41. </a-col>
  42. <a-col :md="6" :sm="8">
  43. <a-form-item label="小po">
  44. <a-input placeholder="请输入小po" v-model="queryParam.smallPo"></a-input>
  45. </a-form-item>
  46. </a-col>
  47. <a-col :md="6" :sm="8">
  48. <a-form-item label="分销点">
  49. <a-input placeholder="请输入分销点" v-model="queryParam.distributionPoint"></a-input>
  50. </a-form-item>
  51. </a-col>
  52. <a-col :md="6" :sm="8">
  53. <a-form-item label="预发货日期">
  54. <a-range-picker
  55. style="width: 100%"
  56. :mode="rangeMode"
  57. :placeholder="['开始日期', '结束日期']"
  58. :value="range"
  59. format = "YYYY-MM-DD"
  60. @change="rangeSelectChange"
  61. />
  62. </a-form-item>
  63. </a-col>
  64. </template>
  65. <a-col :md="6" :sm="8">
  66. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  67. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  68. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  69. <a @click="handleToggleSearch" style="margin-left: 8px">
  70. {{ toggleSearchStatus ? '收起' : '展开' }}
  71. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  72. </a>
  73. </span>
  74. </a-col>
  75. </a-row>
  76. </a-form>
  77. </div>
  78. </a-card>
  79. <!-- 操作按钮区域 导出 导入 新增-->
  80. <a-card :bordered="false" style="margin:10px 0">
  81. <div class="table-operator">
  82. <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣')">导出</a-button>
  83. <a-upload
  84. productName="file"
  85. :showUploadList="false"
  86. :multiple="false"
  87. :headers="tokenHeader"
  88. :action="importExcelUrl"
  89. @change="handleImportExcel"
  90. >
  91. <a-button type="primary" icon="import">导入</a-button>
  92. </a-upload>
  93. <a-button type="primary" @click="addAdpacking" icon="plus">新增</a-button>
  94. <a-button type="primary" @click="batchSubmit" icon="plus">批量提交</a-button>
  95. <a-button type="primary" @click="batchPush" icon="plus">批量推送</a-button>
  96. </div>
  97. <!-- table rowKey="id" -->
  98. <a-table
  99. bordered
  100. :columns="adPaListClothesColumns"
  101. :data-source="adPaListClothesData"
  102. :loading="loading"
  103. :pagination="pagination"
  104. :row-key="record => record.id"
  105. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  106. @change="handleTableChange"
  107. :scroll="{ x: 1500 }"
  108. >
  109. <!-- 推送状态 -->
  110. <span slot="pushStatesSlot" slot-scope="text, record">
  111. <a-tag color="#2db7f5" v-if="record.pushStatus == '0' || record.pushStatus == null ">未推送</a-tag>
  112. <a-tag color="#87d068" v-if="record.pushStatus == '1'">推送成功</a-tag>
  113. <a-tag color="#f50" v-if="record.pushStatus == '2'">推送失败</a-tag>
  114. </span>
  115. <!-- 单据状态 -->
  116. <span slot="statusSlot" slot-scope="text, record">
  117. <a-tag color="orange" v-if="record.status == '0' || record.status == null">未提交</a-tag>
  118. <a-tag color="green" v-if="record.status == '1'">已提交</a-tag>
  119. </span>
  120. <!-- 操作 默认按钮 未提交未推送-->
  121. <span slot="operationSlot" slot-scope="text, record">
  122. <a href="javascript:void(0);" @click="itemXls('')" style="color:green">导出</a>
  123. <a-divider type="vertical" />
  124. <a-dropdown>
  125. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  126. <!-- 已保存 -->
  127. <a-menu slot="overlay" v-if="record.status == '0' || record.status == null">
  128. <a-menu-item>
  129. <a @click="details(record)">详情</a>
  130. </a-menu-item>
  131. <a-menu-item>
  132. <a @click="edit(record)">编辑</a>
  133. </a-menu-item>
  134. <a-menu-item>
  135. <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
  136. <a href="javascript:void(0);" style="color:green;">提交</a>
  137. </a-popconfirm>
  138. </a-menu-item>
  139. <a-menu-item>
  140. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
  141. <a href="javascript:void(0);" style="color:red;">删除</a>
  142. </a-popconfirm>
  143. </a-menu-item>
  144. </a-menu>
  145. <!-- 已提交 且 推送成功 -->
  146. <a-menu slot="overlay" v-if="record.pushStatus == '1' && record.status == '1'">
  147. <a-menu-item>
  148. <a @click="details(record)">详情</a>
  149. </a-menu-item>
  150. </a-menu>
  151. <!-- 已提交 且 推送失败 -->
  152. <a-menu slot="overlay" v-if="record.pushStatus == '2' && record.status == '1'">
  153. <a-menu-item>
  154. <a @click="details(record)">详情</a>
  155. </a-menu-item>
  156. <a-menu-item>
  157. <a-popconfirm title="确定重新推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  158. <a href="javascript:void(0);" style="color:green;">重新推送</a>
  159. </a-popconfirm>
  160. </a-menu-item>
  161. </a-menu>
  162. <!-- 已提交 -->
  163. <a-menu slot="overlay" v-if="record.status == '1'">
  164. <a-menu-item>
  165. <a @click="details(record)">详情</a>
  166. </a-menu-item>
  167. <a-menu-item>
  168. <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
  169. <a href="javascript:void(0);" style="color:red;">取消提交</a>
  170. </a-popconfirm>
  171. </a-menu-item>
  172. <a-menu-item>
  173. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  174. <a href="javascript:void(0);" style="color:green;">推送</a>
  175. </a-popconfirm>
  176. </a-menu-item>
  177. </a-menu>
  178. <!-- 未推送 -->
  179. <a-menu slot="overlay" v-if="record.pushStatus == '0'">
  180. <a-menu-item>
  181. <a @click="details(record)">详情</a>
  182. </a-menu-item>
  183. <a-menu-item>
  184. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  185. <a href="javascript:void(0);" style="color:green;">推送</a>
  186. </a-popconfirm>
  187. </a-menu-item>
  188. </a-menu>
  189. </a-dropdown>
  190. </span>
  191. </a-table>
  192. </a-card>
  193. <!-- 抽屉 -->
  194. <div>
  195. <addAdpacking-drawer
  196. ref="addAdpackingDrawer"
  197. :fatherList="getadPaListClothes"
  198. @ok="modalFormOk"
  199. ></addAdpacking-drawer>
  200. <detailsAdpacking-drawer ref="detailsAdpackingDrawer" @ok="modalFormOk"></detailsAdpacking-drawer>
  201. </div>
  202. </div>
  203. </template>
  204. <script>
  205. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  206. import JEllipsis from '@/components/jeecg/JEllipsis'
  207. import moment from 'moment'
  208. import addAdpackingDrawer from '@views/advance-packingList/addAdpackingDrawer.vue'
  209. import detailsAdpackingDrawer from '@views/advance-packingList/detailsAdpackingDrawer.vue'
  210. import { getadPaList, itemByMainId, submit, cancelSubmit, deleteAdPaList,batchSubmit,batchPush,push} from '@api/document/advance-packingList.js'
  211. export default {
  212. productName: 'AdPaListClothes', // 预装箱单-成衣
  213. mixins: [JeecgListMixin],
  214. components: { JEllipsis, moment, addAdpackingDrawer, detailsAdpackingDrawer },
  215. data() {
  216. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  217. return {
  218. loading: false, // 表格加载
  219. id: '',
  220. range:[],//预发货日期数组
  221. rangeMode:['date','date'],
  222. timeRange:'',
  223. // 表头
  224. adPaListClothesColumns: [
  225. {
  226. title: '单据号',
  227. dataIndex: 'documentNo',
  228. width: 120,
  229. fixed: 'left',
  230. className: 'replacecolor'
  231. },
  232. {
  233. title: '款号',
  234. dataIndex: 'itemNumber',
  235. width: 120,
  236. fixed: 'left',
  237. className: 'replacecolor'
  238. },
  239. {
  240. title: '订单号',
  241. dataIndex: 'orderNumber',
  242. width: 120,
  243. fixed: 'left',
  244. className: 'replacecolor'
  245. },
  246. {
  247. title: '客户(简称)',
  248. dataIndex: 'customerAbbreviation',
  249. width: 100,
  250. fixed: 'left',
  251. className: 'replacecolor'
  252. },
  253. {
  254. title: '预发货日期',
  255. dataIndex: 'preDeliveryDate',
  256. width: 120,
  257. customRender: text => {
  258. return moment(text).format('YYYY-MM-DD')
  259. },
  260. className: 'replacecolor'
  261. },
  262. {
  263. title: '小po',
  264. dataIndex: 'smallPo',
  265. width: 100,
  266. className: 'replacecolor'
  267. },
  268. {
  269. title: '分销点',
  270. dataIndex: 'distributionPoint',
  271. width: 120,
  272. className: 'replacecolor'
  273. },
  274. {
  275. title: '存货名称',
  276. dataIndex: 'inventoryName',
  277. width: 120,
  278. className: 'replacecolor'
  279. },
  280. {
  281. title: '颜色',
  282. dataIndex: 'colour',
  283. width: 180,
  284. className: 'replacecolor'
  285. },
  286. {
  287. title: '采购/委外订单号',
  288. dataIndex: 'spurOrSubOrder',
  289. width: 220,
  290. className: 'replacecolor'
  291. },
  292. {
  293. title: '订单类型',
  294. dataIndex: 'orderType',
  295. width: 100,
  296. className: 'replacecolor'
  297. },
  298. {
  299. title: '工厂单价',
  300. dataIndex: 'factoryUnitPrice',
  301. width: 100,
  302. className: 'replacecolor'
  303. },
  304. {
  305. title: '数量(按合并规则累计)',
  306. dataIndex: 'total',
  307. width: 200,
  308. className: 'replacecolor'
  309. },
  310. {
  311. title: '箱数',
  312. dataIndex: 'totalBoxes',
  313. width: 100,
  314. className: 'replacecolor'
  315. },
  316. {
  317. title: '总净重',
  318. dataIndex: 'totalNetWeight',
  319. width: 100,
  320. className: 'replacecolor'
  321. },
  322. {
  323. title: '总毛重',
  324. dataIndex: 'totalGrossWeight',
  325. width: 100,
  326. className: 'replacecolor'
  327. },
  328. {
  329. title: '总体积',
  330. dataIndex: 'totalVolume',
  331. width: 100,
  332. className: 'replacecolor'
  333. },
  334. {
  335. title: '总价',
  336. dataIndex: 'totalPrice',
  337. width: 100,
  338. className: 'replacecolor'
  339. },
  340. {
  341. title: '集装箱代号',
  342. dataIndex: 'containerCode',
  343. width: 120,
  344. className: 'replacecolor'
  345. },
  346. {
  347. title: '集装箱号',
  348. dataIndex: 'containerNumber',
  349. width: 120,
  350. className: 'replacecolor'
  351. },
  352. {
  353. title: '预托书号',
  354. dataIndex: 'depositaryReceiptNo',
  355. width: 100,
  356. className: 'replacecolor'
  357. },
  358. {
  359. title: '成衣工厂',
  360. dataIndex: 'garmentFactory',
  361. width: 160,
  362. className: 'replacecolor'
  363. },
  364. {
  365. title: '推送状态',
  366. dataIndex: 'pushStatus',
  367. width: 90,
  368. scopedSlots: { customRender: 'pushStatesSlot' },
  369. fixed: 'right',
  370. className: 'replacecolor'
  371. },
  372. {
  373. title: '单据状态',
  374. dataIndex: 'status',
  375. width: 90,
  376. scopedSlots: { customRender: 'statusSlot' },
  377. fixed: 'right',
  378. className: 'replacecolor'
  379. },
  380. {
  381. title: '原因',
  382. dataIndex: 'memo',
  383. width: 220,
  384. fixed: 'right',
  385. customRender: t => ellipsis(t),
  386. className: 'replacecolor'
  387. },
  388. {
  389. title: '操作',
  390. dataIndex: 'operation',
  391. scopedSlots: { customRender: 'operationSlot' },
  392. width: 160,
  393. fixed: 'right',
  394. className: 'replacecolor'
  395. }
  396. ],
  397. adPaListClothesData: [],
  398. queryParam: {
  399. // pageNo: '',
  400. // orderNumber: '',
  401. // itemNumber: '',
  402. // productName: '' // 品名
  403. },
  404. pagination: {
  405. // total: '',
  406. // current: 0,
  407. // pageSize: 0
  408. },
  409. selectedRowKeys: [], // 勾选航
  410. dateFormat: 'YYYY-MM-DD'
  411. }
  412. },
  413. created() {
  414. this.getadPaListClothes()
  415. },
  416. methods: {
  417. // 分页查询 预装箱单-成衣
  418. getadPaListClothes() {
  419. console.log(this.queryParam)
  420. this.$nextTick(() => {
  421. getadPaList(this.queryParam).then(res => {
  422. if (res.success) {
  423. this.adPaListClothesData = [];
  424. if (res.result.records != null){
  425. this.adPaListClothesData = res.result.records;
  426. }
  427. this.pagination = {
  428. total: res.result.total,
  429. current: res.result.current,
  430. pageSize: res.result.size
  431. }
  432. }
  433. })
  434. })
  435. },
  436. // 编辑
  437. edit(record) {
  438. itemByMainId({id:record.id}).then(res => {
  439. if (res.success) {
  440. this.$refs.addAdpackingDrawer.visible = true;
  441. this.$refs.addAdpackingDrawer.editDecide = 'edit';
  442. this.$refs.addAdpackingDrawer.addAdpacking = res.result; //接口参数
  443. this.$refs.addAdpackingDrawer.loadSizeTables(res.result.syPreAssembledPackingListItemList[0].sizeTables);
  444. // var totalNetWeight = 0;
  445. // var totalGrossWeight = 0;
  446. // var totalVolume = 0;
  447. // var totalPrice = 0;
  448. // var total = 0;
  449. for (var i=0; i<res.result.syPreAssembledPackingListItemList.length;i++){
  450. var row = res.result.syPreAssembledPackingListItemList[i];
  451. var sizeTables = row.sizeTables;
  452. for (var j=0; j<sizeTables.length;j++){
  453. row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
  454. }
  455. // totalNetWeight += row.totalNetWeight*1;
  456. // totalGrossWeight += row.totalGrossWeight*1;
  457. // totalVolume += row.totalVolume*1;
  458. // totalPrice += row.totalPrice*1;
  459. // total += row.total*1
  460. }
  461. // res.result.totalNetWeight = totalNetWeight;
  462. // res.result.totalGrossWeight = totalGrossWeight;
  463. // res.result.totalVolume = totalVolume;
  464. // res.result.totalPrice = totalPrice;
  465. // res.result.total = total;
  466. }else{
  467. this.$message.error(res.message);
  468. }
  469. });
  470. },
  471. // 详情
  472. details(record) {
  473. itemByMainId({id:record.id}).then(res => {
  474. if (res.success) {
  475. this.$refs.detailsAdpackingDrawer.visible = true;
  476. this.$refs.detailsAdpackingDrawer.addAdpacking = res.result; //接口参数
  477. this.$refs.detailsAdpackingDrawer.loadSizeTables(res.result.syPreAssembledPackingListItemList[0].sizeTables);
  478. var totalNetWeight = 0;
  479. var totalGrossWeight = 0;
  480. var totalVolume = 0;
  481. var totalPrice = 0;
  482. for (var i=0; i<res.result.syPreAssembledPackingListItemList.length;i++){
  483. var row = res.result.syPreAssembledPackingListItemList[i];
  484. var sizeTables = row.sizeTables;
  485. for (var j=0; j<sizeTables.length;j++){
  486. row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
  487. }
  488. totalNetWeight += row.totalNetWeight*1;
  489. totalGrossWeight += row.totalGrossWeight*1;
  490. totalVolume += row.totalVolume*1;
  491. totalPrice += row.totalPrice*1;
  492. }
  493. res.result.totalNetWeight = totalNetWeight;
  494. res.result.totalGrossWeight = totalGrossWeight;
  495. res.result.totalVolume = totalVolume;
  496. res.result.totalPrice = totalPrice;
  497. }else{
  498. this.$message.error(res.message);
  499. }
  500. });
  501. },
  502. // 新增
  503. addAdpacking() {
  504. this.$refs.addAdpackingDrawer.visible = true;
  505. },
  506. // 列表导出
  507. handleExportXls(fileName) {
  508. console.log('需导出的fileName:', fileName)
  509. const params = this.dyeLossRateData
  510. console.log('导出参数', params)
  511. // downFile('/scas/dyeLoss/excel', params).then(data => {
  512. // if (!data) {
  513. // this.$message.warning('文件下载失败')
  514. // return
  515. // }
  516. // if (typeof window.navigator.msSaveBlob !== 'undefined') {
  517. // window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  518. // } else {
  519. // let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  520. // let link = document.createElement('a')
  521. // link.style.display = 'none'
  522. // link.href = url
  523. // link.setAttribute('download', fileName + '.xls')
  524. // document.body.appendChild(link)
  525. // link.click()
  526. // document.body.removeChild(link) // 下载完成移除元素
  527. // window.URL.revokeObjectURL(url) // 释放掉blob对象
  528. // }
  529. // })
  530. },
  531. // 删除
  532. handleDelete(record) {
  533. console.log('点击删除项id:', record.id)
  534. this.$nextTick(() => {
  535. if(this.queryParam.pageNo > 1 && this.adPaListClothesData.length === 1){
  536. this.queryParam.pageNo = this.queryParam.pageNo -1
  537. }
  538. deleteAdPaList({ id: record.id }).then(res => {
  539. if (res.success) {
  540. console.log('res:', res)
  541. this.getadPaListClothes()
  542. this.$message.success('删除成功')
  543. } else {
  544. this.$message.error('删除成功')
  545. }
  546. })
  547. })
  548. },
  549. searchQuery() {
  550. this.queryParam.pageNo = ''
  551. this.getadPaListClothes()
  552. },
  553. searchReset() {
  554. this.range = []
  555. this.queryParam = {}
  556. this.getadPaListClothes()
  557. },
  558. // 操作 单条数据导出
  559. itemXls() {},
  560. // 提交
  561. submit(record) {
  562. var that = this;
  563. this.$nextTick(() => {
  564. submit({ id: record.id }).then(res => {
  565. if (res.success) {
  566. record.status=1;
  567. that.$message.success('提交成功');
  568. }else{
  569. that.$message.error(res.message);
  570. }
  571. })
  572. })
  573. },
  574. // 取消提交
  575. cancelSubmit(record){
  576. var that = this;
  577. this.$nextTick(() => {
  578. cancelSubmit({ id: record.id }).then(res => {
  579. if (res.success) {
  580. record.status=0;
  581. that.$message.success('取消提交成功');
  582. }else{
  583. that.$message.error(res.message);
  584. }
  585. })
  586. })
  587. },
  588. //批量提交
  589. batchSubmit(){
  590. this.$nextTick(() => {
  591. for(var i =0;i<this.selectedRows.length;i++){
  592. var tickRow = this.selectedRows[i]
  593. if(tickRow.status === '1'){
  594. var clo = i+1
  595. this.$message.error("勾选的第"+clo+"行数据是已提交!");
  596. return
  597. }
  598. }
  599. var ids = this.selectedRowKeys.toString()
  600. batchSubmit({ id: ids }).then(res => {
  601. if (res.success) {
  602. this.selectedRows.map(item=>{
  603. item.status = 1
  604. })
  605. this.$message.success('批量提交成功');
  606. }else {
  607. this.$message.error(res.message);
  608. }
  609. })
  610. this.selectedRowKeys = []
  611. })
  612. },
  613. //批量推送
  614. batchPush(){
  615. this.$nextTick(() => {
  616. for(var i =0;i<this.selectedRows.length;i++){
  617. var tickRow = this.selectedRows[i]
  618. var clo = i+1
  619. if(tickRow.status == '0'){
  620. this.$message.error("勾选的第"+clo+"行数据未提交,不能推送!");
  621. return
  622. }
  623. if(tickRow.status === '1' && tickRow.pushStatus === '1'){
  624. this.$message.error("勾选的第"+clo+"行数据是已推送!");
  625. return
  626. }
  627. }
  628. var ids = this.selectedRowKeys.toString()
  629. batchPush({ id: ids }).then(res => {
  630. if (res.success) {
  631. this.selectedRows.map(item=>{
  632. item.pushStatus = 1
  633. })
  634. this.$message.success('批量推送成功');
  635. }else {
  636. this.$message.error(res.message);
  637. this.selectedRows.map(item=>{
  638. item.pushStatus = 2
  639. })
  640. this.$message.error(res.message);
  641. }
  642. })
  643. this.selectedRowKeys = []
  644. })
  645. },
  646. //推送
  647. push(record){
  648. this.$nextTick(() => {
  649. push({ id: record.id }).then(res => {
  650. if (res.success) {
  651. record.pushStatus=1;
  652. this.$message.success('推送成功');
  653. }else{
  654. record.pushStatus = 2
  655. this.$message.error(res.message);
  656. }
  657. })
  658. })
  659. },
  660. // 选中行
  661. onSelectChange(keys, rows) {
  662. this.selectedRowKeys = keys
  663. this.selectedRows = rows
  664. },
  665. handleTableChange(pagination, filters, sorter) {
  666. // console.log('当前页信息>>>>',pagination)
  667. this.queryParam.pageNo = pagination.current
  668. this.getadPaListClothes()
  669. },
  670. aa() {},
  671. onDateChange(value, dateString) {
  672. this.queryParam.startTime = dateString[0]
  673. this.queryParam.endTime = dateString[1]
  674. },
  675. rangeSelectChange(value) {
  676. this.range = value
  677. if (value.length == 0){
  678. this.queryParam.stratDate = "";
  679. this.queryParam.endDate = "";
  680. }else{
  681. this.queryParam.stratDate = value[0].format('YYYY-MM-DD');
  682. this.queryParam.endDate = value[1].format('YYYY-MM-DD');
  683. }
  684. }
  685. },
  686. computed: {
  687. // 导入
  688. importExcelUrl() {
  689. // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  690. },
  691. // 选中项
  692. rowSelection() {
  693. return {
  694. onChange: (selectedRowKeys, selectedRows) => {
  695. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  696. },
  697. getCheckboxProps: record => ({
  698. props: {
  699. disabled: record.title === 'Disabled User',
  700. // Column configuration not to be checked
  701. title: record.title
  702. }
  703. })
  704. }
  705. }
  706. }
  707. }
  708. </script>
  709. <style lang="less" scoped>
  710. @import '~@assets/less/common.less';
  711. @import '~@assets/less/overwriter.less';
  712. /deep/ .ant-table-thead > tr > th {
  713. text-align: center;
  714. // font-weight: 700;
  715. }
  716. /deep/ .ant-table-tbody {
  717. text-align: center;
  718. }
  719. // /deep/ th.replacecolor {
  720. // background-color: #ccc;
  721. // }
  722. </style>