shipmentList.vue 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343
  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="25">
  9. <a-col :md="5" :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="5" :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="5" :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. <a-col :md="5" :sm="8">
  29. <a-form-item label="预发货日期">
  30. <a-range-picker
  31. :placeholder="['开始时间', '结束时间']"
  32. format="YYYY-MM-DD"
  33. style="width: 100%"
  34. v-model="preDeliveryDate"
  35. @change="deliveryDateChange"
  36. />
  37. </a-form-item>
  38. </a-col>
  39. <template v-if="toggleSearchStatus">
  40. <a-col :md="5" :sm="8">
  41. <a-form-item label="账套号">
  42. <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
  43. <j-search-select-tag
  44. placeholder="请选择账套号"
  45. v-model="queryParam.account"
  46. dict="view_account,account,account">
  47. </j-search-select-tag>
  48. </a-form-item>
  49. </a-col>
  50. <a-col :md="5" :sm="8">
  51. <a-form-item label="业务员">
  52. <!-- <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input> -->
  53. <j-search-select-tag
  54. placeholder="请选择业务员"
  55. v-model="queryParam.salesman"
  56. dict="view_salesman,salesman,salesman">
  57. </j-search-select-tag>
  58. </a-form-item>
  59. </a-col>
  60. <a-col :md="5" :sm="8">
  61. <a-form-item label="是否被参照">
  62. <a-select v-model="queryParam.refer">
  63. <a-select-option value="">请选择</a-select-option>
  64. <a-select-option value="0">否</a-select-option>
  65. <a-select-option value="1">是</a-select-option>
  66. </a-select>
  67. </a-form-item>
  68. </a-col>
  69. <a-col :md="5" :sm="8">
  70. <a-form-item label="是否提交">
  71. <a-select v-model="queryParam.submitStatus">
  72. <a-select-option value="">请选择</a-select-option>
  73. <a-select-option value="0">否</a-select-option>
  74. <a-select-option value="1">是</a-select-option>
  75. </a-select>
  76. </a-form-item>
  77. </a-col>
  78. <a-col :md="5" :sm="8">
  79. <a-form-item label="小po">
  80. <a-input placeholder="请输入小po" v-model="queryParam.smallPo"></a-input>
  81. </a-form-item>
  82. </a-col>
  83. <a-col :md="5" :sm="8">
  84. <a-form-item label="起始时间">
  85. <a-range-picker
  86. style="width: 100%"
  87. v-model="timeRange"
  88. format="YYYY-MM-DD"
  89. :placeholder="['开始时间', '结束时间']"
  90. @change="onDateChange"
  91. @ok="onDateOk"
  92. />
  93. </a-form-item>
  94. </a-col>
  95. <a-col :md="5" :sm="8">
  96. <a-form-item label="供应商">
  97. <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
  98. <j-search-select-tag
  99. placeholder="请选择供应商"
  100. v-model="queryParam.supplier"
  101. dict="view_supplier,supplier,supplier">
  102. </j-search-select-tag>
  103. </a-form-item>
  104. </a-col>
  105. <a-col :md="5" :sm="8">
  106. <a-form-item label="分销点">
  107. <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
  108. <j-search-select-tag
  109. placeholder="请选择分销点"
  110. v-model="queryParam.distributionPoint"
  111. dict="view_distributionpoint,distributionPoint,distributionPoint">
  112. </j-search-select-tag>
  113. </a-form-item>
  114. </a-col>
  115. <a-col :md="5" :sm="8">
  116. <a-form-item label="客户简称">
  117. <!-- <a-input placeholder="请输入供应商" v-model="queryParam.supplier"></a-input> -->
  118. <j-search-select-tag
  119. placeholder="请选择客户简称"
  120. v-model="queryParam.customerAbbreviation"
  121. dict="view_customer,customername,customername">
  122. </j-search-select-tag>
  123. </a-form-item>
  124. </a-col>
  125. <a-col :md="5" :sm="8">
  126. <a-form-model-item label="申报要素是否维护">
  127. <a-select v-model="queryParam.isElement">
  128. <a-select-option value="">请选择</a-select-option>
  129. <a-select-option value="1">已维护</a-select-option>
  130. <a-select-option value="0">未维护</a-select-option>
  131. </a-select>
  132. </a-form-model-item>
  133. </a-col>
  134. <a-col :md="5" :sm="8">
  135. <a-form-model-item label="是否全选">
  136. <a-select v-model="allList">
  137. <a-select-option value="1">全选</a-select-option>
  138. <a-select-option value="0">勾选</a-select-option>
  139. </a-select>
  140. </a-form-model-item>
  141. </a-col>
  142. </template>
  143. <a-col :md="4" :sm="8">
  144. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  145. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  146. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  147. <a @click="handleToggleSearch" style="margin-left: 8px">
  148. {{ toggleSearchStatus ? '收起' : '展开' }}
  149. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  150. </a>
  151. </span>
  152. </a-col>
  153. </a-row>
  154. </a-form>
  155. </div>
  156. </a-card>
  157. <!-- 操作按钮区域 -->
  158. <a-spin :spinning="loading">
  159. <a-card :bordered="false" style=" marginTop:10px;">
  160. <div class="table-operator">
  161. <!-- <a-button type="primary" @click.stop="addShipDet" icon="plus">新增</a-button> -->
  162. <a-button type="primary" @click.stop="referOrderDataOpen" icon="plus" >参照订单数据</a-button>
  163. <a-button type="primary" icon="download" @click="handleExportXls('出运成衣')" :disabled="exportButton == '1'">成衣导出-预装箱单</a-button>
  164. <a-button type="primary" icon="download" @click="handleExportXls('出运面辅料')" :disabled="exportButton1 == '1'">面辅料导出-装箱单</a-button>
  165. <a-button type="primary" icon="download" @click="exportXlsShipment('出运明细列表')">出运明细导出</a-button>
  166. <a-button type="primary" icon="check" @click="submit">批量提交</a-button>
  167. <a-button type="primary" icon="close" @click="cancelSubmit">批量取消提交</a-button>
  168. <a-button type="primary" icon="close" @click="batchDelete">批量删除</a-button>
  169. </div>
  170. <!-- 测试 -->
  171. <ve-table :columns="columns" :virtual-scroll-option="virtualScrollOption" :max-height="600" :table-data="shipmentListData" style="width:100%" :border-y="true" :sort-option="sortOption" :scroll-width="1500" row-key-field-name="itemIds" :checkbox-option="checkboxOption">
  172. </ve-table>
  173. <div v-show="showEmpty" class="empty-data">暂无数据</div>
  174. <span style="margin-right: 55%;">共勾选{{selectedNumber}}条数</span>
  175. <span >总数量:{{ allMoney }}</span>
  176. </a-card>
  177. </a-spin>
  178. <!-- 抽屉 -->
  179. <div>
  180. <!-- <addShipDet-drawer ref="addShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk" @close="closeAdd"></addShipDet-drawer> -->
  181. <!-- 参照订单数据 -->
  182. <referOrderData-modal ref="referOrderDataModal" @close="closeAdd" ></referOrderData-modal>
  183. <editShipDet-drawer ref="editShipDetDrawer" :fatherList="getShipmentList" @ok="modalFormOk" @close='closeAddEdit'></editShipDet-drawer>
  184. <detailsShipDet-drawer ref="detailsShipDetDrawer" @ok="modalFormOk"></detailsShipDet-drawer>
  185. <!-- 申报要素 弹框 -->
  186. <declareElements-modal ref="declareElementsModal" @table="getShipmentList" @save-information="saveInformation" @close-declare="closeDeclare" @close-data="closeData"></declareElements-modal>
  187. <!-- 维护款号成分 -->
  188. <itemNumEle-modal ref="itemNumEleModal" @close="closeItemNumEle" @closeItem="changeList"></itemNumEle-modal>
  189. </div>
  190. </div>
  191. </template>
  192. <script>
  193. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  194. import JEllipsis from '@/components/jeecg/JEllipsis'
  195. import moment from 'moment'
  196. import { downFile } from '@/api/manage'
  197. import addShipDetDrawer from '@views/shipment-details/addShipDetDrawer.vue'
  198. import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.vue'
  199. import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
  200. import declareElementsModal from '@views/shipment-details/declareElementsModal.vue'
  201. import Drapp from './dropp.vue'
  202. import ReferOrderDataModal from '@views/shipment-details/referOrderDataModal.vue'
  203. import itemNumEleModal from '@views/shipment-details/itemNumEleModal.vue'
  204. import { randomUUID } from '@/utils/util'
  205. import { USER_AUTH } from "@/store/mutation-types"
  206. import {
  207. shipmentList,
  208. deleteShipment,
  209. submitShipment,
  210. shipmentQueryById,
  211. queryByDetails,
  212. queryDeclarationElements,
  213. cancelSubmitShipment,
  214. pushShipment,
  215. rePushShipment,
  216. exportXls,
  217. listExportXls,
  218. deleteBatch
  219. } from '@api/document/shipmentList'
  220. export default {
  221. name: 'ShipmentList', // 发运明细列表
  222. mixins: [JeecgListMixin],
  223. components: {
  224. JEllipsis,
  225. moment,
  226. addShipDetDrawer,
  227. detailsShipDetDrawer,
  228. editShipDetDrawer,
  229. declareElementsModal,
  230. ReferOrderDataModal,
  231. cancelSubmitShipment,
  232. pushShipment,
  233. rePushShipment,
  234. itemNumEleModal,
  235. Drapp,
  236. },
  237. data() {
  238. let ellipsis = (v,l) => <j-ellipsis value={v} length={l} />
  239. return {
  240. loading: false, // 表格加载
  241. exportButton: '1',
  242. exportButton1:'1',
  243. id: '',
  244. authority:true,
  245. selectedNumber:0,//已选择条数
  246. monthStartDate:'',//本月1号
  247. nextMonthStartDate:'',//下月1号
  248. nextMonthEndDate:'',//下月最后一天
  249. allList:'0',
  250. virtualScrollOption: {
  251. // 是否开启
  252. enable: false,
  253. },
  254. checkboxOption: {
  255. selectedRowKeys: [],
  256. // 行选择改变事件
  257. selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
  258. this.checkboxOption.selectedRowKeys = selectedRowKeys
  259. this.selectedRowKeys = selectedRowKeys;
  260. this.selectedRows.push(row);
  261. this.selectedNumber =this.selectedRowKeys.length
  262. },
  263. // 全选改变事件
  264. selectedAllChange: ({ isSelected, selectedRowKeys }) => {
  265. this.checkboxOption.selectedRowKeys = []
  266. this.checkboxOption.selectedRowKeys = selectedRowKeys
  267. this.selectedRowKeys = selectedRowKeys;
  268. if(isSelected){
  269. this.selectedRows = this.shipmentListData
  270. }else{
  271. this.selectedRows = []
  272. }
  273. this.selectedNumber =this.selectedRowKeys.length
  274. },
  275. },
  276. sortOption: {
  277. sortChange: (params) => {
  278. this.sortChange(params);
  279. },
  280. },
  281. shipmentListColumns: [
  282. {
  283. title: '账套',
  284. dataIndex: 'account',
  285. width: 85,
  286. fixed: 'left',
  287. ellipsis: true,
  288. className: 'replacecolor',
  289. sorter:(a, b) => a.account - b.account,
  290. },
  291. {
  292. title: '销售订单号',
  293. dataIndex: 'orderNumber',
  294. // fixed: 'left',
  295. // customRender: t => ellipsis(t,17),
  296. width: 180,
  297. ellipsis: true,
  298. className: 'replacecolor',
  299. sorter:(a, b) => a.orderNumber - b.orderNumber,
  300. },
  301. {
  302. title: '款号',
  303. dataIndex: 'itemNumber',
  304. width: 130,
  305. ellipsis: true,
  306. className: 'replacecolor',
  307. sorter:(a, b) => a.itemNumber - b.itemNumber,
  308. },
  309. {
  310. title: '业务员',
  311. dataIndex: 'salesman',
  312. width: 100,
  313. ellipsis: true,
  314. className: 'replacecolor',
  315. sorter:(a, b) => a.salesman - b.salesman,
  316. },
  317. {
  318. title: '分销点',
  319. dataIndex: 'distributionPoint',
  320. width: 110,
  321. ellipsis: true,
  322. className: 'replacecolor',
  323. sorter:(a, b) => a.distributionPoint - b.distributionPoint,
  324. },
  325. {
  326. title: '小po',
  327. dataIndex: 'smallPo',
  328. width: 110,
  329. ellipsis: true,
  330. className: 'replacecolor',
  331. sorter:(a, b) => a.smallPo - b.smallPo,
  332. },
  333. {
  334. title: '存货名称',
  335. dataIndex: 'inventoryName',
  336. width: 220,
  337. className: 'replacecolor',
  338. ellipsis: true,
  339. sorter:(a, b) => a.inventoryName - b.inventoryName,
  340. },
  341. {
  342. title: '报关品名',
  343. dataIndex: 'declarationName',
  344. width: 175,
  345. className: 'replacecolor',
  346. ellipsis: true,
  347. sorter:(a, b) => a.declarationName - b.declarationName,
  348. },
  349. {
  350. title: '是否TC',
  351. dataIndex: 'isTc',
  352. width: 110,
  353. customRender: function(text) {
  354. if (text === '0') {
  355. return '否'
  356. }
  357. if (text === '1') {
  358. return '是'
  359. }
  360. },
  361. className: 'replacecolor',
  362. sorter:(a, b) => a.isTc - b.isTc,
  363. },
  364. {
  365. title: '预发货日期',
  366. dataIndex: 'preDeliveryDate',
  367. width: 120,
  368. customRender: text => {
  369. if (text == "" || text == null)
  370. return "";
  371. return moment(text).format('YYYY-MM-DD')
  372. },
  373. ellipsis: true,
  374. className: 'replacecolor',
  375. sorter:(a, b) => a.preDeliveryDate - b.preDeliveryDate,
  376. },
  377. {
  378. title: '数量',
  379. dataIndex: 'shipmentQuantity',
  380. width: 80,
  381. ellipsis: true,
  382. className: 'replacecolor',
  383. sorter:(a, b) => a.shipmentQuantity - b.shipmentQuantity,
  384. },
  385. {
  386. title: '报关单价',
  387. dataIndex: 'customsDeclarationUnitPrice',
  388. width: 80,
  389. className: 'replacecolor',
  390. ellipsis: true,
  391. sorter:(a, b) => a.customsDeclarationUnitPrice - b.customsDeclarationUnitPrice,
  392. },
  393. {
  394. title: '成衣工厂',
  395. dataIndex: 'garmentFactory',
  396. width: 100,
  397. className: 'replacecolor',
  398. ellipsis: true,
  399. sorter:(a, b) => a.garmentFactory - b.garmentFactory,
  400. },
  401. {
  402. title: 'HScode',
  403. dataIndex: 'hsCode',
  404. width: 120,
  405. className: 'replacecolor',
  406. ellipsis: true,
  407. sorter:(a, b) => a.hsCode - b.hsCode,
  408. },
  409. {
  410. title: '英文品名',
  411. dataIndex: 'englishProductName',
  412. width: 110,
  413. className: 'replacecolor',
  414. // customRender: t => ellipsis(t),
  415. ellipsis: true,
  416. sorter:(a, b) => a.englishProductName - b.englishProductName,
  417. },
  418. {
  419. title: '物料成分',
  420. dataIndex: 'materialComposition',
  421. width: 180,
  422. ellipsis: true,
  423. className: 'replacecolor',
  424. ellipsis: true,
  425. sorter:(a, b) => a.materialComposition - b.materialComposition,
  426. },
  427. {
  428. title: '采购/委外订单号',
  429. dataIndex: 'purOrSubOrder',
  430. width: 140,
  431. className: 'replacecolor',
  432. ellipsis: true,
  433. sorter:(a, b) => a.purOrSubOrder - b.purOrSubOrder,
  434. },
  435. {
  436. // (存货自定义项)
  437. title: '套装件数',
  438. dataIndex: 'numberOfSets',
  439. width: 90,
  440. className: 'replacecolor',
  441. ellipsis: true,
  442. sorter:(a, b) => a.numberOfSets - b.numberOfSets,
  443. },
  444. {
  445. title: 'pack id',
  446. dataIndex: 'packId',
  447. width: 110,
  448. ellipsis: true,
  449. className: 'replacecolor',
  450. sorter:(a, b) => a.packId - b.packId,
  451. },
  452. {
  453. title: '客户简称',
  454. dataIndex: 'customerAbbreviation',
  455. width: 100,
  456. align: 'left',
  457. ellipsis: true,
  458. className: 'replacecolor',
  459. sorter:(a, b) => a.customerAbbreviation - b.customerAbbreviation,
  460. },
  461. {
  462. title: '部门',
  463. dataIndex: 'salesDepartment',
  464. width: 100,
  465. ellipsis: true,
  466. className: 'replacecolor',
  467. sorter:(a, b) => a.salesDepartment - b.salesDepartment,
  468. },
  469. {
  470. title: '单据号',
  471. dataIndex: 'documentNo',
  472. // fixed: 'left',
  473. align: 'left',
  474. width: 140,
  475. ellipsis: true,
  476. className: 'replacecolor',
  477. sorter:(a, b) => a.documentNo - b.documentNo,
  478. },
  479. // {
  480. // title: '推送结果',
  481. // dataIndex: 'pushState',
  482. // scopedSlots: { customRender: 'pushState' },
  483. // fixed: 'right',
  484. // width: 110,
  485. // className: 'replacecolor',
  486. // sorter:(a, b) => a.pushState - b.pushState,
  487. // },
  488. {
  489. title: '单据状态',
  490. dataIndex: 'submitStatus',
  491. scopedSlots: { customRender: 'state' },
  492. fixed: 'right',
  493. width: 110,
  494. className: 'replacecolor',
  495. sorter:(a, b) => a.submitStatus - b.submitStatus,
  496. },
  497. {
  498. title: '操作',
  499. dataIndex: 'operation',
  500. scopedSlots: { customRender: 'operationSlot' },
  501. fixed: 'right',
  502. width: 250,
  503. className: 'replacecolor',
  504. }
  505. ],
  506. shipmentListData: [], // 发运明细数据
  507. allMoney:'',
  508. copyTableData:[],//保存还未更新时的申报要素列表信息
  509. copyFromData:{},////保存修改报关要素所点击得那行数据
  510. // 查询条件
  511. queryParam: {
  512. flourOrGarment:'1'
  513. },
  514. selectedRowKeys:[],
  515. selectedRows:[],
  516. timeRange:[],//起始时间
  517. preDeliveryDate:[],//预发货日期
  518. returnId:'',//新增后返回的id筛选条件
  519. returnFlourOrGarment:'',//新增后返回类型条件
  520. showEmpty:true,
  521. pagination: {
  522. // total: '',
  523. // current: 0,
  524. // pageSize: 0
  525. },
  526. columns: [
  527. {field: "",key: "ju",type: "checkbox",title: "",width: 50, align: "center",ellipsis: {showTitle: true,},},
  528. { field: "account", key: "a", title: "账套", align: "center", width: 85,sortBy: "",ellipsis: {showTitle: true,},},
  529. { field: "orderNumber", key: "b", title: "销售订单号", align: "center",width: 180,sortBy: "",ellipsis: {showTitle: true,}, },
  530. { field: "itemNumber", key: "c", title: "款号", align: "center",width: 130,sortBy: "",ellipsis: {showTitle: true,}, },
  531. { field: "salesman", key: "d", title: "业务员", align: "center", width: 100,sortBy: "", ellipsis: {showTitle: true,},},
  532. { field: "distributionPoint", key: "e", title: "分销点", align: "center", width: 110,sortBy: "", ellipsis: {showTitle: true,},},
  533. { field: "smallPo", key: "f", title: "小po", align: "center", width: 110,sortBy: "", ellipsis: {showTitle: true,},},
  534. { field: "inventoryName", key: "g", title: "存货名称", align: "center", width: 220,sortBy: "", ellipsis: {showTitle: true,},},
  535. { field: "declarationName", key: "h", title: "报关品名", align: "center", width: 175,sortBy: "",ellipsis: {showTitle: true,}, },
  536. { field: "isTc", key: "i", title: "是否TC", align: "center", width: 110,sortBy: "", ellipsis: {showTitle: true,}, renderBodyCell: ({ row, column, rowIndex }, h) => {
  537. const text = row[column.field];
  538. if(text=='0'){
  539. return (
  540. <span>否</span>
  541. )
  542. }else{
  543. return (
  544. <span>是</span>
  545. );
  546. }
  547. },},
  548. { field: "preDeliveryDate", key: "j", title: "预发货日期", align: "center", width: 120,sortBy: "", ellipsis: {showTitle: true,}, },
  549. { field: "shipmentQuantity", key: "k", title: "数量", align: "center", width: 80,sortBy: "", ellipsis: {showTitle: true,},},
  550. { field: "customsDeclarationUnitPrice", key: "m", title: "报关单价", align: "center", width: 100,sortBy: "",ellipsis: {showTitle: true,}, },
  551. { field: "garmentFactory", key: "l", title: "成衣工厂", align: "center", width: 100,sortBy: "" ,ellipsis: {showTitle: true,},},
  552. { field: "hsCode", key: "n", title: "HScode", align: "center", width: 120,sortBy: "",ellipsis: {showTitle: true,}, },
  553. { field: "englishProductName", key: "o", title: "英文品名", align: "center", width: 110,sortBy: "",ellipsis: {showTitle: true,}, },
  554. { field: "materialComposition", key: "p", title: "物料成分", align: "center", width: 180,sortBy: "",ellipsis: {showTitle: true,}, },
  555. { field: "purOrSubOrder", key: "q", title: "采购/委外订单号", align: "center", width: 180,sortBy: "",ellipsis: {showTitle: true,}, },
  556. { field: "numberOfSets", key: "r", title: "套装件数", align: "center", width: 100,sortBy: "",ellipsis: {showTitle: true,}, },
  557. { field: "packId", key: "s", title: "pack id", align: "center", width: 110,sortBy: "",ellipsis: {showTitle: true,}, },
  558. { field: "customerAbbreviation", key: "t", title: "客户简称", align: "center", width: 100,sortBy: "",ellipsis: {showTitle: true,}, },
  559. { field: "salesDepartment", key: "u", title: "部门", align: "center", width: 100,sortBy: "",ellipsis: {showTitle: true,}, },
  560. { field: "documentNo", key: "v", title: "单据号", align: "center", width: 140,sortBy: "",ellipsis: {showTitle: true,}, },
  561. { field: "submitStatus", key: "w", title: "单据状态",fixed: "right", align: "center", width: 110,sortBy: "" ,ellipsis: {showTitle: true,}, renderBodyCell: ({ row, column, rowIndex }, h) => {
  562. const text = row[column.field];
  563. if(text=='0'){
  564. return (
  565. <a-tag color="orange" >已保存</a-tag>
  566. )
  567. }else{
  568. return (
  569. <a-tag color="green">已提交</a-tag>
  570. );
  571. }
  572. }},
  573. { field: "operation", key: "x",fixed: "right" , title: "操作", align: "center", width: 250, renderBodyCell: ({ row, column, rowIndex }, h) => {
  574. return <Drapp row={row} column={column} rowIndex={rowIndex} on-details={() => this.details(row)} on-push={() => this.push(row)} on-rePush={() => this.rePush(row)} on-edit={() => this.edit(row)} on-handleDelete={() => this.handleDelete(row)} on-triggerT={() => this.declareElements(row)} on-triggerW={()=>this.itemNumberElement(row)}/>;
  575. }}
  576. ],
  577. tableData: [
  578. {
  579. account:'1',
  580. orderNumber:'2',
  581. itemNumber:'3',
  582. salesman:'4',
  583. itemIds:'1'
  584. },
  585. {
  586. account:'2',
  587. orderNumber:'2',
  588. itemNumber:'3',
  589. salesman:'4',
  590. itemIds:'2'
  591. },
  592. {
  593. account:'3',
  594. orderNumber:'2',
  595. itemNumber:'3',
  596. salesman:'4',
  597. itemIds:'3'
  598. },
  599. ],
  600. dateFormat: 'YYYY-MM-DD',
  601. }
  602. },
  603. created() {
  604. // this.getShipmentList() // 渲染 发运明细列表
  605. // this.defalutDate()
  606. },
  607. mounted(){
  608. },
  609. methods: {
  610. moment,
  611. //默认预发货日期
  612. defalutDate(){
  613. var now = new Date(); //当前日期
  614. var nowMonth = now.getMonth(); //当前月
  615. var nextMonth = nowMonth+1; //下个月
  616. var nowYear = now.getFullYear(); //当前年
  617. this.monthStartDate = moment(new Date(nowYear, nowMonth, 1)).format('YYYY-MM-DD');
  618. this.nextMonthStartDate = moment(new Date(nowYear, nextMonth, 1)).format('YYYY-MM-DD');
  619. if([1, 3, 5, 7, 8, 10, 12].indexOf(nextMonth+1) > -1){
  620. this.nextMonthEndDate = moment(new Date(nowYear, nextMonth, 31)).format('YYYY-MM-DD');
  621. }else {
  622. this.nextMonthEndDate = moment(new Date(nowYear, nextMonth, 30)).format('YYYY-MM-DD');
  623. }
  624. this.preDeliveryDate.push(this.nextMonthStartDate,this.nextMonthEndDate)
  625. this.queryParam.preDeliveryDateB = this.nextMonthStartDate
  626. this.queryParam.preDeliveryDateE = this.nextMonthEndDate
  627. },
  628. // 分页查询 发运明细
  629. async getShipmentList() {
  630. this.loading = true
  631. this.copyTableData = []
  632. this.copyFromData = {} //保存修改报关要素所点击得那行数据
  633. await shipmentList(this.queryParam).then(res => {
  634. if (res.success) {
  635. this.loading = false
  636. this.allMoney = res.message
  637. if(this.queryParam.flourOrGarment == '1'){
  638. this.exportButton ='0'
  639. this.exportButton1 = '1'
  640. }else {
  641. this.exportButton ='1'
  642. this.exportButton1 = '0'
  643. }
  644. let allAuthes = JSON.parse(sessionStorage.getItem(USER_AUTH));
  645. var quanXian = []
  646. allAuthes.map(item=>{ quanXian.push(item.action)})
  647. if(quanXian.indexOf('cymx:sbys')==-1 && this.queryParam.flourOrGarment=='0'){
  648. this.authority = true
  649. }else if(quanXian.indexOf('cymx:sbys')==-1 && this.queryParam.flourOrGarment=='1'){
  650. this.authority = false
  651. }
  652. this.shipmentListData = res.result.records
  653. this.showEmpty = this.shipmentListData.length==0?true:false
  654. this.virtualScrollOption.enable = this.shipmentListData.length>500?true:false
  655. for (var i=0; i<this.shipmentListData.length; i++){
  656. this.shipmentListData.randomId = randomUUID();
  657. }
  658. this.selectedRowKeys = []
  659. this.checkboxOption.selectedRowKeys = []
  660. }else {
  661. this.$message.error(res.message)
  662. this.loading = false
  663. }
  664. })
  665. },
  666. //关闭申报要素弹窗
  667. async closeDeclare(){
  668. //判断是否是新增的数据
  669. // await this.judageAdd()
  670. var cc = []
  671. this.shipmentListData.map(item =>{
  672. this.selectedRows.map(item1 =>{
  673. if(item.itemIds == item1.itemIds){
  674. cc.push(item)
  675. }
  676. })
  677. })
  678. this.selectedRows = cc
  679. cc.map(item => this.selectedRowKeys.push(item.itemIds))
  680. },
  681. saveInformation(data){
  682. this.copyTableData = data.syDeclarationElementsItemList
  683. },
  684. //关闭维护款号成分弹窗
  685. closeItemNumEle(){
  686. },
  687. changeList(data,record){
  688. this.shipmentListData.map(item=>{
  689. if(item.itemNumber == record.itemNumber && item.inventoryName==record.inventoryName && item.orderNumber == record.orderNumber){
  690. item.isTc = data.isTc
  691. item.materialComposition = data.materialComposition
  692. }
  693. })
  694. },
  695. closeData(data,record){
  696. this.copyFromData = record//保存修改报关要素所点击得那行数据
  697. this.shipmentListData.map(item=>{
  698. if(item.orderNumber == record.orderNumber && item.itemNumber==record.itemNumber && item.account == record.account&& item.inventoryName == record.inventoryName){
  699. item.declarationName = data.declarationName
  700. item.hsCode = data.hsCode
  701. item.englishProductName = data.englishProductName
  702. }
  703. })
  704. },
  705. // // 新增
  706. // addShipDet() {
  707. // this.$refs.addShipDetDrawer.syShippingDetailsItemList = [];
  708. // this.$refs.addShipDetDrawer.visible = true
  709. // },
  710. //参照订单数据
  711. referOrderDataOpen(){
  712. this.$refs.referOrderDataModal.referOrderDataModVis = true
  713. this.$refs.referOrderDataModal.range.push(this.monthStartDate)
  714. this.$refs.referOrderDataModal.queryParam.preDeliveryDateS = this.monthStartDate;
  715. this.$refs.referOrderDataModal.queryParam.preDeliveryDateE = '';
  716. },
  717. // 申报要素
  718. declareElements(record) {
  719. if (record.inventoryName == ""){
  720. this.$message.error('当前行存货名称为空,无法维护报关要素');
  721. }else{
  722. this.$refs.declareElementsModal.declareElementsModVis = true
  723. queryDeclarationElements({
  724. id: record.elementsId,
  725. syShippingids:record.itemIds
  726. }).then(res => {
  727. if (res.success) {
  728. // console.log('申报要素子表数据', res.result.syDeclarationElementsItemList)
  729. res.result['itemIds'] = record.itemIds;
  730. this.$refs.declareElementsModal.declareElements = res.result
  731. this.$refs.declareElementsModal.declareElements.declarationName = record.declarationName
  732. this.$refs.declareElementsModal.declareElements.englishProductName = record.englishProductName
  733. this.$refs.declareElementsModal.declareElements.hsCode = record.hsCode
  734. this.$refs.declareElementsModal.flourOrGarment = this.queryParam.flourOrGarment
  735. this.$refs.declareElementsModal.orderNumber = record.orderNumber
  736. this.$refs.declareElementsModal.record = record
  737. if(!res.result.hsCode || res.result.hsCode == ''){
  738. this.$refs.declareElementsModal.query = '0'
  739. }else{
  740. this.$refs.declareElementsModal.query = '1'
  741. }
  742. //判断报关要素保存时子表是否有数据以及再次点击时所点击行和报关要素修改行满不满足带出子表得条件
  743. if(this.copyTableData.length==0||!(this.copyFromData.orderNumber == record.orderNumber && this.copyFromData.itemNumber==record.itemNumber && this.copyFromData.account == record.account&& this.copyFromData.inventoryName == record.inventoryName)){
  744. // 子表赋值
  745. this.$refs.declareElementsModal.declareElementsData = res.result.syDeclarationElementsItemList
  746. }else{
  747. this.$refs.declareElementsModal.declareElementsData = this.copyTableData
  748. }
  749. if(record.pushState == '1' && record.submitStatus == '1'){
  750. this.$refs.declareElementsModal.pushState = true
  751. }
  752. }
  753. })
  754. }
  755. },
  756. // 维护款号成分
  757. itemNumberElement(record) {
  758. this.$refs.itemNumEleModal.itemNumEleModVis = true
  759. this.$refs.itemNumEleModal.editItemNumber.itemIds = record.itemIds
  760. this.$refs.itemNumEleModal.editItemNumber.itemNumber = record.itemNumber
  761. this.$refs.itemNumEleModal.record = record
  762. this.$refs.itemNumEleModal.editItemNumber.materialComposition = record.materialComposition
  763. this.$refs.itemNumEleModal.editItemNumber.isTc = record.isTc
  764. if(record.materialComposition == '' || !record.materialComposition){
  765. var ccode = record.inventoryCcode.substring(0,2);
  766. if(ccode =='19'){ //如果是成衣取规格型号,否则取物料名称
  767. this.$refs.itemNumEleModal.editItemNumber.materialComposition = record.specificationAndModel
  768. }else{
  769. var split = record.inventoryName.split(" ");
  770. this.$refs.itemNumEleModal.editItemNumber.materialComposition = split[0];
  771. }
  772. }
  773. },
  774. //判断是否是新增的数据-刷新数据
  775. async judageAdd(){
  776. await this.getShipmentList()
  777. // if(!this.queryParam.flourOrGarment || this.queryParam.flourOrGarment == ''){
  778. // // this.queryParam ={}
  779. // this.queryParam.id = this.returnId
  780. // this.queryParam.flourOrGarment =this.returnFlourOrGarment
  781. // await this.getShipmentList()
  782. // // this.queryParam = {}
  783. // // this.defalutDate()
  784. // }else{
  785. // await this.getShipmentList()
  786. // }
  787. },
  788. // 导出
  789. handleExportXls(fileName) {
  790. if(!this.queryParam.flourOrGarment || this.queryParam.flourOrGarment == ''){
  791. this.queryParam ={}
  792. this.queryParam.id = this.returnId
  793. this.queryParam.flourOrGarment =this.returnFlourOrGarment
  794. }
  795. var obj ={},
  796. yesA = 'yes'
  797. if(this.allList == '1'){
  798. obj = this.queryParam
  799. obj.selectAll = '1'
  800. }else{
  801. if( this.selectedRowKeys.length==0){
  802. this.$message.error('请勾引数据')
  803. yesA = 'no'
  804. }else{
  805. var grouyIdList=[]
  806. this.shipmentListData.map(item=>{
  807. this.selectedRowKeys.map(e=>{
  808. if(item.itemIds == e){
  809. grouyIdList.push(item.groupId)
  810. }
  811. })
  812. })
  813. obj.groupidList = grouyIdList.toString()
  814. obj.selectAll = '0'
  815. obj.flourOrGarment =this.queryParam.flourOrGarment
  816. }
  817. }
  818. if(yesA == 'yes'){
  819. this.loading = true
  820. exportXls(obj).then(res =>{
  821. if(res.success==false){
  822. this.$message.error(res.message)
  823. }else{
  824. downFile('/shippingDetails/syShippingDetails/exportXls',obj).then(data => {
  825. this.loading = false
  826. // this.queryParam = {}
  827. // this.defalutDate()
  828. if (!data) {
  829. this.$message.warning('文件下载失败')
  830. return
  831. }
  832. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  833. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  834. } else {
  835. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  836. let link = document.createElement('a')
  837. link.style.display = 'none'
  838. link.href = url
  839. link.setAttribute('download', fileName + '.xlsx')
  840. document.body.appendChild(link)
  841. link.click()
  842. document.body.removeChild(link) // 下载完成移除元素
  843. window.URL.revokeObjectURL(url) // 释放掉blob对象
  844. }
  845. })
  846. }
  847. })
  848. }
  849. },
  850. //明细导出
  851. exportXlsShipment(fileName){
  852. var obj ={},
  853. yesA = 'yes'
  854. if(this.allList == '1'){
  855. obj = this.queryParam
  856. obj.selectAll = '1'
  857. }else{
  858. if(this.selectedRowKeys.length==0){
  859. this.$message.error('请勾引数据')
  860. yesA = 'no'
  861. }else{
  862. var grouyIdList=[]
  863. this.shipmentListData.map(item=>{
  864. this.selectedRowKeys.map(e=>{
  865. if(item.itemIds == e){
  866. grouyIdList.push(item.groupId)
  867. }
  868. })
  869. })
  870. obj.groupidList = grouyIdList.toString()
  871. obj.selectAll = '0'
  872. obj.flourOrGarment =this.queryParam.flourOrGarment
  873. }
  874. }
  875. if( yesA == 'yes'){
  876. this.loading = true
  877. listExportXls(obj).then(res =>{
  878. if(res.success==false){
  879. this.$message.error(res.message)
  880. }else{
  881. downFile('/shippingDetails/syShippingDetails/exportXlsShipping',obj).then(data => {
  882. this.loading = false
  883. if (!data) {
  884. this.$message.warning('文件下载失败')
  885. return
  886. }
  887. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  888. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  889. } else {
  890. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  891. let link = document.createElement('a')
  892. link.style.display = 'none'
  893. link.href = url
  894. link.setAttribute('download', fileName + '.xlsx')
  895. document.body.appendChild(link)
  896. link.click()
  897. document.body.removeChild(link) // 下载完成移除元素
  898. window.URL.revokeObjectURL(url) // 释放掉blob对象
  899. }
  900. })
  901. }
  902. })
  903. }
  904. },
  905. // 编辑
  906. edit(record) {
  907. this.$refs.editShipDetDrawer.visible = true
  908. queryByDetails({ id: record.id,itemIds: record.itemIds }).then(res => {
  909. if (res.success) {
  910. // console.log('编辑对象', res.result)
  911. this.$refs.editShipDetDrawer.editShipDet = res.result
  912. res.result.syShippingDetailsItemList.map(item =>{
  913. item.manualYarnFlag = res.result.syShippingDetailsItemList[0].mjudageAddanualYarnFlag
  914. item.customsDeclarationUnitPrice = item.salesUnitPrice - item.ymoney
  915. if(item.manualYarnFlag === 0){
  916. item.manualYarnUnitPrice = null
  917. item.manualYarnProportion = null
  918. this.$refs.editShipDetDrawer.manualYarnDisabled = true
  919. this.$forceUpdate()
  920. }else {
  921. this.$refs.editShipDetDrawer.manualYarnDisabled = false
  922. }
  923. })
  924. this.$refs.editShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
  925. this.$refs.editShipDetDrawer.readyFabric = this.queryParam.flourOrGarment
  926. }
  927. })
  928. },
  929. // 详情
  930. details(record) {
  931. this.$refs.detailsShipDetDrawer.visible = true
  932. queryByDetails({ id: record.id,itemIds: record.itemIds}).then(res => {
  933. if (res.success) {
  934. console.log('点击的对象', res.result)
  935. // 把通过id查询到的对象,赋值给子组件
  936. this.$refs.detailsShipDetDrawer.detailsShipDet = res.result
  937. this.$refs.detailsShipDetDrawer.syShippingDetailsItemList = res.result.syShippingDetailsItemList
  938. }
  939. })
  940. },
  941. // 提交
  942. submit() {
  943. this.$nextTick(() => {
  944. // for(var i =0;i<this.selectedRows.length;i++){
  945. // var selectRow = this.selectedRows[i]
  946. // if(selectRow.elementsId===''||!selectRow.elementsId){
  947. // this.$message.error('勾选的第'+(i+1)+'行数据报关要素未填写,不可提交!')
  948. // return
  949. // }
  950. // }
  951. var grouyIdList = []
  952. this.loading = true
  953. this.shipmentListData.map(item =>{
  954. this.selectedRowKeys.map(e=>{
  955. if(item.itemIds == e){
  956. grouyIdList.push(item.groupId)
  957. }
  958. })
  959. })
  960. submitShipment({ submitListId: this.selectedRowKeys, type: '1' ,grouyIdList:grouyIdList}).then(res => {
  961. this.loading = false
  962. if (res.success) {
  963. // this.shipmentListData.submitStatus = '1'
  964. this.shipmentListData.map(item =>{
  965. this.selectedRowKeys.map(e=>{
  966. if(item.itemIds == e){
  967. item.submitStatus = '1'
  968. }
  969. })
  970. })
  971. this.selectedRowKeys =[]
  972. this.checkboxOption.selectedRowKeys = []
  973. // this.judageAdd()
  974. // 渲染 发运明细列表
  975. this.$message.success('提交成功')
  976. }else {
  977. this.judageAdd()
  978. this.$message.error(res.message)
  979. }
  980. })
  981. })
  982. },
  983. // 取消提交
  984. cancelSubmit(record) {
  985. console.log('取消订单id:', record.id)
  986. this.$nextTick(() => {
  987. var grouyIdList = []
  988. this.loading = true
  989. this.shipmentListData.map(item =>{
  990. this.selectedRowKeys.map(e=>{
  991. if(item.itemIds == e){
  992. grouyIdList.push(item.groupId)
  993. }
  994. })
  995. })
  996. cancelSubmitShipment({ submitListId: this.selectedRowKeys, type: '2',grouyIdList:grouyIdList }).then(res => {
  997. this.loading = false
  998. if (res.success) {
  999. // this.shipmentListData.submitStatus = '0'
  1000. this.shipmentListData.map(item =>{
  1001. this.selectedRowKeys.map(e=>{
  1002. if(item.itemIds == e){
  1003. item.submitStatus = '0'
  1004. }
  1005. })
  1006. })
  1007. this.selectedRowKeys = []
  1008. // this.judageAdd()
  1009. this.$message.success('取消提交成功')
  1010. }else {
  1011. this.$message.error(res.message)
  1012. }
  1013. })
  1014. })
  1015. },
  1016. //批量删除
  1017. batchDelete(){
  1018. this.$nextTick(() => {
  1019. var itemId = [],
  1020. ids = []
  1021. this.loading = true
  1022. this.shipmentListData.map(item =>{
  1023. this.selectedRowKeys.map(e=>{
  1024. if(item.itemIds == e){
  1025. itemId.push(item.itemIds)
  1026. ids.push(item.id)
  1027. }
  1028. })
  1029. })
  1030. deleteBatch({ ids: ids.toString() ,itemId:itemId.toString()}).then(res => {
  1031. this.loading = false
  1032. if (res.success) {
  1033. // console.log('提交成功,单据状态改为【已提交】')
  1034. // this.shipmentListData.submitStatus = '1'
  1035. this.selectedRowKeys =[]
  1036. this.checkboxOption.selectedRowKeys = []
  1037. this.judageAdd()
  1038. // 渲染 发运明细列表
  1039. this.$message.success('批量成功')
  1040. }else {
  1041. this.judageAdd()
  1042. this.$message.error(res.message)
  1043. }
  1044. })
  1045. })
  1046. },
  1047. sortChange(params) {
  1048. this.shipmentListData.sort((a, b) => {
  1049. for (var key in params) {
  1050. if(params[key]){
  1051. if (params[key] === "asc") {
  1052. return a[key] - b[key];
  1053. } else if (params[key] === "desc") {
  1054. return b[key] - a[key];
  1055. } else {
  1056. return 0;
  1057. }
  1058. }
  1059. }
  1060. });
  1061. },
  1062. // 推送
  1063. push(record) {
  1064. console.log('推送id:', record.id)
  1065. this.$nextTick(() => {
  1066. if(this.queryParam.flourOrGarment == '1'){
  1067. this.$message.error("成衣不可推送!")
  1068. }else {
  1069. pushShipment({ id: record.id }).then(res => {
  1070. if (res.success) {
  1071. console.log('推送成功,推送状态【推送成功】')
  1072. this.shipmentListData.pushState = '1'
  1073. this.judageAdd()
  1074. this.$message.success('推送成功')
  1075. }else {
  1076. this.$message.error(res.message)
  1077. }
  1078. })
  1079. }
  1080. })
  1081. },
  1082. // 重新推送
  1083. rePush(record) {
  1084. console.log('重新推送record:', record)
  1085. this.$nextTick(() => {
  1086. if(this.queryParam.flourOrGarment == '1'){
  1087. this.$message.error("成衣不可推送!")
  1088. }else {
  1089. rePushShipment({ id: record.id }).then(res => {
  1090. if (res.success) {
  1091. console.log('重新推送成功,推送状态【推送成功】')
  1092. this.shipmentListData.pushState = '1'
  1093. this.judageAdd()
  1094. this.$message.success('重新推送成功')
  1095. }else {
  1096. this.$message.error(res.message)
  1097. }
  1098. })
  1099. }
  1100. })
  1101. },
  1102. // 删除
  1103. handleDelete(record) {
  1104. console.log('点击删除项id:', record.id)
  1105. this.$nextTick(() => {
  1106. deleteShipment({ id: record.id,itemIds: record.itemIds }).then(res => {
  1107. console.log('res:', res)
  1108. this.judageAdd() // 渲染 发运明细列表
  1109. this.$message.success('删除成功')
  1110. })
  1111. })
  1112. },
  1113. onDateChange(value, dateString) {
  1114. console.log('查询开始时间', dateString[0], '查询结束时间', dateString[1])
  1115. this.queryParam.startTime = dateString[0]
  1116. this.queryParam.endTime = dateString[1]
  1117. },
  1118. onDateOk(value) {
  1119. console.log('value', value)
  1120. },
  1121. deliveryDateChange(value, dateString) {
  1122. console.log('预发货日期', dateString)
  1123. this.queryParam.preDeliveryDateB = dateString[0]
  1124. this.queryParam.preDeliveryDateE = dateString[1]
  1125. },
  1126. searchQuery() {
  1127. this.toggleSearchStatus = false
  1128. if(this.queryParam.flourOrGarment === '' || !this.queryParam.hasOwnProperty('flourOrGarment')){
  1129. this.$message.error('请选择查询类型!');
  1130. }else if(this.queryParam.flourOrGarment == '1' &&
  1131. ((this.queryParam.itemNumber==''||!this.queryParam.itemNumber)&&
  1132. (this.queryParam.orderNumber==''||!this.queryParam.orderNumber)&&
  1133. (this.queryParam.salesman==''||!this.queryParam.salesman)&&
  1134. (this.queryParam.supplier==''||!this.queryParam.supplier)&&
  1135. (this.queryParam.customerAbbreviation==''||!this.queryParam.customerAbbreviation)&&
  1136. this.preDeliveryDate.length == 0
  1137. )){
  1138. this.$message.error('款号/订单号/预发货日期/业务员/供应商/客户均未选择!');
  1139. }else{
  1140. if(this.preDeliveryDate.length ==2){
  1141. var separator = "-"; //日期分隔符
  1142. var startDates = this.queryParam.preDeliveryDateB.split(separator);
  1143. var endDates = this.queryParam.preDeliveryDateE.split(separator);
  1144. var startDate = new Date(startDates[0], startDates[1]-1, startDates[2]);
  1145. var endDate = new Date(endDates[0], endDates[1]-1, endDates[2]);
  1146. var timeInterval= parseInt(Math.abs(endDate - startDate ) / 1000 / 60 / 60 /24) + 1;
  1147. if(timeInterval > 60){
  1148. this.$message.error('预发货时间区间超过60天,请重新选择!');
  1149. }else {
  1150. this.queryParam.id = ''
  1151. this.getShipmentList()
  1152. }
  1153. }else{
  1154. this.queryParam.id = ''
  1155. this.getShipmentList()
  1156. }
  1157. }
  1158. },
  1159. searchReset() {
  1160. this.queryParam = {
  1161. flourOrGarment:'1'
  1162. }
  1163. this.timeRange = []
  1164. this.preDeliveryDate = []
  1165. // this.defalutDate()
  1166. this.selectedRows = []
  1167. this.selectedRowKeys = []
  1168. this.checkboxOption.selectedRowKeys = []
  1169. this.shipmentListData = [] // 渲染 发运明细列表
  1170. },
  1171. //选中行
  1172. onSelectChange(keys,rows){
  1173. this.selectedRowKeys = keys;
  1174. this.selectedRows = rows;
  1175. },
  1176. // 分页变化时触发
  1177. handleTableChange(pagination, filters, sorter) {
  1178. this.queryParam.pageNo = pagination.current
  1179. this.getShipmentList()
  1180. },
  1181. //关闭新增弹窗
  1182. async closeAdd(data,id,range){
  1183. this.queryParam ={}
  1184. this.queryParam.flourOrGarment = data
  1185. this.queryParam.id = id
  1186. this.preDeliveryDate=range
  1187. this.queryParam.preDeliveryDateB =(this.preDeliveryDate[0]&&this.preDeliveryDate[0]!=='')? this.preDeliveryDate[0].format('YYYY-MM-DD'):'';
  1188. this.queryParam.preDeliveryDateE =(this.preDeliveryDate[1]&&this.preDeliveryDate[1]!=='')? this.preDeliveryDate[1].format('YYYY-MM-DD'):'';
  1189. //其他地方使用
  1190. this.returnId = id
  1191. this.returnFlourOrGarment = data
  1192. await this.getShipmentList()
  1193. // this.queryParam = {}
  1194. // this.defalutDate()
  1195. },
  1196. async closeAddEdit(){
  1197. this.judageAdd()
  1198. }
  1199. }
  1200. }
  1201. </script>
  1202. <style lang="less" scoped>
  1203. @import '~@assets/less/common.less';
  1204. @import '~@assets/less/overwriter.less';
  1205. /deep/ .ant-table-thead > tr > th {
  1206. text-align: center;
  1207. // font-weight: 700;
  1208. }
  1209. /deep/ .ant-table-tbody {
  1210. text-align: center;
  1211. }
  1212. // /deep/ th.replacecolor {
  1213. // background-color: #ccc;
  1214. // }
  1215. // /deep/ .ant-form-item {
  1216. // // margin-bottom: 0 !important;
  1217. // }
  1218. /deep/ .ant-table-tbody .ant-table-row td{
  1219. padding-top: 8px;
  1220. padding-bottom: 8px;
  1221. }
  1222. /deep/.ant-card-body{
  1223. padding-top: 10px !important;
  1224. padding-bottom: 0px !important;
  1225. }
  1226. /deep/.table-operator .ant-btn{
  1227. margin: 0 8px 3px 0;
  1228. }
  1229. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  1230. margin-bottom: 10px;
  1231. }
  1232. /deep/.table-page-search-wrapper .table-page-search-submitButtons{
  1233. margin-bottom: 10px;
  1234. }
  1235. /deep/ thead.ant-table-thead>tr{
  1236. height: 0 !important;
  1237. }
  1238. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  1239. padding: 9px 16px
  1240. }
  1241. .empty-data {
  1242. display: flex;
  1243. align-items: center;
  1244. justify-content: center;
  1245. height: 200px;
  1246. width: 100%;
  1247. color: #666;
  1248. font-size: 16px;
  1249. border: 1px solid #eee;
  1250. border-top: 0;
  1251. }
  1252. </style>