list.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. <template>
  2. <div class="stockPrint-wrap">
  3. <!-- 搜索条件 -->
  4. <a-card class="searchBoxNormal" size="small" :bordered="false">
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <a-form layout="inline">
  7. <a-row :gutter="15">
  8. <a-col :md="6" :sm="24">
  9. <a-form-item label="创建时间">
  10. <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="24">
  14. <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
  15. <dealerSubareaScopeList ref="dealerSubareaScopeList" id="stockPrint-buyerName" @change="custChange" />
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="6" :sm="24">
  19. <a-form-item label="销售单号">
  20. <a-input id="stockPrint-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
  21. </a-form-item>
  22. </a-col>
  23. <template v-if="advanced">
  24. <a-col :md="6" :sm="24">
  25. <a-form-model-item label="所在区域">
  26. <subarea id="stockPrint-subarea" ref="subarea" @change="subareaChange"></subarea>
  27. </a-form-model-item>
  28. </a-col>
  29. <a-col :md="6" :sm="24">
  30. <a-form-item label="业务状态">
  31. <v-select
  32. v-model="queryParam.billStatus"
  33. ref="billStatus"
  34. id="stockPrint-billStatus"
  35. code="DISPATCH_BILL_STATUS"
  36. placeholder="请选择业务状态"
  37. allowClear></v-select>
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="24">
  41. <a-form-item label="收货客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
  42. <dealerSubareaScopeList ref="shbuyerName" id="stockPrint-shbuyerName" @change="shcustChange" />
  43. </a-form-item>
  44. </a-col>
  45. <a-col :md="6" :sm="24" v-if="currentTab == 1">
  46. <a-form-item label="单据状态">
  47. <v-select
  48. v-model="queryParam.voidFlag"
  49. ref="voidFlag"
  50. id="pushOrder-voidFlag"
  51. code="VOID_FLAG"
  52. placeholder="请选择单据状态"
  53. allowClear></v-select>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :md="6" :sm="24" v-if="currentTab == 1">
  57. <a-form-item label="备货打印状态">
  58. <v-select
  59. v-model="queryParam.printStatus"
  60. ref="printStatus"
  61. id="pushOrder-printStatus"
  62. code="PRINT_STATUS"
  63. placeholder="请选择备货打印状态"
  64. allowClear></v-select>
  65. </a-form-item>
  66. </a-col>
  67. <a-col :md="6" :sm="24">
  68. <a-form-item label="备货单号">
  69. <a-input id="stockPrint-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入备货单号"/>
  70. </a-form-item>
  71. </a-col>
  72. <a-col :md="6" :sm="24">
  73. <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
  74. <Area id="stockPrint-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
  75. </a-form-model-item>
  76. </a-col>
  77. <a-col :md="6" :sm="24" v-show="isShowWarehouse">
  78. <a-form-model-item label="仓库">
  79. <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
  80. </a-form-model-item>
  81. </a-col>
  82. <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
  83. <a-form-item label="客服">
  84. <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
  85. </a-form-item>
  86. </a-col>
  87. </template>
  88. <a-col :md="(currentTab==1&&isShowCustomerSearch)?24:6" :sm="24" :style="{textAlign:(currentTab==1&&isShowCustomerSearch)?'center':''}">
  89. <div class="table-page-search-submitButtons">
  90. <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
  91. <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
  92. <a @click="advanced=!advanced" style="margin-left: 8px">
  93. {{ advanced ? '收起' : '展开' }}
  94. <a-icon :type="advanced ? 'up' : 'down'"/>
  95. </a>
  96. </div>
  97. </a-col>
  98. </a-row>
  99. </a-form>
  100. </div>
  101. </a-card>
  102. <a-card class="stockPrint-body" size="small" :bordered="false">
  103. <a-spin :spinning="spinning" tip="Loading...">
  104. <div class="flex-center" style="justify-content: space-between;">
  105. <div style="flex-grow:1;">
  106. <a-tabs v-model="currentTab" @change="changeTab">
  107. <a-tab-pane :key="1" tab="全部">
  108. </a-tab-pane>
  109. <a-tab-pane :key="2" tab="待打印">
  110. </a-tab-pane>
  111. </a-tabs>
  112. </div>
  113. <div>
  114. <span>显示:</span>
  115. <a-tree-select
  116. size="small"
  117. v-model="showCols"
  118. style="min-width: 200px"
  119. dropdownMatchSelectWidth
  120. :maxTagCount="3"
  121. :tree-data="colsArr"
  122. tree-checkable
  123. placeholder="请选择要显示的列"
  124. />
  125. </div>
  126. </div>
  127. <!-- 列表 -->
  128. <s-table
  129. class="sTable fixPagination"
  130. ref="table"
  131. :style="{ height: tableHeight+84.5+'px'}"
  132. size="small"
  133. :rowKey="(record) => record.id"
  134. :columns="columns"
  135. :data="loadData"
  136. :scroll="{ y:tableHeight }"
  137. :defaultLoadData="false"
  138. bordered>
  139. <!-- 销售单号 -->
  140. <template slot="salesBillNo" slot-scope="text, record">
  141. <span class="link-bule" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record,0)">{{ record.salesBillNo }}</span>
  142. <span v-else>{{ record.salesBillNo }}</span>
  143. </template>
  144. <!-- 备货单号 -->
  145. <template slot="dispatchBillNo" slot-scope="text, record">
  146. <span class="link-bule" v-if="$hasPermissions('B_dispatchDetail')" @click="handleDetail(record,1)">{{ record.dispatchBillNo }}</span>
  147. <span v-else>{{ record.dispatchBillNo }}</span>
  148. </template>
  149. <!-- 发货说明 -->
  150. <template slot="explainInfo" slot-scope="text, record">
  151. <span v-if="record.explainInfo" class="link-bule" @click="handleExplainInfo(record)" :title="record.explainInfo">{{ record.explainInfo||'--' }}</span>
  152. <span v-else>--</span>
  153. </template>
  154. <!-- 备货打印状态 -->
  155. <template slot="printStatus" slot-scope="text, record">
  156. <span v-if="record.printStatus=='NO_PRINT'&&$hasPermissions('B_noPrintStatus')" class="link-bule" @click="handlePrintStatus(record)">{{ record.printStatusDictValue }}</span>
  157. <span v-else>{{ record.printStatusDictValue }}</span>
  158. </template>
  159. <div slot="costTitle">
  160. <a-tooltip placement="top">
  161. <template slot="title">
  162. 如果收货客户名称不为空,则按照收货客户级别的价格计算得到(实际总金额包含所有产品的原售价)。
  163. </template>
  164. <span style="margin-right: 5px;">实际总金额(保价)</span> <a-icon type="question-circle" />
  165. </a-tooltip>
  166. </div>
  167. <!-- 操作 -->
  168. <template slot="action" slot-scope="text, record">
  169. <a-button
  170. size="small"
  171. type="link"
  172. v-if="record.printStatus == 'NO_PRINT'&&record.voidFlag==0&&$hasPermissions('B_sendTypePrint')"
  173. class="button-warning"
  174. @click="handlePrint(record)"
  175. >发货分类打印</a-button>
  176. <a-button
  177. size="small"
  178. type="link"
  179. class="button-warning"
  180. v-else-if="record.printStatus == 'PRINT'&&$hasPermissions('B_stockPrintRecord')"
  181. @click="viewPrint(record)"
  182. >打印记录</a-button>
  183. <span v-else>--</span>
  184. </template>
  185. </s-table>
  186. <!-- 分类打印 -->
  187. <sendTypeModal v-drag ref="typePrint" :openModal="showTipModal" @ok="handlePrintOk" @close="showTipModal=false" />
  188. <!-- 打印记录 -->
  189. <recordModal v-drag ref="recordModal" modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
  190. <!-- 查看销售单或备货单详情 -->
  191. <commonModal
  192. :modalTit="detailType?'备货单详情':'销售单详情'"
  193. bodyPadding="10px"
  194. width="70%"
  195. :showFooter="false"
  196. :openModal="showDetailModal"
  197. @cancel="cancelDetail">
  198. <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
  199. <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
  200. </commonModal>
  201. <!-- 操作提示 -->
  202. <commonModal modalTit="操作提示" okText="暂不打印" :openModal="showPrintModal" @cancel="canselModal" @ok="updatePrintStatus">
  203. <div style="display:flex;flex-direction: column;align-items: center;">
  204. <div style="margin-bottom: 15px;font-size: 14px;">如需将打印状态回退至<strong>【暂不打印】</strong>,请点击下方按钮</div>
  205. <div style="line-height: 24px;">
  206. <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
  207. <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
  208. </div>
  209. </div>
  210. </commonModal>
  211. <!-- 发货说明 -->
  212. <explainInfoModal v-drag mode="view" :rowData="tipData" :openModal="showInfoModal" @close="canselModal"></explainInfoModal>
  213. </a-spin>
  214. </a-card>
  215. </div>
  216. </template>
  217. <script>
  218. import { commonMixin } from '@/utils/mixin'
  219. import rangeDate from '@/views/common/rangeDate.vue'
  220. import { STable, VSelect } from '@/components'
  221. import subarea from '@/views/common/subarea.js'
  222. import Area from '@/views/common/area.js'
  223. import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
  224. import sendTypeModal from './sendTypeModal.vue'
  225. import recordModal from './recordModal.vue'
  226. import commonModal from '@/views/common/commonModal.vue'
  227. import chooseWarehouse from '@/views/common/chooseWarehouse'
  228. import customerService from '@/views/common/customerService'
  229. import salesDetail from '@/views/salesManagement/salesQueryNew/detailAll.vue'
  230. import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
  231. import explainInfoModal from '@/views/salesManagement/pushOrderManagement/explainInfoModal.vue'
  232. import { dispatchlList, dispatchDetailPrint, dispatchPrintStatus } from '@/api/dispatch'
  233. import { printBase64Fun } from '@/libs/JGPrint.js'
  234. export default {
  235. name: 'StockPrintList',
  236. mixins: [commonMixin],
  237. components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, sendTypeModal, recordModal, Area, commonModal, salesDetail, dispatchDetail, explainInfoModal, chooseWarehouse, customerService },
  238. data () {
  239. return {
  240. spinning: false,
  241. advanced: true, // 高级搜索 展开/关闭
  242. disabled: false, // 查询、重置按钮是否可操作
  243. showDetailModal: false,
  244. detailType: 2,
  245. bizSn: null,
  246. tableHeight: 0,
  247. time: [],
  248. currentTab: 2,
  249. // 查询参数
  250. queryParam: {
  251. beginDate: '',
  252. endDate: '',
  253. buyerSn: undefined, // 客户名称
  254. receiverSn: undefined, // 收货客户名称
  255. salesBillNo: '', // 销售单号
  256. dispatchBillNo: '', // 备货单号
  257. billStatus: undefined, // 业务状态
  258. warehouseSn: undefined,
  259. subareaArea: {
  260. subareaSn: undefined,
  261. subareaAreaSn: undefined
  262. },
  263. shippingAddrProvinceSn: undefined,
  264. voidFlag: 0,
  265. printStatus: 'NO_PRINT',
  266. bizUserSn: undefined
  267. },
  268. showTipModal: false,
  269. showRecordModal: false,
  270. // 加载数据方法 必须为 Promise 对象
  271. loadData: parameter => {
  272. this.disabled = true
  273. this.spinning = true
  274. return dispatchlList(Object.assign(parameter, this.queryParam)).then(res => {
  275. let data
  276. if (res.status == 200) {
  277. data = res.data
  278. const no = (data.pageNo - 1) * data.pageSize
  279. for (var i = 0; i < data.list.length; i++) {
  280. data.list[i].no = no + i + 1
  281. }
  282. this.disabled = false
  283. }
  284. this.spinning = false
  285. return data
  286. })
  287. },
  288. tipData: null,
  289. showPrintModal: false,
  290. showInfoModal: false,
  291. showCols: [],
  292. colsArr: [
  293. {
  294. title: '销售单号',
  295. value: 'salesBillNo',
  296. key: 'salesBillNo'
  297. },
  298. {
  299. title: '仓库',
  300. value: 'warehouseName',
  301. key: 'warehouseName'
  302. },
  303. {
  304. title: '业务状态',
  305. value: 'billStatusDictValue',
  306. key: 'billStatusDictValue'
  307. },
  308. {
  309. title: '单据状态',
  310. value: 'voidFlagDictValue',
  311. key: 'voidFlagDictValue'
  312. },
  313. {
  314. title: '允许打印时间',
  315. value: 'allowPrintTime',
  316. key: 'allowPrintTime'
  317. },
  318. {
  319. title: '打印次数',
  320. value: 'stockUpPrintTimes',
  321. key: 'stockUpPrintTimes'
  322. }
  323. ]
  324. }
  325. },
  326. computed: {
  327. columns () {
  328. const arr = [
  329. { title: '序号', dataIndex: 'no', width: '30px', align: 'center' },
  330. { title: '创建时间', dataIndex: 'createDate', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
  331. { title: '备货单号', scopedSlots: { customRender: 'dispatchBillNo' }, width: '80px', align: 'center' },
  332. { title: '发货编号', dataIndex: 'sendNo', width: '30px', align: 'center', customRender: function (text) { return text || '--' } },
  333. { title: '发货说明', scopedSlots: { customRender: 'explainInfo' }, width: '100px', align: 'center', ellipsis: true },
  334. { title: '客户名称', dataIndex: 'buyerName', width: '120px', align: 'left', customRender: function (text) { return text || '--' } },
  335. { title: '收货客户名称', dataIndex: 'receiverName', width: '110px', align: 'left', customRender: function (text) { return text || '--' } },
  336. { title: '产品款数', dataIndex: 'totalCategory', width: '30px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  337. { title: '产品数量', dataIndex: 'totalQty', width: '30px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  338. ]
  339. if (this.showCols.includes('salesBillNo')) {
  340. arr.splice(2, 0, { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '80px', align: 'center' })
  341. }
  342. if (this.$hasPermissions('M_stockPrintList_salesPrice')) { // 售价权限
  343. const ind = this.isShowWarehouse ? 10 : 9
  344. arr.splice(ind, 0, { title: '开单总金额', dataIndex: 'totalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  345. arr.splice(ind + 1, 0, { title: '正价总金额', dataIndex: 'normalTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  346. arr.splice(ind + 2, 0, { slots: { title: 'costTitle' }, dataIndex: 'receiveTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  347. arr.splice(ind + 3, 0, { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  348. arr.splice(ind + 4, 0, { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  349. arr.splice(ind + 5, 0, { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  350. arr.splice(ind + 6, 0, { title: '轮胎售价', dataIndex: 'receiveLtTotalAmount', width: '50px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
  351. }
  352. if (this.showCols.includes('warehouseName')) {
  353. arr.push({ title: '仓库', dataIndex: 'warehouseName', width: '50px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
  354. }
  355. if (this.showCols.includes('billStatusDictValue')) {
  356. arr.push({ title: '业务状态', dataIndex: 'billStatusDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
  357. }
  358. if (this.showCols.includes('voidFlagDictValue')) {
  359. arr.push({ title: '单据状态', dataIndex: 'voidFlagDictValue', width: '40px', align: 'center', customRender: function (text) { return text || '--' } })
  360. }
  361. arr.push({ title: '备货打印状态', width: '40px', align: 'center', scopedSlots: { customRender: 'printStatus' } })
  362. if (this.showCols.includes('allowPrintTime')) {
  363. arr.push({ title: '允许打印时间', dataIndex: 'allowPrintTime', width: '50px', align: 'center', customRender: function (text) { return text || '--' } })
  364. }
  365. if (this.showCols.includes('stockUpPrintTimes')) {
  366. arr.push({ title: '打印次数', dataIndex: 'stockUpPrintTimes', width: '40px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
  367. }
  368. arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '60px', align: 'center' })
  369. return arr
  370. }
  371. },
  372. methods: {
  373. changeTab (v) {
  374. this.currentTab = v
  375. this.resetSearchForm()
  376. },
  377. // 时间 change
  378. dateChange (date) {
  379. this.queryParam.beginDate = date[0]
  380. this.queryParam.endDate = date[1]
  381. },
  382. custChange (val) {
  383. this.queryParam.buyerSn = val.key
  384. },
  385. shcustChange (val) {
  386. this.queryParam.receiverSn = val.key
  387. },
  388. handleDetail (row, type) {
  389. this.detailType = type
  390. this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
  391. this.$store.state.app.curActionPermission = type == 0 ? 'B_salesDetail' : 'B_dispatchDetail'
  392. this.showDetailModal = true
  393. },
  394. cancelDetail () {
  395. this.showDetailModal = false
  396. this.detailType = 2
  397. this.bizSn = null
  398. this.$store.state.app.curActionPermission = ''
  399. },
  400. // 发货分类打印
  401. handlePrint (row) {
  402. this.$refs.typePrint.setData(row, row.dispatchBillSn)
  403. this.showTipModal = true
  404. },
  405. // 发货分类打印
  406. handlePrintOk (obj, taskName, type) {
  407. const _this = this
  408. const params = {
  409. type: 'DISPATCH_BILL_TYPE',
  410. dispatchBillSn: obj.dispatchBillSn
  411. }
  412. // 货位编号
  413. if (obj.orderBy) {
  414. params.type = params.type + '_STACK_PLACE'
  415. }
  416. // 原厂编码
  417. if (obj.origCode == 1) {
  418. params.type = params.type + '_ORIG_CODE'
  419. }
  420. // 装箱号
  421. if (obj.packNo == 1) {
  422. params.type = params.type + '_PACK_NUM'
  423. }
  424. _this.spinning = true
  425. printBase64Fun(
  426. dispatchDetailPrint,
  427. Object.assign(params, obj || {}),
  428. type,
  429. taskName,
  430. () => {
  431. _this.$store.state.app.curActionPermission = ''
  432. _this.$refs.table.refresh(true)
  433. _this.spinning = false
  434. },
  435. {
  436. billType: 'DISPATCH',
  437. billSn: params.dispatchBillSn,
  438. billNo: obj.dispatchBillNo,
  439. printType: taskName + '打印'
  440. })
  441. },
  442. // 打印记录
  443. viewPrint (row) {
  444. this.showRecordModal = true
  445. this.$refs.recordModal.setData(row, {
  446. billType: 'DISPATCH',
  447. billSn: row.dispatchBillSn
  448. })
  449. },
  450. // 允许备货打印
  451. handlePrintStatus (row) {
  452. this.tipData = row
  453. this.showPrintModal = true
  454. },
  455. canselModal () {
  456. this.tipData = null
  457. this.showPrintModal = false
  458. this.showInfoModal = false
  459. },
  460. updatePrintStatus () {
  461. dispatchPrintStatus({ dispatchBillSn: this.tipData.dispatchBillSn, printStatus: 'UNABLE_PRINT' }).then(res => {
  462. if (res.status == 200) {
  463. this.canselModal()
  464. this.$message.info(res.message)
  465. this.$refs.table.refresh()
  466. }
  467. })
  468. },
  469. // 查看发货说明
  470. handleExplainInfo (row) {
  471. this.tipData = row
  472. this.showInfoModal = true
  473. },
  474. subareaChange (val) {
  475. this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
  476. this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
  477. },
  478. // 重置
  479. resetSearchForm () {
  480. this.time = []
  481. this.$refs.rangeDate.resetDate(this.time)
  482. this.queryParam.beginDate = ''
  483. this.queryParam.endDate = ''
  484. this.queryParam.buyerSn = undefined
  485. this.queryParam.receiverSn = undefined
  486. this.$refs.dealerSubareaScopeList.resetForm()
  487. this.$refs.shbuyerName.resetForm()
  488. this.queryParam.salesBillNo = ''
  489. this.queryParam.dispatchBillNo = ''
  490. this.queryParam.billStatus = undefined
  491. this.queryParam.subareaArea.subareaSn = undefined
  492. this.queryParam.subareaArea.subareaAreaSn = undefined
  493. this.queryParam.shippingAddrProvinceSn = undefined
  494. this.queryParam.bizUserSn = undefined
  495. this.queryParam.voidFlag = this.currentTab == 1 ? '' : '0'
  496. this.queryParam.warehouseSn = undefined
  497. this.queryParam.printStatus = this.currentTab == 1 ? '' : 'NO_PRINT'
  498. if (this.advanced) {
  499. this.$refs.subarea.clearData()
  500. }
  501. this.$refs.table.refresh(true)
  502. this.pageInit()
  503. },
  504. pageInit () {
  505. const _this = this
  506. this.$nextTick(() => { // 页面渲染完成后的回调
  507. _this.setTableH()
  508. })
  509. },
  510. setTableH () {
  511. const tableSearchH = this.$refs.tableSearch.offsetHeight
  512. this.tableHeight = window.innerHeight - tableSearchH - 260
  513. }
  514. },
  515. watch: {
  516. advanced (newValue, oldValue) {
  517. const _this = this
  518. this.$nextTick(() => { // 页面渲染完成后的回调
  519. _this.setTableH()
  520. })
  521. },
  522. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  523. this.setTableH()
  524. }
  525. },
  526. mounted () {
  527. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  528. this.pageInit()
  529. this.resetSearchForm()
  530. }
  531. },
  532. activated () {
  533. // 如果是新页签打开,则重置当前页面
  534. if (this.$store.state.app.isNewTab) {
  535. this.pageInit()
  536. this.resetSearchForm()
  537. }
  538. // 仅刷新列表,不重置页面
  539. if (this.$store.state.app.updateList) {
  540. this.pageInit()
  541. this.$refs.table.refresh()
  542. }
  543. },
  544. beforeRouteEnter (to, from, next) {
  545. next(vm => {})
  546. }
  547. }
  548. </script>
  549. <style lang="less">
  550. .stockPrint-wrap{
  551. .sTable{
  552. margin-top: 10px;
  553. }
  554. .stockPrint-body{
  555. .ant-card-body{
  556. padding-top:5px;
  557. }
  558. }
  559. .ant-tabs-bar{
  560. margin:0;
  561. }
  562. }
  563. </style>