shipmentList.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <template>
  2. <!-- 发运明细 列表 -->
  3. <div id="ShipmentList">
  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-range-picker
  17. style="width: 100%"
  18. v-model="queryParam.timeRange"
  19. format="YYYY-MM-DD"
  20. :placeholder="['开始时间', '结束时间']"
  21. @change="onDateChange"
  22. @ok="onDateOk"
  23. />
  24. </a-form-item>
  25. </a-col>
  26. <a-col :md="6" :sm="8">
  27. <a-form-item label="预发货日期">
  28. <a-date-picker
  29. placeholder="请选择预发货日期"
  30. format="YYYY-MM-DD"
  31. style="width: 100%"
  32. v-model="queryParam.preDeliveryDate"
  33. @change="deliveryDateChange"
  34. />
  35. </a-form-item>
  36. </a-col>
  37. <template v-if="toggleSearchStatus">
  38. <a-col :md="6" :sm="8">
  39. <a-form-item label="业务员">
  40. <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input>
  41. </a-form-item>
  42. </a-col>
  43. <a-col :md="6" :sm="8">
  44. <a-form-item label="款号">
  45. <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
  46. </a-form-item>
  47. </a-col>
  48. <a-col :md="6" :sm="8">
  49. <a-form-item label="是否被参照">
  50. <a-select v-model="queryParam.refer">
  51. <a-select-option value="">请选择</a-select-option>
  52. <a-select-option value="0">否</a-select-option>
  53. <a-select-option value="1">是</a-select-option>
  54. </a-select>
  55. </a-form-item>
  56. </a-col>
  57. <a-col :md="6" :sm="8">
  58. <a-form-model-item label="类型">
  59. <a-select v-model="queryParam.flourOrGarment">
  60. <a-select-option value="">请选择</a-select-option>
  61. <a-select-option value="1">成衣</a-select-option>
  62. <a-select-option value="0">面辅料</a-select-option>
  63. </a-select>
  64. </a-form-model-item>
  65. </a-col>
  66. </template>
  67. <a-col :md="6" :sm="8">
  68. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  69. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  70. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  71. <a @click="handleToggleSearch" style="margin-left: 8px">
  72. {{ toggleSearchStatus ? '收起' : '展开' }}
  73. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  74. </a>
  75. </span>
  76. </a-col>
  77. </a-row>
  78. </a-form>
  79. </div>
  80. </a-card>
  81. <!-- 操作按钮区域 -->
  82. <a-card :bordered="false" style=" marginTop:10px;">
  83. <div class="table-operator">
  84. <a-button type="primary" @click.stop="addShipDet" icon="plus">新增</a-button>
  85. <a-button type="primary" icon="download" @click="handleExportXls('发运明细')">导出</a-button>
  86. </div>
  87. <!-- 子表 :row-key="record => record.id" :pagination="ipagination-->
  88. <a-table
  89. v-if="shipmentListData"
  90. bordered
  91. rowKey="randomId"
  92. :columns="shipmentListColumns"
  93. :data-source="shipmentListData"
  94. :loading="loading"
  95. :pagination="pagination"
  96. :scroll="{ x: 1500 }"
  97. @change="handleTableChange"
  98. >
  99. <!-- 推送状态 -->
  100. <span slot="pushState" slot-scope="text, record">
  101. <a-tag color="#2db7f5" v-if="record.pushState == '0'">未推送</a-tag>
  102. <a-tag color="#87d068" v-if="record.pushState == '1'">推送成功</a-tag>
  103. <a-tag color="#f50" v-if="record.pushState == '2'">推送失败</a-tag>
  104. </span>
  105. <!-- 单据状态 -->
  106. <span slot="state" slot-scope="text, record">
  107. <a-tag color="orange" v-if="record.state == '0'">已保存</a-tag>
  108. <a-tag color="green" v-if="record.state == '1'">已提交</a-tag>
  109. </span>
  110. <!-- 操作 默认按钮 未提交未推送-->
  111. <span slot="operationSlot" slot-scope="text, record">
  112. <a href="javascript:void(0);" @click="declareElements(record)" style="color:green">报关要素</a>
  113. <a-divider type="vertical" />
  114. <a-dropdown>
  115. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  116. <!-- 已保存 -->
  117. <a-menu slot="overlay" v-if="record.state == '0'">
  118. <a-menu-item>
  119. <a @click="details(record)">详情</a>
  120. </a-menu-item>
  121. <a-menu-item>
  122. <a @click="edit(record)">编辑</a>
  123. </a-menu-item>
  124. <a-menu-item>
  125. <a href="javascript:void(0);" @click="itemNumberElement(record)">维护款号成分</a>
  126. </a-menu-item>
  127. <a-menu-item>
  128. <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
  129. <a href="javascript:void(0);" style="color:green;">提交</a>
  130. </a-popconfirm>
  131. </a-menu-item>
  132. <a-menu-item>
  133. <a-popconfirm arrowPointAtCenter title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
  134. <a href="javascript:void(0);" style="color:red;">删除</a>
  135. </a-popconfirm>
  136. </a-menu-item>
  137. <!-- <a-menu-item>
  138. <a href="javascript:void(0);" @click="itemNumberElement(record)">维护款号成分</a>
  139. </a-menu-item> -->
  140. </a-menu>
  141. <!-- 已提交 且 推送成功 -->
  142. <a-menu slot="overlay" v-if="record.pushState == '1' && record.state == '1'">
  143. <a-menu-item>
  144. <a @click="details(record)">详情</a>
  145. </a-menu-item>
  146. </a-menu>
  147. <!-- 已提交 且 推送失败 -->
  148. <a-menu slot="overlay" v-if="record.pushState == '2' && record.state == '1'">
  149. <a-menu-item>
  150. <a @click="details(record)">详情</a>
  151. </a-menu-item>
  152. <a-menu-item>
  153. <a-popconfirm title="确定重新推送吗?" ok-text="是" cancel-text="否" @confirm="rePush(record)">
  154. <a href="javascript:void(0);" style="color:green;">重新推送</a>
  155. </a-popconfirm>
  156. </a-menu-item>
  157. </a-menu>
  158. <!-- 已提交 -->
  159. <a-menu slot="overlay" v-if="record.state == '1'">
  160. <a-menu-item>
  161. <a @click="details(record)">详情</a>
  162. </a-menu-item>
  163. <a-menu-item>
  164. <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
  165. <a href="javascript:void(0);" style="color:red;">取消提交</a>
  166. </a-popconfirm>
  167. </a-menu-item>
  168. <a-menu-item>
  169. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  170. <a href="javascript:void(0);" style="color:green;">推送</a>
  171. </a-popconfirm>
  172. </a-menu-item>
  173. </a-menu>
  174. <!-- 未推送 -->
  175. <a-menu slot="overlay" v-if="record.pushState == '0'">
  176. <a-menu-item>
  177. <a @click="details(record)">详情</a>
  178. </a-menu-item>
  179. <a-menu-item>
  180. <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
  181. <a href="javascript:void(0);" style="color:green;">推送</a>
  182. </a-popconfirm>
  183. </a-menu-item>
  184. </a-menu>
  185. </a-dropdown>
  186. </span>
  187. </a-table>
  188. </a-card>
  189. <!-- 抽屉 -->
  190. <div>
  191. <addShipDet-drawer ref="addShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk"></addShipDet-drawer>
  192. <editShipDet-drawer ref="editShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk"></editShipDet-drawer>
  193. <detailsShipDet-drawer ref="detailsShipDetDrawer" @ok="modalFormOk"></detailsShipDet-drawer>
  194. <!-- 申报要素 弹框 -->
  195. <declareElements-modal ref="declareElementsModal"></declareElements-modal>
  196. <!-- 维护款号成分 -->
  197. <itemNumEle-modal ref="itemNumEleModal" :fatherList="getShipmentList"></itemNumEle-modal>
  198. </div>
  199. </div>
  200. </template>
  201. <script>
  202. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  203. import JEllipsis from '@/components/jeecg/JEllipsis'
  204. import moment from 'moment'
  205. import { downFile } from '@/api/manage'
  206. import addShipDetDrawer from '@views/shipment-details/addShipDetDrawer.vue'
  207. import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.vue'
  208. import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
  209. import declareElementsModal from '@views/shipment-details/declareElementsModal.vue'
  210. import itemNumEleModal from '@views/shipment-details/itemNumEleModal.vue'
  211. import { randomUUID } from '@/utils/util'
  212. import {
  213. shipmentList,
  214. deleteShipment,
  215. submitShipment,
  216. shipmentQueryById,
  217. queryByDetails,
  218. queryDeclarationElements,
  219. cancelSubmitShipment,
  220. pushShipment,
  221. rePushShipment
  222. } from '@api/document/shipmentList'
  223. export default {
  224. name: 'ShipmentList', // 发运明细列表
  225. mixins: [JeecgListMixin],
  226. components: {
  227. JEllipsis,
  228. moment,
  229. addShipDetDrawer,
  230. detailsShipDetDrawer,
  231. editShipDetDrawer,
  232. declareElementsModal,
  233. cancelSubmitShipment,
  234. pushShipment,
  235. rePushShipment,
  236. itemNumEleModal
  237. },
  238. data() {
  239. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  240. return {
  241. loading: false, // 表格加载
  242. id: '',
  243. shipmentListColumns: [
  244. {
  245. title: '单据号',
  246. dataIndex: 'documentNo',
  247. fixed: 'left',
  248. align: 'left',
  249. width: 140,
  250. className: 'replacecolor'
  251. },
  252. {
  253. title: '销售订单号',
  254. dataIndex: 'orderNumber',
  255. fixed: 'left',
  256. width: 150,
  257. className: 'replacecolor'
  258. },
  259. {
  260. title: '客户简称',
  261. dataIndex: 'customerAbbreviation',
  262. width: 220,
  263. align: 'left',
  264. className: 'replacecolor'
  265. },
  266. {
  267. title: '部门',
  268. dataIndex: 'salesDepartment',
  269. width: 120,
  270. className: 'replacecolor'
  271. },
  272. {
  273. title: '业务员',
  274. dataIndex: 'salesman',
  275. width: 120,
  276. className: 'replacecolor'
  277. },
  278. {
  279. title: '小po',
  280. dataIndex: 'smallPo',
  281. width: 120,
  282. className: 'replacecolor'
  283. },
  284. {
  285. title: 'pack id',
  286. dataIndex: 'packId',
  287. width: 120,
  288. className: 'replacecolor'
  289. },
  290. {
  291. title: '分销点',
  292. dataIndex: 'distributionPoint',
  293. width: 120,
  294. className: 'replacecolor'
  295. },
  296. {
  297. title: '款号',
  298. dataIndex: 'itemNumber',
  299. width: 180,
  300. className: 'replacecolor'
  301. },
  302. {
  303. title: '物料成分',
  304. dataIndex: 'materialComposition',
  305. width: 180,
  306. className: 'replacecolor',
  307. customRender: t => ellipsis(t),
  308. },
  309. {
  310. title: '预发货日期',
  311. dataIndex: 'preDeliveryDate',
  312. width: 120,
  313. customRender: text => {
  314. if (text == "" || text == null)
  315. return "";
  316. return moment(text).format('YYYY-MM-DD')
  317. },
  318. className: 'replacecolor'
  319. },
  320. {
  321. title: '预完工日期',
  322. dataIndex: 'preCompletionDate',
  323. width: 120,
  324. customRender: text => {
  325. if (text == "" || text == null)
  326. return "";
  327. return moment(text).format('YYYY-MM-DD')
  328. },
  329. className: 'replacecolor'
  330. },
  331. {
  332. title: '存货名称',
  333. dataIndex: 'inventoryName',
  334. width: 240,
  335. className: 'replacecolor',
  336. customRender: t => ellipsis(t),
  337. },
  338. {
  339. title: '英文品名',
  340. dataIndex: 'englishProductName',
  341. width: 120,
  342. className: 'replacecolor',
  343. customRender: t => ellipsis(t),
  344. },
  345. {
  346. title: '单价(销售)',
  347. dataIndex: 'salesUnitPrice',
  348. width: 120,
  349. className: 'replacecolor',
  350. },
  351. {
  352. title: '采购/委外订单号',
  353. dataIndex: 'purOrSubOrder',
  354. width: 180,
  355. className: 'replacecolor'
  356. },
  357. {
  358. title: '订单类型',
  359. dataIndex: 'orderType',
  360. width: 120,
  361. className: 'replacecolor'
  362. },
  363. {
  364. // (采购/委外单价)
  365. title: '工厂单价',
  366. dataIndex: 'factoryUnitPrice',
  367. width: 120,
  368. className: 'replacecolor'
  369. },
  370. // {
  371. // title: '申报要素(单证维护)',
  372. // dataIndex: 'declarationElements',
  373. // width: 120,
  374. // className: 'replacecolor'
  375. // },
  376. {
  377. // (存货自定义项)
  378. title: '套装件数',
  379. dataIndex: 'numberOfSets',
  380. width: 120,
  381. className: 'replacecolor'
  382. },
  383. {
  384. title: '是否TC',
  385. dataIndex: 'isTc',
  386. width: 90,
  387. customRender: function(text) {
  388. if (text === '0') {
  389. return '否'
  390. }
  391. if (text === '1') {
  392. return '是'
  393. }
  394. },
  395. className: 'replacecolor'
  396. },
  397. // {
  398. // title: 'HScode',
  399. // dataIndex: 'hsCode',
  400. // width: 120,
  401. // className: 'replacecolor'
  402. // },
  403. // {
  404. // title: '中文品名',
  405. // dataIndex: 'chineseName',
  406. // width: 120,
  407. // className: 'replacecolor'
  408. // },
  409. {
  410. title: '成衣工厂',
  411. dataIndex: 'garmentFactory',
  412. width: 120,
  413. className: 'replacecolor'
  414. },
  415. {
  416. title: '报关单价',
  417. dataIndex: 'customsDeclarationUnitPrice',
  418. width: 90,
  419. className: 'replacecolor'
  420. },
  421. {
  422. title: '账套',
  423. dataIndex: 'account',
  424. width: 90,
  425. className: 'replacecolor'
  426. },
  427. {
  428. title: '推送结果',
  429. dataIndex: 'pushState',
  430. scopedSlots: { customRender: 'pushState' },
  431. fixed: 'right',
  432. width: 90,
  433. className: 'replacecolor'
  434. },
  435. {
  436. title: '单据状态',
  437. dataIndex: 'state',
  438. scopedSlots: { customRender: 'state' },
  439. fixed: 'right',
  440. width: 90,
  441. className: 'replacecolor'
  442. },
  443. {
  444. title: '操作',
  445. dataIndex: 'operation',
  446. scopedSlots: { customRender: 'operationSlot' },
  447. fixed: 'right',
  448. width: 160,
  449. className: 'replacecolor'
  450. }
  451. ],
  452. shipmentListData: [], // 发运明细数据
  453. // 查询条件
  454. queryParam: {
  455. documentNo: '', // 单据号
  456. startTime: '',
  457. endTime: '',
  458. // timeRange: [], // 查询条件 时间范围
  459. preDeliveryDate: '',
  460. salesman: '',
  461. itemNumber: '', // 款号
  462. refer: '',
  463. flourOrGarment: '', //类型
  464. pageNo: '' // 点击的页数
  465. },
  466. pagination: {
  467. // total: '',
  468. // current: 0,
  469. // pageSize: 0
  470. },
  471. dateFormat: 'YYYY-MM-DD',
  472. }
  473. },
  474. created() {
  475. // this.getShipmentList() // 渲染 发运明细列表
  476. },
  477. methods: {
  478. // 分页查询 发运明细
  479. getShipmentList() {
  480. this.$nextTick(() => {
  481. shipmentList(this.queryParam).then(res => {
  482. if (res.success) {
  483. this.shipmentListData = res.result.records
  484. for (var i=0; i<this.shipmentListData.length; i++){
  485. this.shipmentListData.randomId = randomUUID();
  486. }
  487. this.pagination = {
  488. total: res.result.total,
  489. current: res.result.current,
  490. pageSize: res.result.size
  491. }
  492. }
  493. })
  494. })
  495. },
  496. // 新增
  497. addShipDet() {
  498. this.$refs.addShipDetDrawer.syShippingDetailsItemList = [];
  499. this.$refs.addShipDetDrawer.visible = true
  500. },
  501. // 申报要素
  502. declareElements(record) {
  503. if (record.inventoryName == ""){
  504. this.$message.error('当前行存货名称为空,无法维护报关要素');
  505. }else{
  506. this.$refs.declareElementsModal.declareElementsModVis = true
  507. queryDeclarationElements({
  508. inventoryName: record.inventoryName,
  509. itemNumber: record.itemNumber,
  510. account: record.account
  511. }).then(res => {
  512. if (res.success) {
  513. // console.log('申报要素子表数据', res.result.syDeclarationElementsItemList)
  514. this.$refs.declareElementsModal.declareElements = res.result
  515. // 子表赋值
  516. this.$refs.declareElementsModal.declareElementsData = res.result.syDeclarationElementsItemList
  517. }
  518. })
  519. }
  520. },
  521. // 维护款号成分
  522. itemNumberElement(record) {
  523. this.$refs.itemNumEleModal.itemNumEleModVis = true
  524. this.$refs.itemNumEleModal.editItemNumber.itemIds = record.itemIds
  525. this.$refs.itemNumEleModal.editItemNumber.itemNumber = record.itemNumber
  526. this.$refs.itemNumEleModal.editItemNumber.materialComposition = record.materialComposition
  527. this.$refs.itemNumEleModal.editItemNumber.isTc = record.isTc
  528. },
  529. // 导出
  530. handleExportXls(fileName) {
  531. downFile('/shippingDetails/syShippingDetails/exportXls',this.queryParam).then(data => {
  532. if (!data) {
  533. this.$message.warning('文件下载失败')
  534. return
  535. }
  536. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  537. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  538. } else {
  539. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  540. let link = document.createElement('a')
  541. link.style.display = 'none'
  542. link.href = url
  543. link.setAttribute('download', fileName + '.xls')
  544. document.body.appendChild(link)
  545. link.click()
  546. document.body.removeChild(link) // 下载完成移除元素
  547. window.URL.revokeObjectURL(url) // 释放掉blob对象
  548. }
  549. })
  550. },
  551. // 编辑
  552. edit(record) {
  553. this.$refs.editShipDetDrawer.visible = true
  554. queryByDetails({ id: record.id,itemIds: record.itemIds }).then(res => {
  555. if (res.success) {
  556. // console.log('编辑对象', res.result)
  557. this.$refs.editShipDetDrawer.editShipDet = res.result
  558. this.$refs.editShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
  559. }
  560. })
  561. },
  562. // 详情
  563. details(record) {
  564. this.$refs.detailsShipDetDrawer.visible = true
  565. // console.log('点击项的ID', record.id)
  566. queryByDetails({ id: record.id,itemIds: record.itemIds}).then(res => {
  567. if (res.success) {
  568. console.log('点击的对象', res.result)
  569. // 把通过id查询到的对象,赋值给子组件
  570. this.$refs.detailsShipDetDrawer.detailsShipDet = res.result
  571. this.$refs.detailsShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
  572. }
  573. })
  574. },
  575. // 提交
  576. submit(record) {
  577. console.log('点击id:', record.id)
  578. this.$nextTick(() => {
  579. submitShipment({ id: record.id, type: '1' }).then(res => {
  580. if (res.success) {
  581. console.log('提交成功,单据状态改为【已提交】')
  582. this.shipmentListData.state = '1'
  583. this.getShipmentList() // 渲染 发运明细列表
  584. this.$message.success('提交成功')
  585. }
  586. })
  587. })
  588. },
  589. // 取消提交
  590. cancelSubmit(record) {
  591. console.log('取消订单id:', record.id)
  592. this.$nextTick(() => {
  593. cancelSubmitShipment({ id: record.id, type: '2' }).then(res => {
  594. if (res.success) {
  595. console.log('取消提交成功,单据状态改为【仅保存】')
  596. this.shipmentListData.state = '0'
  597. this.getShipmentList() // 渲染 发运明细列表
  598. this.$message.success('取消提交成功')
  599. }
  600. })
  601. })
  602. },
  603. // 推送
  604. push(record) {
  605. console.log('推送id:', record.id)
  606. this.$nextTick(() => {
  607. pushShipment({ id: record.id }).then(res => {
  608. if (res.success) {
  609. console.log('推送成功,推送状态【推送成功】')
  610. this.shipmentListData.pushState = '1'
  611. this.getShipmentList() // 渲染 发运明细列表
  612. this.$message.success('推送成功')
  613. }
  614. })
  615. })
  616. },
  617. // 重新推送
  618. rePush(record) {
  619. console.log('重新推送record:', record)
  620. this.$nextTick(() => {
  621. rePushShipment({ id: record.id }).then(res => {
  622. if (res.success) {
  623. console.log('重新推送成功,推送状态【推送成功】')
  624. this.shipmentListData.pushState = '1'
  625. this.getShipmentList() // 渲染 发运明细列表
  626. this.$message.success('重新推送成功')
  627. }
  628. })
  629. })
  630. },
  631. // 删除
  632. handleDelete(record) {
  633. console.log('点击删除项id:', record.id)
  634. this.$nextTick(() => {
  635. deleteShipment({ id: record.id,itemIds: record.itemIds }).then(res => {
  636. console.log('res:', res)
  637. this.getShipmentList() // 渲染 发运明细列表
  638. this.$message.success('删除成功')
  639. })
  640. })
  641. },
  642. onDateChange(value, dateString) {
  643. console.log('查询开始时间', dateString[0], '查询结束时间', dateString[1])
  644. this.queryParam.startTime = dateString[0]
  645. this.queryParam.endTime = dateString[1]
  646. },
  647. onDateOk(value) {
  648. console.log('value', value)
  649. },
  650. deliveryDateChange(value, dateString) {
  651. console.log('预发货日期', dateString)
  652. this.queryParam.preDeliveryDate = dateString
  653. },
  654. searchQuery() {
  655. if(this.queryParam.flourOrGarment === ''){
  656. this.$message.error('请选择查询类型!');
  657. }else {
  658. this.queryParam.pageNo = ''
  659. this.getShipmentList()
  660. }
  661. },
  662. searchReset() {
  663. this.queryParam.documentNo = ''
  664. this.queryParam.timeRange = []
  665. this.queryParam.startTime = ''
  666. this.queryParam.endTime = ''
  667. this.queryParam.preDeliveryDate = ''
  668. this.queryParam.salesman = ''
  669. this.queryParam.itemNumber = ''
  670. this.queryParam.refer = ''
  671. this.queryParam.isTc = ''
  672. this.shipmentListData = [] // 渲染 发运明细列表
  673. },
  674. // 分页变化时触发
  675. handleTableChange(pagination, filters, sorter) {
  676. this.queryParam.pageNo = pagination.current
  677. this.getShipmentList()
  678. }
  679. }
  680. }
  681. </script>
  682. <style lang="less" scoped>
  683. @import '~@assets/less/common.less';
  684. @import '~@assets/less/overwriter.less';
  685. /deep/ .ant-table-thead > tr > th {
  686. text-align: center;
  687. // font-weight: 700;
  688. }
  689. /deep/ .ant-table-tbody {
  690. text-align: center;
  691. }
  692. // /deep/ th.replacecolor {
  693. // background-color: #ccc;
  694. // }
  695. /deep/ .ant-form-item {
  696. // margin-bottom: 0 !important;
  697. }
  698. </style>