list.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <a-card size="small" :bordered="false" class="replenishmentManagementList-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <!-- 标签页 -->
  7. <a-tabs type="card" v-model="queryParam.bizType" @change="handleTabChange" class="replenishmentManagementList-tabs">
  8. <a-tab-pane v-for="item in tabPaneData" :key="item.bizType">
  9. <p slot="tab" :id="'tab-'+item.bizType">{{ item.bizName }}<span v-if="item.countNum && item.bizName!='全部'&&item.bizName!='已完成'&&item.bizName!='已取消'" style="color: red;">({{ item.countNum }})</span></p>
  10. </a-tab-pane>
  11. </a-tabs>
  12. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  13. <a-row :gutter="15">
  14. <a-col :md="6" :sm="24" v-if="queryParam.bizType=='WAIT_CHECK'">
  15. <a-form-item label="出库时间">
  16. <rangeDate id="replenishmentManagementList-otime" ref="rangeDate" :value="time" @change="dateChange" />
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="24" v-else-if="queryParam.bizType=='FINISH'">
  20. <a-form-item label="签收时间">
  21. <rangeDate id="replenishmentManagementList-qstime" ref="rangeDate" :value="time" @change="dateChange" />
  22. </a-form-item>
  23. </a-col>
  24. <a-col :md="6" :sm="24" v-else>
  25. <a-form-item label="创建时间">
  26. <rangeDate id="replenishmentManagementList-ctime" ref="rangeDate" :value="time" @change="dateChange" />
  27. </a-form-item>
  28. </a-col>
  29. <a-col :md="6" :sm="24">
  30. <a-form-item label="补货单号">
  31. <a-input id="replenishmentManagementList-replenishBillNo" v-model.trim="queryParam.replenishBillNo" allowClear placeholder="请输入补货单号" />
  32. </a-form-item>
  33. </a-col>
  34. <a-col :md="6" :sm="24">
  35. <a-form-item label="货架名称">
  36. <shelfSList id="replenishmentManagementList-shlefsn" :showAll="true" v-model="queryParam.shelfSn"></shelfSList>
  37. </a-form-item>
  38. </a-col>
  39. <template v-if="advanced">
  40. <a-col :md="6" :sm="24">
  41. <a-form-item label="产品编码"><a-input id="replenishmentManagementList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码" /></a-form-item>
  42. </a-col>
  43. <a-col :md="6" :sm="24">
  44. <a-form-item label="产品名称">
  45. <a-input id="replenishmentManagementList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称" />
  46. </a-form-item>
  47. </a-col>
  48. </template>
  49. <a-col :md="6" :sm="24">
  50. <span class="table-page-search-submitButtons">
  51. <a-button type="primary" style="margin-left: 5px" @click="queryByTypeSum" :disabled="disabled" id="replenishmentManagementList-refresh">查询</a-button>
  52. <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="replenishmentManagementList-reset">重置</a-button>
  53. <a @click="advanced = !advanced" style="margin-left: 5px" id="replenishmentManagementList-advanced">
  54. {{ advanced ? '收起' : '展开' }}
  55. <a-icon :type="advanced ? 'up' : 'down'" />
  56. </a>
  57. </span>
  58. </a-col>
  59. </a-row>
  60. </a-form>
  61. <!-- 操作按钮 -->
  62. <div class="table-operator">
  63. <a-button id="replenishmentManagementList-bhcp" type="primary" class="button-error" @click="openSlodOut=true">待补货产品</a-button>
  64. <span style="margin-left:10px;color:#999;">请点击此按钮,选择需要补货的产品创建补货单</span>
  65. </div>
  66. </div>
  67. <s-table
  68. class="sTable fixPagination"
  69. ref="table"
  70. :style="{ height: tableHeight+84.5+'px' }"
  71. size="small"
  72. :rowKey="(record) => record.id"
  73. :columns="columns"
  74. :data="loadData"
  75. :expandedRowKeys="expandedRowKeys"
  76. @expand="expandFun"
  77. :expandRowByClick="true"
  78. :scroll="{ y: tableHeight }"
  79. :defaultLoadData="false"
  80. bordered>
  81. <a-table
  82. v-if="listData&&listData[index]"
  83. slot="expandedRowRender"
  84. slot-scope="record, index"
  85. size="small"
  86. :rowKey="(record) => record.id"
  87. :columns="subColumns"
  88. :data-source="listData[index].subList"
  89. :pagination="false"
  90. :bordered="false"
  91. style="margin: 15px 10px;">
  92. </a-table>
  93. <!-- 操作 -->
  94. <template slot="action" slot-scope="text, record">
  95. <!-- <a-button :id="'rmpList-confirm-'+record.id" v-if="record.billState=='WAIT_CONFIRM'" size="small" type="link" class="button-primary" @click.stop="handleConfirm(record)">确认</a-button> -->
  96. <a-button
  97. :id="'rmpList-outstock-'+record.id"
  98. v-if="record.billState=='WAIT_OUT_STOCK'"
  99. size="small"
  100. type="link"
  101. class="button-primary"
  102. @click.stop="handleOutWarehousing(record)">出库</a-button>
  103. <a-button
  104. :id="'rmpList-sign-'+record.id"
  105. v-if="record.billState=='WAIT_CHECK'"
  106. size="small"
  107. type="link"
  108. class="button-primary"
  109. @click.stop="handlePutWarehousing(record)">签收</a-button>
  110. <a-button
  111. :id="'rmpList-cancel-'+record.id"
  112. v-if="record.billState=='WAIT_CONFIRM' || record.billState=='WAIT_OUT_STOCK'"
  113. size="small"
  114. type="link"
  115. class="button-primary"
  116. @click.stop="handleCancelOrder(record)">取消补货单</a-button>
  117. <a-button
  118. :id="'rmpList-del-'+record.id"
  119. v-if="record.billState=='CANCEL'"
  120. size="small"
  121. type="link"
  122. class="button-error"
  123. @click.stop="handleDelete(record)">删除</a-button>
  124. <a-button v-if="record.billState!='CANCEL'&&record.billState!='WAIT_CONFIRM'" size="small" type="link" class="button-primary" @click.stop="handlePrintSticker(record)">打印贴签</a-button>
  125. </template>
  126. <!-- 货架名称 -->
  127. <template slot="shelfName" slot-scope="text, record">
  128. {{ text }}
  129. <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.shelfInfo.state=='WRITE_OFF'"></a-badge>
  130. <a-badge count="已暂停" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.shelfInfo.state=='SUSPEND'"></a-badge>
  131. <a-badge count="已停用" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.shelfInfo.state=='DISABLED'"></a-badge>
  132. </template>
  133. <!-- 补货单号 -->
  134. <template slot="replenishBillNo" slot-scope="text, record">
  135. <span class="table-td-link" @click.stop="handleDetail(record)">{{ record.replenishBillNo }}</span>
  136. </template>
  137. </s-table>
  138. <!-- 确认 -->
  139. <confirm-modal :openModal="openConfirmModal" :nowData="nowData" @ok="handleValidate" @close="handleCancel" />
  140. <!-- 库存不足,确认弹框 -->
  141. <stock-modal
  142. :openModal="openStockModal"
  143. :type="validateType"
  144. :params="paramsData"
  145. :listData="stockList"
  146. @ok="handleStockOk"
  147. @close="handleStockCancel" />
  148. <!-- 打印贴签 -->
  149. <print-sticker-modal :openModal="openPrintStickerModal" :nowData="nowData" @ok="handlePrintStickerOk" @close="handleCancel" />
  150. <!-- 出库 -->
  151. <out-warehousing-modal :openModal="openOutWarehousingModal" :nowData="nowData" @ok="handleOutWarehousingOk" @close="handleCancel" />
  152. <!-- 签收 -->
  153. <put-warehousing-modal :openModal="openPutWarehousingModal" :nowData="nowData" @ok="handlePutWarehousingOk" @close="handleCancel" />
  154. <!-- 详情 -->
  155. <detailModal :openModal="openDetailModal" :nowData="nowData" @close="handleCancel" />
  156. <!-- 待补货产品 -->
  157. <slodOutModal :openModal="openSlodOut" @close="openSlodOut=false" />
  158. </a-spin>
  159. </a-card>
  160. </template>
  161. <script>
  162. import { commonMixin } from '@/utils/mixin'
  163. import { STable, VSelect } from '@/components'
  164. import getDate from '@/libs/getDate.js'
  165. import rangeDate from '@/views/common/rangeDate.vue'
  166. import shelfSList from '@/views/common/shelfList'
  167. import confirmModal from './confirmModal.vue'
  168. import stockModal from './stockModal.vue'
  169. import printStickerModal from './printStickerModal.vue'
  170. import outWarehousingModal from './outWarehousingModal.vue'
  171. import putWarehousingModal from './putWarehousingModal.vue'
  172. import detailModal from './detailModal.vue'
  173. import slodOutModal from './slodOutModal.vue'
  174. import { shelfReplenishList, shelfReplenishDetailList, shelfReplenishCancel, shelfReplenishStateCount, shelfReplenishDetailStock, shelfReplenishConfirm, shelfReplenishDelete } from '@/api/shelfReplenish'
  175. export default {
  176. components: { STable, VSelect, rangeDate, shelfSList, confirmModal, stockModal, printStickerModal, outWarehousingModal, putWarehousingModal, detailModal, slodOutModal },
  177. mixins: [commonMixin],
  178. data () {
  179. return {
  180. isNotProd: false,
  181. spinning: false,
  182. advanced: true, // 高级搜索 展开/关闭
  183. tableHeight: 0, // 表格高度
  184. disabled: false, // 查询、重置按钮是否可操作
  185. curBizType: 'ALL', // 当前页签值
  186. time: [ // 时间默认值
  187. getDate.getCurrMonthDays().starttime,
  188. getDate.getCurrMonthDays().endtime
  189. ],
  190. // 查询参数
  191. queryParam: {
  192. bDate: getDate.getCurrMonthDays().starttime, // 开始时间
  193. eDate: getDate.getCurrMonthDays().endtime, // 结束时间
  194. bizType: 'ALL', // 全部
  195. replenishBillNo: '', // 补货单号
  196. shelfSn: undefined, // 货架sn
  197. productCode: '', // 产品编码
  198. productName: '' // 产品名称
  199. },
  200. expandedRowKeys: [], // 展开的key
  201. // 加载数据方法 必须为 Promise 对象
  202. loadData: parameter => {
  203. this.disabled = true
  204. this.spinning = true
  205. this.expandedRowKeys = []
  206. parameter.billState = this.queryParam.bizType == 'ALL' ? '' : this.queryParam.bizType
  207. const params = Object.assign(parameter, this.queryParam)
  208. if (params.billState == 'WAIT_CHECK') { // 待签收
  209. params.outStockTimeBegin = this.queryParam.bDate
  210. params.outStockTimeEnd = this.queryParam.eDate
  211. } else if (params.billState == 'FINISH') { // 已完结
  212. params.putStockTimeBegin = this.queryParam.bDate
  213. params.putStockTimeEnd = this.queryParam.eDate
  214. } else { // 其它
  215. params.beginDate = this.queryParam.bDate
  216. params.endDate = this.queryParam.eDate
  217. }
  218. delete params.index
  219. delete params.tableId
  220. delete params.bizType
  221. return shelfReplenishList(params).then(res => {
  222. let data
  223. if (res.status == 200) {
  224. data = res.data
  225. const no = (data.pageNo - 1) * data.pageSize
  226. for (var i = 0; i < data.list.length; i++) {
  227. data.list[i].no = no + i + 1
  228. data.list[i].subList = []
  229. }
  230. this.listData = data.list || []
  231. this.disabled = false
  232. }
  233. this.spinning = false
  234. return data
  235. })
  236. },
  237. // 子表格列
  238. subColumns: [
  239. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  240. { title: '货位号', dataIndex: 'shelfPlaceCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
  241. { title: '产品编码', dataIndex: 'product.code', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
  242. { title: '产品名称', dataIndex: 'product.name', width: '32%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  243. { title: '补货数量', dataIndex: 'qty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  244. { title: '签收数量', dataIndex: 'putQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  245. { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
  246. ],
  247. listData: [], // 表格数据
  248. tabPaneData: [ // tab业务状态列表数据
  249. { bizName: '全部', bizType: 'ALL', countNum: 0 },
  250. // { bizName: '待确认', bizType: 'WAIT_CONFIRM', countNum: 0 },
  251. { bizName: '待出库', bizType: 'WAIT_OUT_STOCK', countNum: 0 },
  252. { bizName: '待签收', bizType: 'WAIT_CHECK', countNum: 0 },
  253. { bizName: '已完成', bizType: 'FINISH', countNum: 0 },
  254. { bizName: '已取消', bizType: 'CANCEL', countNum: 0 }
  255. ],
  256. nowData: null, // 当前操作数据
  257. openConfirmModal: false, // 是否打开确认弹框
  258. openStockModal: false, // 是否打开库存不足,确认弹框
  259. openPrintStickerModal: false, // 是否打开打印页签弹框
  260. openOutWarehousingModal: false, // 是否打开出库弹框
  261. openPutWarehousingModal: false, // 是否打开签收弹框
  262. openDetailModal: false, // 是否打开详情弹框
  263. openSlodOut: false, // 是否打开待补货弹框
  264. validateType: 'confirm', // 弹框类型
  265. stockList: [], // 库存不足明细
  266. paramsData: null // 参数
  267. }
  268. },
  269. computed: {
  270. columns () {
  271. const ret = [
  272. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  273. { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
  274. { title: '补货单号', dataIndex: 'replenishBillNo', scopedSlots: { customRender: 'replenishBillNo' }, width: '15%', align: 'center' },
  275. { title: '货架名称', dataIndex: 'shelfInfo.shelfName', scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', ellipsis: true },
  276. { title: '状态', dataIndex: 'billStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  277. { title: '补货总量', dataIndex: 'totalQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  278. { title: '签收总量', dataIndex: 'totalPutQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  279. { title: '操作', scopedSlots: { customRender: 'action' }, width: '16%', align: 'left' }
  280. ]
  281. if (this.queryParam.bizType == 'WAIT_CHECK') { // 待签收
  282. ret.splice(1, 1, { title: '出库时间', dataIndex: 'outStockTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
  283. } else if (this.queryParam.bizType == 'FINISH') { // 已完成
  284. ret.splice(1, 1, { title: '签收时间', dataIndex: 'putStockTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } })
  285. }
  286. return ret
  287. }
  288. },
  289. methods: {
  290. // 确认
  291. handleConfirm (row) {
  292. this.nowData = row
  293. this.openConfirmModal = true
  294. },
  295. // 补货详情
  296. handleDetail (row) {
  297. this.nowData = row
  298. this.openDetailModal = true
  299. },
  300. // 库存不足 确认 ok
  301. handleStockOk (type, params) {
  302. this.openStockModal = false
  303. this.openConfirmModal = false
  304. this.openOutWarehousingModal = false
  305. if (type == 'confirm') { // 确认
  306. this.confirmFun(params)
  307. }
  308. },
  309. // 库存不足 确认 cancel
  310. handleStockCancel () {
  311. this.stockList = []
  312. this.validateType = 'confirm'
  313. this.openStockModal = false
  314. },
  315. // 打印贴签
  316. handlePrintSticker (row) {
  317. this.nowData = row
  318. this.openPrintStickerModal = true
  319. },
  320. // 打印贴签 ok
  321. handlePrintStickerOk () {},
  322. // 出库
  323. handleOutWarehousing (row) {
  324. this.nowData = row
  325. this.openOutWarehousingModal = true
  326. },
  327. // 出库 ok
  328. handleOutWarehousingOk () {
  329. this.nowData = null
  330. this.openOutWarehousingModal = false
  331. this.queryByTypeSum(true)
  332. },
  333. // 弹框关闭后
  334. handleCancel () {
  335. this.nowData = null
  336. this.openConfirmModal = false
  337. this.openStockModal = false
  338. this.openPrintStickerModal = false
  339. this.openOutWarehousingModal = false
  340. this.openPutWarehousingModal = false
  341. this.openDetailModal = false
  342. },
  343. // 确认后
  344. handleValidate (type, params) {
  345. if (type == 'confirm') { // 确认
  346. this.confirmFun(params)
  347. }
  348. // this.spinning = true
  349. // 校验产品库存是否足够
  350. // shelfReplenishDetailStock(params).then(res => {
  351. // if (res.status == 200) {
  352. // if (res.data && res.data.length > 0) {
  353. // this.stockList = res.data
  354. // this.validateType = 'confirm'
  355. // this.paramsData = params
  356. // this.openStockModal = true
  357. // } else {
  358. // if (type == 'confirm') { // 确认
  359. // this.confirmFun(params)
  360. // }
  361. // }
  362. // }
  363. // })
  364. },
  365. // 提交确认
  366. confirmFun (params) {
  367. shelfReplenishConfirm(params).then(res => {
  368. if (res.status == 200) {
  369. this.$message.success('确认补货成功')
  370. this.$refs.table.refresh()
  371. this.handleCancel()
  372. }
  373. this.spinning = false
  374. })
  375. },
  376. // 签收
  377. handlePutWarehousing (row) {
  378. this.nowData = row
  379. this.openPutWarehousingModal = true
  380. },
  381. // 签收 ok
  382. handlePutWarehousingOk () {
  383. this.nowData = null
  384. this.openPutWarehousingModal = false
  385. this.queryByTypeSum(true)
  386. },
  387. // 取消补货单
  388. handleCancelOrder (row) {
  389. const _this = this
  390. this.$confirm({
  391. title: '提示',
  392. content: '确认取消补货单吗?',
  393. centered: true,
  394. onOk () {
  395. _this.spinning = true
  396. shelfReplenishCancel({ replenishBillSn: row.replenishBillSn }).then(res => {
  397. if (res.status == 200) {
  398. _this.$message.success(res.message)
  399. _this.$refs.table.refresh()
  400. _this.spinning = false
  401. } else {
  402. _this.spinning = false
  403. }
  404. })
  405. }
  406. })
  407. },
  408. // 删除补货单
  409. handleDelete (row) {
  410. const _this = this
  411. this.$confirm({
  412. title: '提示',
  413. content: '确认删除补货单吗?',
  414. centered: true,
  415. onOk () {
  416. _this.spinning = true
  417. shelfReplenishDelete({ replenishBillSn: row.replenishBillSn }).then(res => {
  418. if (res.status == 200) {
  419. _this.$message.success(res.message)
  420. _this.$refs.table.refresh()
  421. _this.spinning = false
  422. } else {
  423. _this.spinning = false
  424. }
  425. })
  426. }
  427. })
  428. },
  429. // 展开表格获取子表格数据
  430. expandFun (expanded, record) {
  431. if (expanded) {
  432. this.expandedRowKeys.push(record.id)
  433. this.getSubItem(record) // 获取表格内部数据
  434. } else {
  435. const i = this.expandedRowKeys.findIndex(item => item == record.id)
  436. this.expandedRowKeys.splice(i, 1)
  437. }
  438. },
  439. // 获取子节点数据
  440. getSubItem (record) {
  441. this.spinning = true
  442. shelfReplenishDetailList({ replenishBillSn: record.replenishBillSn }).then(res => {
  443. const ind = this.listData.findIndex(item => item.id == record.id)
  444. if (ind >= 0) {
  445. if (res.status == 200 && res.data && res.data.length) {
  446. res.data.map((item, index) => {
  447. item.no = index + 1
  448. })
  449. this.listData[ind].subList = res.data
  450. } else {
  451. this.listData[ind].subList = []
  452. }
  453. }
  454. this.spinning = false
  455. })
  456. },
  457. // 重置列表
  458. resetSearchForm () {
  459. this.resetData()
  460. this.queryByTypeSum()
  461. },
  462. // 重置筛选数据
  463. resetData () {
  464. this.$refs.rangeDate.resetDate(this.time)
  465. this.queryParam.bDate = getDate.getCurrMonthDays().starttime
  466. this.queryParam.eDate = getDate.getCurrMonthDays().endtime
  467. this.queryParam.bizType = this.curBizType
  468. this.queryParam.replenishBillNo = ''
  469. this.queryParam.shelfSn = undefined
  470. this.queryParam.productCode = ''
  471. this.queryParam.productName = ''
  472. },
  473. // 选择时间 change
  474. dateChange (date) {
  475. this.queryParam.bDate = date[0] || null
  476. this.queryParam.eDate = date[1] || null
  477. },
  478. // 选择类型
  479. handleTabChange (key) {
  480. this.expandedRowKeys = []
  481. this.queryParam.bizType = key
  482. this.curBizType = key
  483. this.resetSearchForm()
  484. },
  485. // 选择客户 change
  486. custChange (obj) {
  487. this.queryParam.customerSn = obj.key || undefined
  488. },
  489. // 获取类型
  490. queryByTypeSum (flag) {
  491. const params = JSON.parse(JSON.stringify(this.queryParam))
  492. if (params.bizType == 'WAIT_CHECK') {
  493. params.outStockTimeBegin = this.queryParam.bDate
  494. params.outStockTimeEnd = this.queryParam.eDate
  495. } else if (params.bizType == 'FINISH') {
  496. params.putStockTimeBegin = this.queryParam.bDate
  497. params.putStockTimeEnd = this.queryParam.eDate
  498. } else {
  499. params.beginDate = this.queryParam.bDate
  500. params.endDate = this.queryParam.eDate
  501. }
  502. delete params.bizType
  503. this.spinning = true
  504. shelfReplenishStateCount(params).then(res => {
  505. if (res.data && res.status == 200) {
  506. // this.tabPaneData[1].countNum = res.data.WAIT_CONFIRM || 0
  507. this.tabPaneData[1].countNum = res.data.WAIT_OUT_STOCK || 0
  508. this.tabPaneData[2].countNum = res.data.WAIT_CHECK || 0
  509. this.tabPaneData[3].countNum = res.data.FINISH || 0
  510. this.tabPaneData[4].countNum = res.data.CANCEL || 0
  511. this.queryParam.bizType = this.curBizType
  512. this.$refs.table.refresh(!flag)
  513. }
  514. this.spinning = false
  515. })
  516. },
  517. // 计算表格高度
  518. setTableH () {
  519. const tableSearchH = this.$refs.tableSearch.offsetHeight
  520. this.tableHeight = window.innerHeight - tableSearchH - 200
  521. },
  522. // 页面初始化
  523. pageInit () {
  524. const _this = this
  525. this.isNotProd = !!process.env.VUE_APP_ENVTIPS
  526. this.$nextTick(() => { // 页面渲染完成后的回调
  527. _this.setTableH()
  528. })
  529. // 默认tab
  530. this.curBizType = this.$route.query && this.$route.query.bizType || this.curBizType
  531. // 获取类型列表
  532. this.queryByTypeSum()
  533. // 是否自动打开补货弹框
  534. if (this.$route.query && this.$route.query.bizType == 'ALL') {
  535. this.openSlodOut = true
  536. }
  537. }
  538. },
  539. watch: {
  540. advanced (newValue, oldValue) {
  541. const _this = this
  542. this.$nextTick(() => { // 页面渲染完成后的回调
  543. _this.setTableH()
  544. })
  545. },
  546. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  547. this.setTableH()
  548. }
  549. },
  550. mounted () {
  551. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  552. this.resetData()
  553. this.pageInit()
  554. }
  555. },
  556. activated () {
  557. // 如果是新页签打开,则重置当前页面
  558. if (this.$store.state.app.isNewTab) {
  559. this.resetData()
  560. this.pageInit()
  561. }
  562. }
  563. }
  564. </script>
  565. <style lang="less">
  566. .replenishmentManagementList-wrap{
  567. .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-bar{
  568. margin: 0 0 10px 0!important;
  569. }
  570. .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-nav-container{
  571. height: 30px!important;
  572. }
  573. .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab-active{
  574. height: 30px!important;
  575. }
  576. .replenishmentManagementList-tabs.ant-tabs.ant-tabs-card .ant-tabs-card-bar .ant-tabs-tab{
  577. line-height: 26px!important;
  578. height: 30px!important;
  579. }
  580. }
  581. </style>