shipmentList.vue 50 KB

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