|
@@ -49,6 +49,11 @@
|
|
:scroll="{ y: tableHeight }"
|
|
:scroll="{ y: tableHeight }"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
bordered>
|
|
bordered>
|
|
|
|
+ <!-- 货架名称 -->
|
|
|
|
+ <template slot="shelfName" slot-scope="text, record">
|
|
|
|
+ {{record.shelfName}}
|
|
|
|
+ <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.state=='WRITE_OFF'"></a-badge>
|
|
|
|
+ </template>
|
|
<!-- 货位数量 -->
|
|
<!-- 货位数量 -->
|
|
<template slot="shelfPlaceNum" slot-scope="text, record">
|
|
<template slot="shelfPlaceNum" slot-scope="text, record">
|
|
<p style="margin: 0;">
|
|
<p style="margin: 0;">
|
|
@@ -70,9 +75,23 @@
|
|
{{ record.finishFlag == 1 ? '是' : (record.finishFlag!=undefined?'否':'--') }}
|
|
{{ record.finishFlag == 1 ? '是' : (record.finishFlag!=undefined?'否':'--') }}
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
|
|
+ <!-- 启用禁用 -->
|
|
|
|
+ <template slot="enableFlag" slot-scope="text, record">
|
|
|
|
+ <a-switch
|
|
|
|
+ checkedChildren="启用"
|
|
|
|
+ unCheckedChildren="停用"
|
|
|
|
+ v-if="record.state!=undefined&&record.state!='WRITE_OFF'"
|
|
|
|
+ @change="enableShelf(record)"
|
|
|
|
+ :checked="record.state == 'ENABLE'"
|
|
|
|
+ />
|
|
|
|
+ <span v-else :style="{ color: record.state == 'ENABLE' ? '#00aa00' : '#999' }">
|
|
|
|
+ {{ record.state == 'ENABLE' ? '启用' : (record.state!=undefined&&record.state!='WRITE_OFF'?'停用':'--') }}
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">设置</a-button>
|
|
|
|
|
|
+ <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">{{record.state!='WRITE_OFF'?'设置':'查看'}}</a-button>
|
|
|
|
+ <a-button size="small" type="link" class="button-primary" v-if="record.state!='WRITE_OFF'" @click="handleCancel(record)">注销</a-button>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-spin>
|
|
</a-spin>
|
|
@@ -87,7 +106,7 @@ import { STable, VSelect } from '@/components'
|
|
import custList from '@/views/common/custList.vue'
|
|
import custList from '@/views/common/custList.vue'
|
|
import shelfSList from '@/views/common/shelfList'
|
|
import shelfSList from '@/views/common/shelfList'
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
-import { shelfList, modifFinishFlag } from '@/api/shelf'
|
|
|
|
|
|
+import { shelfList, modifFinishFlag, shelfModifState } from '@/api/shelf'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, custList, shelfSList, basicInfoModal },
|
|
components: { STable, VSelect, custList, shelfSList, basicInfoModal },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -106,10 +125,11 @@ export default {
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
- { title: '货架名称', dataIndex: 'shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
|
|
+ { title: '货架名称', scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', ellipsis: true },
|
|
{ title: '关联客户', dataIndex: 'customerEntity.customerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '关联客户', dataIndex: 'customerEntity.customerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '货位数量', scopedSlots: { customRender: 'shelfPlaceNum' }, width: '15%', align: 'center' },
|
|
{ title: '货位数量', scopedSlots: { customRender: 'shelfPlaceNum' }, width: '15%', align: 'center' },
|
|
- { title: '是否设置完成', scopedSlots: { customRender: 'finishFlag' }, width: '20%', align: 'center' },
|
|
|
|
|
|
+ { title: '是否设置完成', scopedSlots: { customRender: 'finishFlag' }, width: '10%', align: 'center' },
|
|
|
|
+ { title: '启用状态', scopedSlots: { customRender: 'enableFlag' }, width: '10%', align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -160,7 +180,7 @@ export default {
|
|
this.queryParam.customerSn = undefined
|
|
this.queryParam.customerSn = undefined
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 启用 禁用
|
|
|
|
|
|
+ // 是否设置完成
|
|
changeStatus (record) {
|
|
changeStatus (record) {
|
|
const params = {
|
|
const params = {
|
|
shelfSn: record.shelfSn,
|
|
shelfSn: record.shelfSn,
|
|
@@ -177,6 +197,44 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 启用禁用
|
|
|
|
+ enableShelf(record){
|
|
|
|
+ const params = {
|
|
|
|
+ shelfSn: record.shelfSn,
|
|
|
|
+ state: record.state == 'ENABLE' ? 'DISABLED' : 'ENABLE'
|
|
|
|
+ }
|
|
|
|
+ this.updateState(params)
|
|
|
|
+ },
|
|
|
|
+ // 注销
|
|
|
|
+ handleCancel(record){
|
|
|
|
+ const params = {
|
|
|
|
+ shelfSn: record.shelfSn,
|
|
|
|
+ state: 'WRITE_OFF'
|
|
|
|
+ }
|
|
|
|
+ const _this = this
|
|
|
|
+ _this.$confirm({
|
|
|
|
+ title: '',
|
|
|
|
+ content: <div style="text-align:center;"><div style="font-size:14px;">是否注销该数字货架,</div><div>点击确定,该数字货架就不可做任何操作,用户不可登陆</div><div style="font-size:12px;color:#999;margin-top:10px;">如需要迁移该数字货架的数据,可去货架设置中导出货架信息</div></div>,
|
|
|
|
+ centered: true,
|
|
|
|
+ closable: true,
|
|
|
|
+ class: 'confirm-center',
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.updateState(params)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ updateState(params){
|
|
|
|
+ this.spinning = true
|
|
|
|
+ shelfModifState(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ this.spinning = false
|
|
|
|
+ } else {
|
|
|
|
+ this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.queryParam.shelfSn = undefined
|
|
this.queryParam.shelfSn = undefined
|