book-list.vue 27 KB

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