book-list.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. <template>
  2. <!-- 预托书列表 -->
  3. <div id="preBookList">
  4. <!-- 查询区域 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="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.shippingOrderNumber"></a-input>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="5" :sm="8">
  20. <a-form-item label="客户简称">
  21. <!-- <a-input placeholder="请输入客户简称" v-model="queryParam.clientAbbreviation"></a-input> -->
  22. <j-search-select-tag
  23. placeholder="请选择客户简称"
  24. v-model="queryParam.clientAbbreviation"
  25. dict="view_customer,customername,customername">
  26. </j-search-select-tag>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :md="5" :sm="8">
  30. <a-form-model-item label="类型">
  31. <a-select v-model="queryParam.type">
  32. <a-select-option value="成衣">成衣</a-select-option>
  33. <a-select-option value="面辅料">面辅料</a-select-option>
  34. </a-select>
  35. </a-form-model-item>
  36. </a-col>
  37. <template v-if="toggleSearchStatus">
  38. <a-col :md="4" :sm="8">
  39. <a-form-item label="账套号">
  40. <j-search-select-tag
  41. placeholder="请选择账套号"
  42. v-model="queryParam.pkOrg"
  43. dict="view_account,account,account">
  44. </j-search-select-tag>
  45. </a-form-item>
  46. </a-col>
  47. <!-- <a-col :md="6" :sm="8">
  48. <a-form-item label="箱号">
  49. <a-input placeholder="请输入箱号" v-model="queryParam.containerNumber"></a-input>
  50. </a-form-item>
  51. </a-col> -->
  52. <a-col :md="5" :sm="8">
  53. <a-form-item label="小po号">
  54. <a-input placeholder="请输入小po号" v-model="queryParam.smailPo"></a-input>
  55. </a-form-item>
  56. </a-col>
  57. <a-col :md="5" :sm="8">
  58. <a-form-item label="单据日期" has-feedback>
  59. <a-range-picker
  60. :placeholder="['开始时间', '结束时间']"
  61. format="YYYY-MM-DD"
  62. style="width: 100%"
  63. v-model="shippingOrderDate"
  64. @change="orderDataChange"
  65. />
  66. <!-- <a-date-picker style="width: 100%" v-model="queryParam.shippingOrderDate" @change="orderDataChange" > </a-date-picker> -->
  67. </a-form-item>
  68. </a-col>
  69. <a-col :md="5" :sm="8">
  70. <a-form-item label="船期">
  71. <a-date-picker
  72. placeholder="请选择"
  73. style="width:100%;"
  74. format="YYYY-MM-DD"
  75. valueFormat="YYYY-MM-DD"
  76. v-model="queryParam.theFinalShippingDate"
  77. />
  78. </a-form-item>
  79. </a-col>
  80. <a-col :md="5" :sm="8">
  81. <a-form-item label="供应商">
  82. <j-search-select-tag
  83. placeholder="请选择供应商"
  84. v-model="queryParam.supplier"
  85. dict="view_supplier,supplier,supplier">
  86. </j-search-select-tag>
  87. </a-form-item>
  88. </a-col>
  89. <a-col :md="5" :sm="8">
  90. <a-form-item label="款号">
  91. <a-input placeholder="请输入款号" v-model="queryParam.styleNum"></a-input>
  92. </a-form-item>
  93. </a-col>
  94. <a-col :md="5" :sm="8">
  95. <a-form-item label="外销发票">
  96. <a-input placeholder="请输入外销发票" v-model="queryParam.exportInvoiceNo"></a-input>
  97. </a-form-item>
  98. </a-col>
  99. <a-col :md="5" :sm="8">
  100. <a-form-model-item label="发票推送状态">
  101. <a-select v-model="queryParam.timeStuta">
  102. <a-select-option value="">请选择</a-select-option>
  103. <a-select-option value="0">可推送</a-select-option>
  104. <a-select-option value="1">推送中</a-select-option>
  105. <a-select-option value="2">推送成功</a-select-option>
  106. <a-select-option value="3">推送失败</a-select-option>
  107. <a-select-option value="4">不可推送</a-select-option>
  108. <a-select-option value="5">推送中</a-select-option>
  109. </a-select>
  110. </a-form-model-item>
  111. </a-col>
  112. </template>
  113. <a-col :md="4" :sm="8">
  114. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  115. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  116. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  117. <a @click="handleToggleSearch" style="margin-left: 8px">
  118. {{ toggleSearchStatus ? '收起' : '展开' }}
  119. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  120. </a>
  121. </span>
  122. </a-col>
  123. </a-row>
  124. </a-form>
  125. </div>
  126. </a-card>
  127. <!-- 操作按钮区域 新增-->
  128. <a-card :bordered="false" style="marginTop:10px;">
  129. <div class="table-operator">
  130. <a-button type="primary" @click="addBookDrawer" icon="plus">新增</a-button>
  131. <a-button type="primary" @click="batchSubmit()" icon="plus">批量提交</a-button>
  132. <a-button type="primary" @click="batchCanaleSubmit()" icon="plus">批量取消提交</a-button>
  133. <a-button type="primary" @click="batchPushU8()" icon="plus" :disabled="loadingU8">批量推送U8</a-button>
  134. <a-button type="primary" @click="batchPushInvoice()" icon="plus">批量推送装箱单发票 </a-button>
  135. </div>
  136. <!-- 子表 -->
  137. <a-table
  138. bordered
  139. :columns="bookListColumns"
  140. :data-source="bookListData"
  141. :loading="loading"
  142. :scroll="{x: 1200 , y: 600 }"
  143. :pagination="pagination"
  144. :row-key="record => record.id"
  145. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  146. @change="handleTableChange"
  147. >
  148. <!-- 金额 输入框
  149. <template slot="money" slot-scope="text, record, index">
  150. <a-form-model-item prop="money" :rules="rules.money" required>
  151. <a-input style="width:100%" type="text" v-model="record.money" />
  152. </a-form-model-item>
  153. </template> -->
  154. <!-- 单据状态 -->
  155. <span slot="documentStateSlot" slot-scope="text, record">
  156. <a-tag color="orange" v-if="record.theDocumentsState == '0'">未提交</a-tag>
  157. <a-tag color="green" v-if="record.theDocumentsState == '1'">提交</a-tag>
  158. </span>
  159. <!-- 推送状态 -->
  160. <span slot="syStuta" slot-scope="text, record">
  161. <a-tag color="orange" v-if="record.syStuta == '0'">未推送</a-tag>
  162. <a-tag color="green" v-if="record.syStuta == '1'">已推送</a-tag>
  163. </span>
  164. <!-- 发票推送状态 -->
  165. <span slot="timeStuta" slot-scope="text, record">
  166. <a-tag color="#f50" v-if="record.timeStuta == '0'">可推送</a-tag>
  167. <a-tag color="blue" v-if="record.timeStuta == '1'">推送中</a-tag>
  168. <a-tag color="green" v-if="record.timeStuta == '2'">推送成功</a-tag>
  169. <a-tag color="red" v-if="record.timeStuta == '3'">推送失败</a-tag>
  170. <a-tag color="B7B7B7" v-if="record.timeStuta == '4'">不可推送</a-tag>
  171. <a-tag color="blue" v-if="record.timeStuta == '5'">推送中</a-tag>
  172. </span>
  173. <!-- if 已提交 -->
  174. <!-- <span slot="documentStateSlot">
  175. <a-tag color="#2db7f5">已提交</a-tag>
  176. </span> -->
  177. <!-- 操作 -->
  178. <span slot="operationSlot" slot-scope="text, record">
  179. <a @click="handleExportXls(record)" style="color:green;">{{record.isAhaa}}-结汇发票打印</a>
  180. <a-divider type="vertical" />
  181. <a-dropdown>
  182. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  183. <a-menu slot="overlay" v-if="record.theDocumentsState == '0'">
  184. <!-- <a-menu-item><a @click="submit(record)">提交</a></a-menu-item> -->
  185. <a-menu-item><a @click="edit(record,'2')">详情</a></a-menu-item>
  186. <a-menu-item><a @click="edit(record,'1')">编辑</a></a-menu-item>
  187. <a-menu-item v-if="record.readyFabric=='辅料'||record.readyFabric=='面料'"><a @click="copyForm(record)">复制</a></a-menu-item>
  188. <!-- <a-menu-item ><a @click="pushU8(record)">推送u8</a></a-menu-item> -->
  189. <!-- <a-menu-item><a @click="print(record)">打印</a></a-menu-item> -->
  190. <a-menu-item>
  191. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
  192. <a href="javascript:void(0);" style="color:red;">删除</a>
  193. </a-popconfirm></a-menu-item
  194. >
  195. </a-menu>
  196. <a-menu slot="overlay" v-if="record.theDocumentsState == '1'">
  197. <!-- <a-menu-item><a @click="canaleSubmit(record)">取消提交</a></a-menu-item> -->
  198. <a-menu-item><a @click="edit(record,'2')">详情</a></a-menu-item>
  199. <a-menu-item v-if="record.readyFabric=='辅料'||record.readyFabric=='面料'"><a @click="copyForm(record)">复制</a></a-menu-item>
  200. <a-menu-item ><a @click="pushU8(record)" >推送u8</a></a-menu-item>
  201. <a-menu-item ><a @click="pushPackLst(record)" >推送装箱单发票</a></a-menu-item>
  202. </a-menu>
  203. </a-dropdown>
  204. </span>
  205. </a-table>
  206. <span style="position: absolute;bottom: 9%;">共勾选{{selectedNumber}}条数</span>
  207. </a-card>
  208. <!-- 抽屉 -->
  209. <addBook-drawer ref="addBookDrawer" @ok="modalFormOk" @back="getBookList"></addBook-drawer>
  210. <detailsBook-drawer ref="detailsBookDrawer" @ok="modalFormOk"></detailsBook-drawer>
  211. <!-- <editBook-drawer ref="editBookDrawer" :father="cc" @ok="modalFormOk"></editBook-drawer> -->
  212. </div>
  213. </template>
  214. <script>
  215. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  216. import JEllipsis from '@/components/jeecg/JEllipsis'
  217. import moment from 'moment'
  218. import { downFile ,getAction,deleteAction,postActio} from '@/api/manage'
  219. import addBookDrawer from '@views/book/addBookDrawer.vue'
  220. import detailsBookDrawer from '@views/book/detailsBookDrawer.vue'
  221. import editBookDrawer from '@views/book/editBookDrawer.vue'
  222. import {bookList,bookListId,submitPackingList,deletePackingList,settlement,pushU8,pushPackeList} from '@api/document/book.js'
  223. export default {
  224. name: 'BookList', // 托书列表
  225. mixins: [JeecgListMixin],
  226. components: { JEllipsis, moment, addBookDrawer, detailsBookDrawer, editBookDrawer },
  227. data() {
  228. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  229. return {
  230. // 表头
  231. bookListColumns: [
  232. { title: '托书号', width: 150, dataIndex: 'shippingOrderNumber', className: 'replacecolor' , ellipsis: true,fixed: 'left'},
  233. {
  234. title: '实际船期',
  235. dataIndex: 'theFinalShippingDate',
  236. ellipsis: true,
  237. width: 110,
  238. // customRender: text => { 有问题 显示当日日期
  239. // return moment(text).format('YYYY-MM-DD')
  240. // },
  241. className: 'replacecolor'
  242. },
  243. { title: '成衣工厂', width: 150, dataIndex: 'garmentFactory', className: 'replacecolor', ellipsis: true, },
  244. { title: '客户简称', dataIndex: 'clientAbbreviation', width: 120, className: 'replacecolor' , ellipsis: true,},
  245. {
  246. title: '分销点',
  247. dataIndex: 'distributionPoint',
  248. width: 120,
  249. ellipsis: true,
  250. className: 'replacecolor'
  251. },
  252. {
  253. title: '经营单位',
  254. dataIndex: 'unitInOperation',
  255. width: 160,
  256. ellipsis: true,
  257. className: 'replacecolor'
  258. },
  259. { title: '总箱数', dataIndex: 'boxNumber', width: 80, className: 'replacecolor', ellipsis: true, },
  260. { title: '总毛重', dataIndex: 'totalGrossWeight', width: 80, className: 'replacecolor', ellipsis: true, },
  261. { title: '总体积', dataIndex: 'totalVolume', width: 80, className: 'replacecolor', ellipsis: true, },
  262. {
  263. title: '金额',
  264. dataIndex: 'money',
  265. // scopedSlots: { customRender: 'money' },
  266. width: 100,
  267. ellipsis: true,
  268. className: 'replacecolor'
  269. },
  270. // {
  271. // title: '净价总金额',
  272. // dataIndex: 'totalNetPrice',
  273. // width: 120,
  274. // ellipsis: true,
  275. // className: 'replacecolor'
  276. // },
  277. { title: '外销发票号码', dataIndex: 'exportInvoiceNo', width: 120, className: 'replacecolor', ellipsis: true, },
  278. {
  279. title: '发票推送状态',
  280. dataIndex: 'timeStuta',
  281. width: 120,
  282. scopedSlots: { customRender: 'timeStuta' },
  283. fixed: 'right',
  284. className: 'replacecolor'
  285. },
  286. {
  287. title: '状态',
  288. dataIndex: 'theDocumentsState',
  289. scopedSlots: { customRender: 'documentStateSlot' },
  290. width: 95,
  291. fixed: 'right',
  292. className: 'replacecolor'
  293. },
  294. // { title: '收汇方式', dataIndex: 'exchangeEarningsValue', width: 120, className: 'replacecolor' },
  295. // {
  296. // title: '收货人',
  297. // dataIndex: 'consignee',
  298. // width: 100,
  299. // customRender: t => ellipsis(t),
  300. // className: 'replacecolor'
  301. // },
  302. // {
  303. // title: '提单或承运收据',
  304. // dataIndex: 'billOfLadingOrCarriageReceipt',
  305. // width: 140,
  306. // customRender: t => ellipsis(t),
  307. // className: 'replacecolor'
  308. // },
  309. // {
  310. // title: '抬头人',
  311. // dataIndex: 'addressee',
  312. // width: 120,
  313. // customRender: t => ellipsis(t),
  314. // className: 'replacecolor'
  315. // },
  316. // { title: '贸易国别', dataIndex: 'tradeCountry', width: 100, className: 'replacecolor' },
  317. // { title: '运抵国别', dataIndex: 'arriveInCountry', width: 100, className: 'replacecolor' },
  318. // { title: '出口口岸', dataIndex: 'exportPort', width: 100, className: 'replacecolor' },
  319. // {
  320. // title: '通知人',
  321. // dataIndex: 'notifier',
  322. // width: 100,
  323. // customRender: t => ellipsis(t),
  324. // className: 'replacecolor'
  325. // },
  326. // { title: 'NOTIFY', dataIndex: 'nottfy', width: 150, className: 'replacecolor' },
  327. // { title: '目的港', dataIndex: 'destinationPort', width: 100, className: 'replacecolor' },
  328. // { title: '装运期限', dataIndex: 'latestDateOfShipment', width: 100, className: 'replacecolor' },
  329. {
  330. title: '推送状态',
  331. dataIndex: 'syStuta',
  332. width: 90,
  333. scopedSlots: { customRender: 'syStuta' },
  334. fixed: 'right',
  335. className: 'replacecolor'
  336. },
  337. {
  338. title: '操作',
  339. dataIndex: 'operation',
  340. scopedSlots: { customRender: 'operationSlot' },
  341. width: 220,
  342. fixed: 'right',
  343. className: 'replacecolor'
  344. }
  345. ],
  346. bookListData: [],
  347. shippingOrderDate:[], //单据日期区间
  348. id: '',
  349. selectedRowKeys:[],//选中行id
  350. loadingU8:false,
  351. loading: false, // 表格加载
  352. pagination:{
  353. pageSizeOptions: ["50", "100", "150"],
  354. showSizeChanger: true,
  355. },
  356. selectedNumber:0,//已选择条数
  357. // 查询条件
  358. queryParam: {
  359. pageNo:'',
  360. pageSize:'50',
  361. type:'成衣'
  362. }
  363. }
  364. },
  365. created() {
  366. this.getDefaultTime()
  367. // this.getBookList( )
  368. },
  369. watch:{
  370. selectedRowKeys(newVal){
  371. this.selectedNumber =newVal.length
  372. }
  373. },
  374. methods: {
  375. moment,
  376. //获取表格数据
  377. getBookList(data){
  378. this.$nextTick(() => {
  379. // this.queryParam.pageSize = 50
  380. this.loading = true
  381. if(data=='await'){this.loading = false}
  382. bookList(this.queryParam).then(res => {
  383. this.loading = false
  384. if (res.success) {
  385. this.bookListData = res.result.records
  386. this.selectedRowKeys = []
  387. this.pagination = {
  388. total: res.result.total,
  389. current: res.result.current,
  390. pageSize: res.result.size
  391. }
  392. }else {
  393. this.$message.error(res.message);
  394. }
  395. })
  396. })
  397. },
  398. getDefaultTime(){
  399. var date = new Date();
  400. date.setDate(0);
  401. var y = date.getFullYear(); //获取年份
  402. var m = date.getMonth() + 1; //获取月份
  403. m = m < 10 ? "0" + m : m; //月份补 0
  404. var lastM = [y, m, '01'].join("-")
  405. console.log([y, m, '01'].join("-"))
  406. this.shippingOrderDate[0]= lastM
  407. this.shippingOrderDate[1]= moment(new Date()).format('YYYY-MM-DD')
  408. this.queryParam.shippingOrderDateB = (lastM!==''&&lastM)?(moment( lastM).format('YYYY-MM-DD')):''
  409. this.queryParam.shippingOrderDateE = moment(new Date()).format('YYYY-MM-DD')
  410. // return [y, m, '01'].join("-");
  411. },
  412. // 查询按钮
  413. searchQuery() {
  414. this.toggleSearchStatus = false
  415. this.queryParam.pageNo = ''
  416. if(this.queryParam.type==''||!this.queryParam.type){
  417. this.$message.error('请选择类型');
  418. }else{
  419. this.getBookList()
  420. }
  421. // this.getpreBookList() // 渲染渲染预托书
  422. },
  423. // 重置
  424. searchReset() {
  425. this.shippingOrderDate=[]
  426. this.queryParam = {
  427. pageNo:'',
  428. pageSize:this.pagination.pageSize,
  429. type:'成衣'
  430. }
  431. this.getDefaultTime()
  432. this.getBookList()
  433. // this.getpreBookList()
  434. },
  435. // 新增
  436. addBookDrawer() {
  437. console.log('新增托书')
  438. this.$refs.addBookDrawer.visible = true
  439. this.$refs.addBookDrawer.query ='1'
  440. },
  441. // -----------------------------------
  442. // 结汇发票打印
  443. handleExportXls(record) {
  444. if(record.isAhaa == '国内'){
  445. if(record.readyFabric=='成衣'){
  446. var exinvoiceArr = ["-报关资料","-结汇资料"]
  447. }else{
  448. var exinvoiceArr = ["-报关资料"]
  449. }
  450. }else{//
  451. var exinvoiceArr = ["国外-报关信息-托书","-结汇资料"]
  452. }
  453. exinvoiceArr.map(item =>{
  454. downFile('/syShippingOrder/syShippingOrder/syShippingOrderPrint',{id:record.id,testName:item,isAhaa:record.isAhaa}).then(data => {
  455. if (!data) {
  456. this.$message.warning('文件下载失败')
  457. return
  458. }
  459. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  460. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), item + '.xlsx')
  461. } else {
  462. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  463. let link = document.createElement('a')
  464. link.style.display = 'none'
  465. link.href = url
  466. link.setAttribute('download', record.shippingOrderNumber+item + '.xlsx')
  467. document.body.appendChild(link)
  468. link.click()
  469. document.body.removeChild(link) // 下载完成移除元素
  470. window.URL.revokeObjectURL(url) // 释放掉blob对象
  471. }
  472. })
  473. })
  474. },
  475. // 上传附件
  476. accessoryUpload() {},
  477. // 操作 提交
  478. submit(record) {
  479. this.$nextTick(() => {
  480. submitPackingList({ id: record.id, type: '1' }).then(res => {
  481. if (res.success) {
  482. // record.theDocumentsState = '1'
  483. this.getBookList()
  484. this.$message.success('提交成功')
  485. }else {
  486. this.$message.error(res.message);
  487. }
  488. })
  489. })
  490. },
  491. // //批量提交
  492. batchSubmit(){
  493. this.$nextTick(() => {
  494. submitPackingList({ ids: this.selectedRowKeys, type: '1'}).then(res => {
  495. if (res.success) {
  496. // record.theDocumentsState = '1'
  497. this.getBookList()
  498. this.$message.success('提交成功')
  499. this.selectedRowKeys = []
  500. }else {
  501. this.$message.error(res.message);
  502. }
  503. })
  504. })
  505. },
  506. //取消提交
  507. canaleSubmit(record) {
  508. this.$nextTick(() => {
  509. submitPackingList({ id: record.id, type: '2' }).then(res => {
  510. if (res.success) {
  511. this.$message.success('取消提交成功')
  512. record.theDocumentsState = '0'
  513. this.getBookList()
  514. }else {
  515. this.$message.error(res.message);
  516. }
  517. })
  518. })
  519. },
  520. batchCanaleSubmit(){
  521. this.$nextTick(() => {
  522. submitPackingList({ ids: this.selectedRowKeys, type: '2' }).then(res => {
  523. if (res.success) {
  524. this.$message.success('取消提交成功')
  525. // record.theDocumentsState = '0'
  526. this.getBookList()
  527. this.selectedRowKeys = []
  528. }else {
  529. this.$message.error(res.message);
  530. }
  531. })
  532. })
  533. },
  534. //批量推送U8
  535. batchPushU8(){
  536. if(this.selectedRowKeys.length==0){
  537. this.$message.success('请勾选数据')
  538. }else{
  539. this.loadingU8 = true
  540. getAction('/syShippingOrder/syShippingOrder/expensesU8Batch',{ids:this.selectedRowKeys.join(',')}).then((res) => {
  541. if (res.success) {
  542. this.getBookList('await')
  543. }else{
  544. this.$message.warning(res.message);
  545. }
  546. }).finally(() => {
  547. this.loadingU8 = false
  548. });
  549. }
  550. },
  551. //批量推送装箱单发票
  552. batchPushInvoice(){
  553. if(this.selectedRowKeys.length==0){
  554. this.$message.success('请勾选数据')
  555. }else{
  556. getAction('/syShippingOrder/syShippingOrder/updateTimeStutaBatch',{ids:this.selectedRowKeys.join(',')}).then((res) => {
  557. if (res.success) {
  558. this.getBookList('await')
  559. }else{
  560. this.$message.warning(res.message);
  561. }
  562. })
  563. }
  564. },
  565. //推送U8
  566. pushU8(record){
  567. pushU8({ id: record.id}).then(res => {
  568. if (res.success) {
  569. // this.$message.success('推送U8成功')
  570. // record.theDocumentsState = '0'
  571. this.getBookList('await')
  572. }else {
  573. this.$message.error(res.message);
  574. }
  575. })
  576. },
  577. pushPackLst(record){
  578. pushPackeList({ id: record.id}).then(res => {
  579. if (res.success) {
  580. // this.$message.success('推送装箱单发票成功')
  581. // record.theDocumentsState = '0'
  582. this.getBookList('await')
  583. }else {
  584. this.$message.error(res.message);
  585. }
  586. })
  587. },
  588. // 操作 详情
  589. details(record) {
  590. this.$refs.detailsBookDrawer.visible = true
  591. },
  592. // 操作 编辑
  593. edit(record,pattern) {
  594. this.$nextTick(() => {
  595. bookListId({id:record.id,type:this.queryParam.type}).then(res => {
  596. if (res.success) {
  597. var data =res.result
  598. if(pattern == '1'){
  599. this.$refs.addBookDrawer.visible = true
  600. this.$refs.addBookDrawer.defaultMethod = 'edit'
  601. this.$refs.addBookDrawer.syStuta = record.syStuta
  602. if(data.latestDateOfShipment!==''&&data.latestDateOfShipment){
  603. data.latestDateOfShipment = (moment(data.latestDateOfShipment)).format('YYYY-MM-DD')
  604. }
  605. this.$refs.addBookDrawer.getFreightForwarder(data.syShippingOrderItemList[0].pkOrg)
  606. this.$refs.addBookDrawer.addBook = data
  607. this.$refs.addBookDrawer.addBookData = data.syShippingOrderItemList
  608. this.$refs.addBookDrawer.addBookData.map(item =>{
  609. item.smallPo = item.smailPo
  610. item.itemNumber = item.styleNumber
  611. // item.volume = item.volume
  612. item.price = item.unitPrice
  613. item.englishProductName = item.englishName
  614. })
  615. if(data.rmbList.length == 0){
  616. data.rmbList = [{}]
  617. }
  618. if(data.usdList.length == 0){
  619. data.usdList = [{}]
  620. }
  621. this.$refs.addBookDrawer.rmbList = data.rmbList
  622. this.$refs.addBookDrawer.usdList = data.usdList
  623. }else {
  624. this.$refs.detailsBookDrawer.visible = true
  625. if(data.latestDateOfShipment!==''&&data.latestDateOfShipment){
  626. data.latestDateOfShipment = (moment(data.latestDateOfShipment)).format('YYYY-MM-DD')
  627. }
  628. this.$refs.detailsBookDrawer.addBook = data
  629. this.$refs.detailsBookDrawer.addBookData = data.syShippingOrderItemList
  630. this.$refs.detailsBookDrawer.rmbList = data.rmbList
  631. this.$refs.detailsBookDrawer.usdList = data.usdList
  632. this.$refs.detailsBookDrawer.timeMesage = (data.timeMesage!=='' && data.timeMesage) ? (data.timeMesage.split(";")) :[]
  633. if(data.syStuta == 0){
  634. this.$refs.detailsBookDrawer.disabled = false
  635. }
  636. }
  637. this.$refs.addBookDrawer.query = '1'
  638. }else {
  639. this.$message.error(res.message);
  640. }
  641. })
  642. })
  643. },
  644. //辅料 - 复制
  645. copyForm(record){
  646. bookListId({id:record.id,type:this.queryParam.type}).then(res => {
  647. if (res.success) {
  648. var data =res.result
  649. this.$refs.addBookDrawer.visible = true
  650. this.$refs.addBookDrawer.defaultMethod = 'edit'
  651. if(data.latestDateOfShipment!==''&&data.latestDateOfShipment){
  652. data.latestDateOfShipment = (moment(data.latestDateOfShipment)).format('YYYY-MM-DD')
  653. }
  654. this.$refs.addBookDrawer.addBook = data
  655. this.$refs.addBookDrawer.addBook.id = ''
  656. }
  657. })
  658. },
  659. // 操作 打印
  660. print(record) {},
  661. // 操作 删除
  662. handleDelete(id) {
  663. this.$nextTick(() => {
  664. if(this.queryParam.pageNo > 1 && this.bookListData.length === 1){
  665. this.queryParam.pageNo = this.queryParam.pageNo -1
  666. }
  667. this.loading = true
  668. deletePackingList({id:id}).then(res => {
  669. this.loading = false
  670. if (res.success) {
  671. this.getBookList()
  672. }else {
  673. this.$message.error(res.message);
  674. }
  675. })
  676. })
  677. },
  678. // 单据日期发生改变时
  679. orderDataChange(data){
  680. this.queryParam.shippingOrderDateB = (data.length==2&&data)?(moment( data[0]).format('YYYY-MM-DD')):''
  681. this.queryParam.shippingOrderDateE = (data.length==2&&data)?(moment( data[1]).format('YYYY-MM-DD')):''
  682. },
  683. // // 分页、排序、筛选变化时触发
  684. handleTableChange(pagination, filters, sorter) {
  685. // console.log('当前页信息>>>>',pagination)
  686. this.queryParam.pageNo = pagination.current
  687. this.queryParam.pageSize = pagination.pageSize
  688. this.getBookList()
  689. },
  690. // 选中行
  691. onSelectChange(keys) {
  692. this.selectedRowKeys = keys
  693. }
  694. },
  695. computed: {},
  696. mounted() {}
  697. }
  698. </script>
  699. <style lang="less" scoped>
  700. @import '~@assets/less/common.less';
  701. @import '~@assets/less/overwriter.less';
  702. /deep/ .ant-table-thead > tr > th {
  703. text-align: center;
  704. // font-weight: 700;
  705. }
  706. /deep/ .ant-table-tbody {
  707. text-align: center;
  708. }
  709. /deep/ .ant-table-tbody .ant-table-row td{
  710. padding-top: 8px;
  711. padding-bottom: 8px;
  712. }
  713. /deep/.ant-card-body{
  714. padding-top: 10px !important;
  715. padding-bottom: 0px !important;
  716. }
  717. /deep/.table-operator .ant-btn{
  718. margin: 0 8px 3px 0;
  719. }
  720. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  721. margin-bottom: 10px;
  722. }
  723. /deep/.table-page-search-wrapper .table-page-search-submitButtons{
  724. margin-bottom: 10px;
  725. }
  726. // /deep/ th.replacecolor {
  727. // background-color: #ccc;
  728. // }
  729. /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
  730. width: min-content;
  731. }
  732. /deep/ thead.ant-table-thead>tr{
  733. height: 0 !important;
  734. }
  735. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  736. padding: 9px 16px
  737. }
  738. </style>