list.vue 23 KB

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