|
@@ -7,12 +7,12 @@
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="货架名称">
|
|
<a-form-item label="货架名称">
|
|
- <shelfSList v-model="queryParam.shelfSn"></shelfSList>
|
|
|
|
|
|
+ <shelfSList v-model="queryParam.shelfSn" id="shelfSetList-shelfName"></shelfSList>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="关联客户">
|
|
<a-form-item label="关联客户">
|
|
- <custList ref="custList" :dealerFlag="0" @change="custChange" :isEnabled="true"></custList>
|
|
|
|
|
|
+ <custList ref="custList" id="shelfSetList-custList" :dealerFlag="0" @change="custChange" :isEnabled="true"></custList>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
@@ -51,9 +51,9 @@
|
|
bordered>
|
|
bordered>
|
|
<!-- 货架名称 -->
|
|
<!-- 货架名称 -->
|
|
<template slot="shelfName" slot-scope="text, record">
|
|
<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>
|
|
|
|
- <a-badge count="已暂停" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.state=='SUSPEND'"></a-badge>
|
|
|
|
|
|
+ {{ record.shelfName }}
|
|
|
|
+ <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.state=='WRITE_OFF'"></a-badge>
|
|
|
|
+ <a-badge count="已暂停" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.state=='SUSPEND'"></a-badge>
|
|
</template>
|
|
</template>
|
|
<!-- 货位数量 -->
|
|
<!-- 货位数量 -->
|
|
<template slot="shelfPlaceNum" slot-scope="text, record">
|
|
<template slot="shelfPlaceNum" slot-scope="text, record">
|
|
@@ -72,6 +72,7 @@
|
|
v-if="record.finishFlag!=undefined"
|
|
v-if="record.finishFlag!=undefined"
|
|
@change="changeStatus(record)"
|
|
@change="changeStatus(record)"
|
|
:checked="record.finishFlag == 1"
|
|
:checked="record.finishFlag == 1"
|
|
|
|
+ id="shelfSetList-finishFlag"
|
|
/>
|
|
/>
|
|
<span v-else :style="{ color: record.finishFlag == 1 ? '#00aa00' : '#999' }">
|
|
<span v-else :style="{ color: record.finishFlag == 1 ? '#00aa00' : '#999' }">
|
|
{{ record.finishFlag == 1 ? '是' : (record.finishFlag!=undefined?'否':'--') }}
|
|
{{ record.finishFlag == 1 ? '是' : (record.finishFlag!=undefined?'否':'--') }}
|
|
@@ -86,6 +87,7 @@
|
|
v-if="record.state!=undefined"
|
|
v-if="record.state!=undefined"
|
|
@change="enableShelf(record)"
|
|
@change="enableShelf(record)"
|
|
:checked="record.state == 'ENABLE'"
|
|
:checked="record.state == 'ENABLE'"
|
|
|
|
+ id="shelfSetList-state"
|
|
/>
|
|
/>
|
|
<span v-else :style="{ color: record.state == 'ENABLE' ? '#00aa00' : '#999' }">
|
|
<span v-else :style="{ color: record.state == 'ENABLE' ? '#00aa00' : '#999' }">
|
|
{{ record.state == 'ENABLE' ? '启用' : (record.state!=undefined&&record.state!='WRITE_OFF'&&record.state!='SUSPEND'?'停用':'--') }}
|
|
{{ record.state == 'ENABLE' ? '启用' : (record.state!=undefined&&record.state!='WRITE_OFF'&&record.state!='SUSPEND'?'停用':'--') }}
|
|
@@ -94,14 +96,20 @@
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
<div>
|
|
<div>
|
|
- <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">{{record.state!='WRITE_OFF'&&record.state!='SUSPEND'?'货架设置':'查看'}}</a-button>
|
|
|
|
- <a-button size="small" type="link" class="button-primary" v-if="record.state!='WRITE_OFF'&&record.state!='SUSPEND'" @click="handleCancel(record)">注销</a-button>
|
|
|
|
|
|
+ <a-button id="shelfSetList-setView" size="small" type="link" class="button-primary" @click="handleSet(record)">{{ record.state!='WRITE_OFF'&&record.state!='SUSPEND'?'货架设置':'查看' }}</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ id="shelfSetList-cancel"
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-primary"
|
|
|
|
+ v-if="record.state!='WRITE_OFF'&&record.state!='SUSPEND'"
|
|
|
|
+ @click="handleCancel(record)">注销</a-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-spin>
|
|
</a-spin>
|
|
<!-- 基础设置 -->
|
|
<!-- 基础设置 -->
|
|
- <basic-info-modal :type="0" :openModal="openModal" :nowData="nowData" @ok="handleOk" @close="openModal=false" />
|
|
|
|
|
|
+ <basic-info-modal :type="0" :openModal="openModal" :nowData="nowData" @ok="handleOkToSet" @close="openModal=false" />
|
|
<a-modal
|
|
<a-modal
|
|
centered
|
|
centered
|
|
class="common-modal"
|
|
class="common-modal"
|
|
@@ -117,8 +125,8 @@
|
|
<div style="font-size:12px;color:#999;margin-top:10px;">如需要迁移该数字货架的数据,可去货架设置中导出货架信息</div>
|
|
<div style="font-size:12px;color:#999;margin-top:10px;">如需要迁移该数字货架的数据,可去货架设置中导出货架信息</div>
|
|
</div>
|
|
</div>
|
|
<div class="btn-box" style="display: flex;align-items: center;justify-content: center;margin-top:25px;">
|
|
<div class="btn-box" style="display: flex;align-items: center;justify-content: center;margin-top:25px;">
|
|
- <a-button type="primary" @click="handleCommonOk">确定</a-button>
|
|
|
|
- <a-button type="default" class="button-warning" @click="showTip=false">取消</a-button>
|
|
|
|
|
|
+ <a-button id="shelfSetList-handle-ok" type="primary" @click="handleCommonOk">确定</a-button>
|
|
|
|
+ <a-button id="shelfSetList-handle-cancel" type="default" class="button-warning" @click="showTip=false">取消</a-button>
|
|
</div>
|
|
</div>
|
|
</a-modal>
|
|
</a-modal>
|
|
</a-card>
|
|
</a-card>
|
|
@@ -127,28 +135,29 @@
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import custList from '@/views/common/custList.vue'
|
|
|
|
-import shelfSList from '@/views/common/shelfList'
|
|
|
|
-import basicInfoModal from './basicInfoModal.vue'
|
|
|
|
-import commonModal from '@/views/common/commonModal.vue'
|
|
|
|
-import { shelfList, modifFinishFlag, shelfModifState } from '@/api/shelf'
|
|
|
|
|
|
+import custList from '@/views/common/custList.vue' // 客户列表组件
|
|
|
|
+import shelfSList from '@/views/common/shelfList' // 货架列表组件
|
|
|
|
+import basicInfoModal from './basicInfoModal.vue' // 基本信息弹框
|
|
|
|
+import commonModal from '@/views/common/commonModal.vue' // 公共弹框
|
|
|
|
+import { shelfList, modifFinishFlag, shelfModifState } from '@/api/shelf' // 接口api
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, custList, shelfSList, basicInfoModal, commonModal },
|
|
components: { STable, VSelect, custList, shelfSList, basicInfoModal, commonModal },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- spinning: false,
|
|
|
|
- tableHeight: 0,
|
|
|
|
|
|
+ spinning: false, // loading
|
|
|
|
+ tableHeight: 0, // 表格高度
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
- showTip: false,
|
|
|
|
|
|
+ showTip: false, // 注销弹框
|
|
queryParam: {
|
|
queryParam: {
|
|
- shelfSn: undefined,
|
|
|
|
- customerSn: undefined,
|
|
|
|
- finishFlag: undefined,
|
|
|
|
- customerEntity: {
|
|
|
|
|
|
+ shelfSn: undefined, // 货架sn
|
|
|
|
+ customerSn: undefined, // 关联客户sn
|
|
|
|
+ finishFlag: undefined, // 是否完成设置
|
|
|
|
+ customerEntity: { // 关联客户名称
|
|
customerName: undefined
|
|
customerName: undefined
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 列定义
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
{ title: '货架名称', scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', ellipsis: true },
|
|
{ title: '货架名称', scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', ellipsis: true },
|
|
@@ -176,16 +185,18 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- openModal: false,
|
|
|
|
- nowData: null
|
|
|
|
|
|
+ openModal: false, // 新增编辑弹框
|
|
|
|
+ nowData: null // 当前操作行数据
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 设置/修改
|
|
// 设置/修改
|
|
handleSet (row) {
|
|
handleSet (row) {
|
|
|
|
+ // 如果有关联客户跳转到设置页面
|
|
if (row.customerSn) {
|
|
if (row.customerSn) {
|
|
- this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/${row.shelfSn}` })
|
|
|
|
|
|
+ this.handleOkToSet(row)
|
|
} else {
|
|
} else {
|
|
|
|
+ // 否则打开编辑弹框
|
|
this.nowData = {
|
|
this.nowData = {
|
|
shelfSn: row.shelfSn,
|
|
shelfSn: row.shelfSn,
|
|
shelfName: row.shelfName
|
|
shelfName: row.shelfName
|
|
@@ -193,10 +204,11 @@ export default {
|
|
this.openModal = true
|
|
this.openModal = true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- handleOk (data) {
|
|
|
|
|
|
+ // 跳转到货架设置页面
|
|
|
|
+ handleOkToSet (data) {
|
|
this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/${data.shelfSn}` })
|
|
this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/${data.shelfSn}` })
|
|
},
|
|
},
|
|
- // 客户 change
|
|
|
|
|
|
+ // 选择关联客户
|
|
custChange (obj, row) {
|
|
custChange (obj, row) {
|
|
if (row) {
|
|
if (row) {
|
|
this.queryParam.customerSn = row && row.customerSn || undefined
|
|
this.queryParam.customerSn = row && row.customerSn || undefined
|
|
@@ -206,7 +218,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,
|
|
@@ -224,7 +236,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 启用禁用
|
|
// 启用禁用
|
|
- enableShelf(record){
|
|
|
|
|
|
+ enableShelf (record) {
|
|
const params = {
|
|
const params = {
|
|
shelfSn: record.shelfSn,
|
|
shelfSn: record.shelfSn,
|
|
state: record.state == 'ENABLE' ? 'DISABLED' : 'ENABLE'
|
|
state: record.state == 'ENABLE' ? 'DISABLED' : 'ENABLE'
|
|
@@ -232,27 +244,29 @@ export default {
|
|
const _this = this
|
|
const _this = this
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: <div style="text-align:center;">是否{(record.state == 'ENABLE'?'停用':'启用')+record.shelfName}</div>,
|
|
|
|
|
|
+ content: <div style="text-align:center;">是否{(record.state == 'ENABLE' ? '停用' : '启用') + record.shelfName}</div>,
|
|
centered: true,
|
|
centered: true,
|
|
closable: true,
|
|
closable: true,
|
|
class: 'confirm-center',
|
|
class: 'confirm-center',
|
|
onOk () {
|
|
onOk () {
|
|
- _this.updateState(params)
|
|
|
|
|
|
+ _this.updateState(params)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 注销
|
|
|
|
- handleCancel(record){
|
|
|
|
|
|
+ // 打开注销弹框
|
|
|
|
+ handleCancel (record) {
|
|
this.nowData = {
|
|
this.nowData = {
|
|
shelfSn: record.shelfSn,
|
|
shelfSn: record.shelfSn,
|
|
state: 'WRITE_OFF'
|
|
state: 'WRITE_OFF'
|
|
}
|
|
}
|
|
this.showTip = true
|
|
this.showTip = true
|
|
},
|
|
},
|
|
- handleCommonOk(){
|
|
|
|
|
|
+ // 确定注销
|
|
|
|
+ handleCommonOk () {
|
|
this.updateState(this.nowData)
|
|
this.updateState(this.nowData)
|
|
},
|
|
},
|
|
- updateState(params){
|
|
|
|
|
|
+ // 更改货架状态
|
|
|
|
+ updateState (params) {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
shelfModifState(params).then(res => {
|
|
shelfModifState(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -265,7 +279,7 @@ export default {
|
|
this.showTip = false
|
|
this.showTip = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 重置
|
|
|
|
|
|
+ // 重置列表查询
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.queryParam.shelfSn = undefined
|
|
this.queryParam.shelfSn = undefined
|
|
this.queryParam.customerSn = undefined
|
|
this.queryParam.customerSn = undefined
|
|
@@ -274,10 +288,12 @@ export default {
|
|
this.queryParam.finishFlag = undefined
|
|
this.queryParam.finishFlag = undefined
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
|
|
+ // 计算表格高度
|
|
setTableH () {
|
|
setTableH () {
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
},
|
|
},
|
|
|
|
+ // 初始化页面
|
|
pageInit () {
|
|
pageInit () {
|
|
const _this = this
|
|
const _this = this
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|