book-list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  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">批量推送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. loading: false, // 表格加载
  351. pagination:{
  352. pageSizeOptions: ["50", "100", "150"],
  353. showSizeChanger: true,
  354. },
  355. selectedNumber:0,//已选择条数
  356. // 查询条件
  357. queryParam: {
  358. pageNo:'',
  359. pageSize:'50',
  360. type:'成衣'
  361. }
  362. }
  363. },
  364. created() {
  365. this.getDefaultTime()
  366. // this.getBookList( )
  367. },
  368. watch:{
  369. selectedRowKeys(newVal){
  370. this.selectedNumber =newVal.length
  371. }
  372. },
  373. methods: {
  374. moment,
  375. //获取表格数据
  376. getBookList(data){
  377. this.$nextTick(() => {
  378. // this.queryParam.pageSize = 50
  379. this.loading = true
  380. if(data=='await'){this.loading = false}
  381. bookList(this.queryParam).then(res => {
  382. this.loading = false
  383. if (res.success) {
  384. this.bookListData = res.result.records
  385. this.selectedRowKeys = []
  386. this.pagination = {
  387. total: res.result.total,
  388. current: res.result.current,
  389. pageSize: res.result.size
  390. }
  391. }else {
  392. this.$message.error(res.message);
  393. }
  394. })
  395. })
  396. },
  397. getDefaultTime(){
  398. var date = new Date();
  399. date.setDate(0);
  400. var y = date.getFullYear(); //获取年份
  401. var m = date.getMonth() + 1; //获取月份
  402. m = m < 10 ? "0" + m : m; //月份补 0
  403. var lastM = [y, m, '01'].join("-")
  404. console.log([y, m, '01'].join("-"))
  405. this.shippingOrderDate[0]= lastM
  406. this.shippingOrderDate[1]= moment(new Date()).format('YYYY-MM-DD')
  407. this.queryParam.shippingOrderDateB = (lastM!==''&&lastM)?(moment( lastM).format('YYYY-MM-DD')):''
  408. this.queryParam.shippingOrderDateE = moment(new Date()).format('YYYY-MM-DD')
  409. // return [y, m, '01'].join("-");
  410. },
  411. // 查询按钮
  412. searchQuery() {
  413. this.toggleSearchStatus = false
  414. this.queryParam.pageNo = ''
  415. if(this.queryParam.type==''||!this.queryParam.type){
  416. this.$message.error('请选择类型');
  417. }else{
  418. this.getBookList()
  419. }
  420. // this.getpreBookList() // 渲染渲染预托书
  421. },
  422. // 重置
  423. searchReset() {
  424. this.shippingOrderDate=[]
  425. this.queryParam = {
  426. pageNo:'',
  427. pageSize:this.pagination.pageSize,
  428. type:'成衣'
  429. }
  430. this.getDefaultTime()
  431. this.getBookList()
  432. // this.getpreBookList()
  433. },
  434. // 新增
  435. addBookDrawer() {
  436. console.log('新增托书')
  437. this.$refs.addBookDrawer.visible = true
  438. this.$refs.addBookDrawer.query ='1'
  439. },
  440. // -----------------------------------
  441. // 结汇发票打印
  442. handleExportXls(record) {
  443. if(record.isAhaa == '国内'){
  444. if(record.readyFabric=='成衣'){
  445. var exinvoiceArr = ["-报关资料","-结汇资料"]
  446. }else{
  447. var exinvoiceArr = ["-报关资料"]
  448. }
  449. }else{//
  450. var exinvoiceArr = ["国外-报关信息-托书","-结汇资料"]
  451. }
  452. exinvoiceArr.map(item =>{
  453. downFile('/syShippingOrder/syShippingOrder/syShippingOrderPrint',{id:record.id,testName:item,isAhaa:record.isAhaa}).then(data => {
  454. if (!data) {
  455. this.$message.warning('文件下载失败')
  456. return
  457. }
  458. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  459. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), item + '.xlsx')
  460. } else {
  461. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  462. let link = document.createElement('a')
  463. link.style.display = 'none'
  464. link.href = url
  465. link.setAttribute('download', record.shippingOrderNumber+item + '.xlsx')
  466. document.body.appendChild(link)
  467. link.click()
  468. document.body.removeChild(link) // 下载完成移除元素
  469. window.URL.revokeObjectURL(url) // 释放掉blob对象
  470. }
  471. })
  472. })
  473. },
  474. // 上传附件
  475. accessoryUpload() {},
  476. // 操作 提交
  477. submit(record) {
  478. this.$nextTick(() => {
  479. submitPackingList({ id: record.id, type: '1' }).then(res => {
  480. if (res.success) {
  481. // record.theDocumentsState = '1'
  482. this.getBookList()
  483. this.$message.success('提交成功')
  484. }else {
  485. this.$message.error(res.message);
  486. }
  487. })
  488. })
  489. },
  490. // //批量提交
  491. batchSubmit(){
  492. this.$nextTick(() => {
  493. submitPackingList({ ids: this.selectedRowKeys, type: '1'}).then(res => {
  494. if (res.success) {
  495. // record.theDocumentsState = '1'
  496. this.getBookList()
  497. this.$message.success('提交成功')
  498. this.selectedRowKeys = []
  499. }else {
  500. this.$message.error(res.message);
  501. }
  502. })
  503. })
  504. },
  505. //取消提交
  506. canaleSubmit(record) {
  507. this.$nextTick(() => {
  508. submitPackingList({ id: record.id, type: '2' }).then(res => {
  509. if (res.success) {
  510. this.$message.success('取消提交成功')
  511. record.theDocumentsState = '0'
  512. this.getBookList()
  513. }else {
  514. this.$message.error(res.message);
  515. }
  516. })
  517. })
  518. },
  519. batchCanaleSubmit(){
  520. this.$nextTick(() => {
  521. submitPackingList({ ids: this.selectedRowKeys, type: '2' }).then(res => {
  522. if (res.success) {
  523. this.$message.success('取消提交成功')
  524. // record.theDocumentsState = '0'
  525. this.getBookList()
  526. this.selectedRowKeys = []
  527. }else {
  528. this.$message.error(res.message);
  529. }
  530. })
  531. })
  532. },
  533. //批量推送U8
  534. batchPushU8(){
  535. if(this.selectedRowKeys.length==0){
  536. this.$message.success('请勾选数据')
  537. }else{
  538. getAction('/syShippingOrder/syShippingOrder/expensesU8Batch',{ids:this.selectedRowKeys.join(',')}).then((res) => {
  539. if (res.success) {
  540. this.getBookList('await')
  541. }else{
  542. this.$message.warning(res.message);
  543. }
  544. })
  545. }
  546. },
  547. //批量推送装箱单发票
  548. batchPushInvoice(){
  549. if(this.selectedRowKeys.length==0){
  550. this.$message.success('请勾选数据')
  551. }else{
  552. getAction('/syShippingOrder/syShippingOrder/updateTimeStutaBatch',{ids:this.selectedRowKeys.join(',')}).then((res) => {
  553. if (res.success) {
  554. this.getBookList('await')
  555. }else{
  556. this.$message.warning(res.message);
  557. }
  558. })
  559. }
  560. },
  561. //推送U8
  562. pushU8(record){
  563. pushU8({ id: record.id}).then(res => {
  564. if (res.success) {
  565. // this.$message.success('推送U8成功')
  566. // record.theDocumentsState = '0'
  567. this.getBookList('await')
  568. }else {
  569. this.$message.error(res.message);
  570. }
  571. })
  572. },
  573. pushPackLst(record){
  574. pushPackeList({ id: record.id}).then(res => {
  575. if (res.success) {
  576. // this.$message.success('推送装箱单发票成功')
  577. // record.theDocumentsState = '0'
  578. this.getBookList('await')
  579. }else {
  580. this.$message.error(res.message);
  581. }
  582. })
  583. },
  584. // 操作 详情
  585. details(record) {
  586. this.$refs.detailsBookDrawer.visible = true
  587. },
  588. // 操作 编辑
  589. edit(record,pattern) {
  590. this.$nextTick(() => {
  591. bookListId({id:record.id,type:this.queryParam.type}).then(res => {
  592. if (res.success) {
  593. var data =res.result
  594. if(pattern == '1'){
  595. this.$refs.addBookDrawer.visible = true
  596. this.$refs.addBookDrawer.defaultMethod = 'edit'
  597. this.$refs.addBookDrawer.syStuta = record.syStuta
  598. if(data.latestDateOfShipment!==''&&data.latestDateOfShipment){
  599. data.latestDateOfShipment = (moment(data.latestDateOfShipment)).format('YYYY-MM-DD')
  600. }
  601. this.$refs.addBookDrawer.getFreightForwarder(data.syShippingOrderItemList[0].pkOrg)
  602. this.$refs.addBookDrawer.addBook = data
  603. this.$refs.addBookDrawer.addBookData = data.syShippingOrderItemList
  604. this.$refs.addBookDrawer.addBookData.map(item =>{
  605. item.smallPo = item.smailPo
  606. item.itemNumber = item.styleNumber
  607. // item.volume = item.volume
  608. item.price = item.unitPrice
  609. item.englishProductName = item.englishName
  610. })
  611. if(data.rmbList.length == 0){
  612. data.rmbList = [{}]
  613. }
  614. if(data.usdList.length == 0){
  615. data.usdList = [{}]
  616. }
  617. this.$refs.addBookDrawer.rmbList = data.rmbList
  618. this.$refs.addBookDrawer.usdList = data.usdList
  619. }else {
  620. this.$refs.detailsBookDrawer.visible = true
  621. if(data.latestDateOfShipment!==''&&data.latestDateOfShipment){
  622. data.latestDateOfShipment = (moment(data.latestDateOfShipment)).format('YYYY-MM-DD')
  623. }
  624. this.$refs.detailsBookDrawer.addBook = data
  625. this.$refs.detailsBookDrawer.addBookData = data.syShippingOrderItemList
  626. this.$refs.detailsBookDrawer.rmbList = data.rmbList
  627. this.$refs.detailsBookDrawer.usdList = data.usdList
  628. this.$refs.detailsBookDrawer.timeMesage = (data.timeMesage!=='' && data.timeMesage) ? (data.timeMesage.split(";")) :[]
  629. if(data.syStuta == 0){
  630. this.$refs.detailsBookDrawer.disabled = false
  631. }
  632. }
  633. this.$refs.addBookDrawer.query = '1'
  634. }else {
  635. this.$message.error(res.message);
  636. }
  637. })
  638. })
  639. },
  640. //辅料 - 复制
  641. copyForm(record){
  642. bookListId({id:record.id,type:this.queryParam.type}).then(res => {
  643. if (res.success) {
  644. var data =res.result
  645. this.$refs.addBookDrawer.visible = true
  646. this.$refs.addBookDrawer.defaultMethod = 'edit'
  647. if(data.latestDateOfShipment!==''&&data.latestDateOfShipment){
  648. data.latestDateOfShipment = (moment(data.latestDateOfShipment)).format('YYYY-MM-DD')
  649. }
  650. this.$refs.addBookDrawer.addBook = data
  651. this.$refs.addBookDrawer.addBook.id = ''
  652. }
  653. })
  654. },
  655. // 操作 打印
  656. print(record) {},
  657. // 操作 删除
  658. handleDelete(id) {
  659. this.$nextTick(() => {
  660. if(this.queryParam.pageNo > 1 && this.bookListData.length === 1){
  661. this.queryParam.pageNo = this.queryParam.pageNo -1
  662. }
  663. this.loading = true
  664. deletePackingList({id:id}).then(res => {
  665. this.loading = false
  666. if (res.success) {
  667. this.getBookList()
  668. }else {
  669. this.$message.error(res.message);
  670. }
  671. })
  672. })
  673. },
  674. // 单据日期发生改变时
  675. orderDataChange(data){
  676. this.queryParam.shippingOrderDateB = (data.length==2&&data)?(moment( data[0]).format('YYYY-MM-DD')):''
  677. this.queryParam.shippingOrderDateE = (data.length==2&&data)?(moment( data[1]).format('YYYY-MM-DD')):''
  678. },
  679. // // 分页、排序、筛选变化时触发
  680. handleTableChange(pagination, filters, sorter) {
  681. // console.log('当前页信息>>>>',pagination)
  682. this.queryParam.pageNo = pagination.current
  683. this.queryParam.pageSize = pagination.pageSize
  684. this.getBookList()
  685. },
  686. // 选中行
  687. onSelectChange(keys) {
  688. this.selectedRowKeys = keys
  689. }
  690. },
  691. computed: {},
  692. mounted() {}
  693. }
  694. </script>
  695. <style lang="less" scoped>
  696. @import '~@assets/less/common.less';
  697. @import '~@assets/less/overwriter.less';
  698. /deep/ .ant-table-thead > tr > th {
  699. text-align: center;
  700. // font-weight: 700;
  701. }
  702. /deep/ .ant-table-tbody {
  703. text-align: center;
  704. }
  705. /deep/ .ant-table-tbody .ant-table-row td{
  706. padding-top: 8px;
  707. padding-bottom: 8px;
  708. }
  709. /deep/.ant-card-body{
  710. padding-top: 10px !important;
  711. padding-bottom: 0px !important;
  712. }
  713. /deep/.table-operator .ant-btn{
  714. margin: 0 8px 3px 0;
  715. }
  716. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  717. margin-bottom: 10px;
  718. }
  719. /deep/.table-page-search-wrapper .table-page-search-submitButtons{
  720. margin-bottom: 10px;
  721. }
  722. // /deep/ th.replacecolor {
  723. // background-color: #ccc;
  724. // }
  725. /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
  726. width: min-content;
  727. }
  728. /deep/ thead.ant-table-thead>tr{
  729. height: 0 !important;
  730. }
  731. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  732. padding: 9px 16px
  733. }
  734. </style>