shipmentList.vue 28 KB

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