book-list.vue 24 KB

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