book-list.vue 25 KB

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