|
@@ -13,10 +13,15 @@
|
|
|
<a-collapse-panel key="1">
|
|
|
<template slot="header">
|
|
|
<span>基础信息</span>
|
|
|
- <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
|
|
|
+ <a-button icon="edit" v-if="basicInfoData&&basicInfoData.state!='WRITE_OFF'&&basicInfoData.state!='SUSPEND'" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
|
|
|
</template>
|
|
|
<a-descriptions :column="2">
|
|
|
- <a-descriptions-item label="货架名称">{{ basicInfoData&&basicInfoData.shelfName || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="货架名称">
|
|
|
+ {{ basicInfoData&&basicInfoData.shelfName || '--' }}
|
|
|
+ <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="basicInfoData&&basicInfoData.state=='WRITE_OFF'"></a-badge>
|
|
|
+ <a-badge count="已停用" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="basicInfoData&&basicInfoData.state=='DISABLED'"></a-badge>
|
|
|
+ <a-badge count="已暂停" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="basicInfoData&&basicInfoData.state=='SUSPEND'"></a-badge>
|
|
|
+ </a-descriptions-item>
|
|
|
<a-descriptions-item>
|
|
|
<template slot="label">
|
|
|
货架产品
|
|
@@ -63,13 +68,20 @@
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfSet-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="shelfSet-reset">重置</a-button>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleExport"
|
|
|
+ :disabled="disabled"
|
|
|
+ :loading="exportLoading"
|
|
|
+ >导出</a-button>
|
|
|
</span>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
<!-- 操作按钮 -->
|
|
|
- <div class="table-operator">
|
|
|
+ <div class="table-operator" v-if="basicInfoData&&basicInfoData.state!='WRITE_OFF'&&basicInfoData.state!='SUSPEND'">
|
|
|
<a-button id="shelfSet-addHW" type="primary" class="button-error" @click="addHW(1)">新增货位</a-button>
|
|
|
<a-button id="shelfSet-impoort" type="primary" class="button-info" @click="addHW(0)">批量导入货位</a-button>
|
|
|
<a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
|
|
@@ -166,6 +178,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import { downloadExcel } from '@/libs/JGPrint.js'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import commonModal from '@/views/common/commonModal.vue'
|
|
|
import addHwModal from './addHwModal.vue'
|
|
@@ -173,34 +186,23 @@ import bindProductModal from './bindProductModal.vue'
|
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
|
import importHuoweiModal from './importHuoweiModal.vue'
|
|
|
-import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn, shelfProductEnable, getShelfPriceShow } from '@/api/shelf'
|
|
|
+import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn, shelfProductEnable, getShelfPriceShow, shelfProductExport } from '@/api/shelf'
|
|
|
export default {
|
|
|
name: 'ShelfMonitoringWarehousing',
|
|
|
components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal },
|
|
|
mixins: [commonMixin],
|
|
|
data () {
|
|
|
- const _this = this
|
|
|
return {
|
|
|
spinning: false,
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
tableHeight: 400,
|
|
|
+ exportLoading: false,
|
|
|
queryParam: {
|
|
|
shelfProductApiEntity: {
|
|
|
productCode: '',
|
|
|
productName: ''
|
|
|
}
|
|
|
},
|
|
|
- columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '绑定产品编码', dataIndex: 'shelfProductApiEntity.productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '绑定产品名称', dataIndex: 'shelfProductApiEntity.productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '车主价', dataIndex: 'shelfProductApiEntity.price', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
- { slots: { title: 'customTitle' }, dataIndex: 'shelfProductApiEntity.cost', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
- { title: '最大库容', dataIndex: 'shelfProductApiEntity.maxQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '当前库存', dataIndex: 'shelfProductApiEntity.qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
- ],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -232,6 +234,25 @@ export default {
|
|
|
showNoShelfPriceStr: []
|
|
|
}
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ columns(){
|
|
|
+ const _this = this
|
|
|
+ const ret = [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
+ { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '绑定产品编码', dataIndex: 'shelfProductApiEntity.productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '绑定产品名称', dataIndex: 'shelfProductApiEntity.productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '车主价', dataIndex: 'shelfProductApiEntity.price', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
+ { slots: { title: 'customTitle' }, dataIndex: 'shelfProductApiEntity.cost', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
+ { title: '最大库容', dataIndex: 'shelfProductApiEntity.maxQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '当前库存', dataIndex: 'shelfProductApiEntity.qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ ]
|
|
|
+ if(this.basicInfoData&&this.basicInfoData.state!='WRITE_OFF'&&this.basicInfoData.state!='SUSPEND'){
|
|
|
+ ret.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' })
|
|
|
+ }
|
|
|
+ return ret
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 获取价格显示设置
|
|
|
getShelfPriceShow () {
|
|
@@ -258,6 +279,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 导出产品
|
|
|
+ handleExport () {
|
|
|
+ this.exportLoading = true
|
|
|
+ shelfProductExport({shelfSn: this.$route.params.sn}).then(res => {
|
|
|
+ downloadExcel(res, (this.basicInfoData?this.basicInfoData.shelfName:'')+"的产品")
|
|
|
+ this.exportLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 导入或新增货位
|
|
|
addHW (type) {
|
|
|
// 导入货位
|