|
@@ -5,7 +5,7 @@
|
|
<!-- 自定义的二级文字标题 -->
|
|
<!-- 自定义的二级文字标题 -->
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
<a id="shelfSet-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<a id="shelfSet-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
- <span class="store-info">{{ (basicInfoData&&basicInfoData.shelfName) || '--' }}</span>
|
|
|
|
|
|
+ <span class="store-info">货架名称:{{ basicInfoData&&basicInfoData.shelfName || '--' }}</span>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
<!-- 内容 -->
|
|
<!-- 内容 -->
|
|
@@ -14,9 +14,9 @@
|
|
<a-collapse-panel key="1">
|
|
<a-collapse-panel key="1">
|
|
<template slot="header">
|
|
<template slot="header">
|
|
<span>基础信息</span>
|
|
<span>基础信息</span>
|
|
- <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="handleInfoEdit">编辑</a-button>
|
|
|
|
|
|
+ <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
|
|
</template>
|
|
</template>
|
|
- <a-descriptions :column="3">
|
|
|
|
|
|
+ <a-descriptions :column="1">
|
|
<a-descriptions-item label="关联客户">{{ (basicInfoData&&basicInfoData.customerEntity&&basicInfoData.customerEntity.customerName) || '--' }}</a-descriptions-item>
|
|
<a-descriptions-item label="关联客户">{{ (basicInfoData&&basicInfoData.customerEntity&&basicInfoData.customerEntity.customerName) || '--' }}</a-descriptions-item>
|
|
</a-descriptions>
|
|
</a-descriptions>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
@@ -48,6 +48,8 @@
|
|
</div>
|
|
</div>
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
|
|
+ <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>
|
|
<a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
|
|
<a-tooltip placement="top">
|
|
<a-tooltip placement="top">
|
|
<template slot="title">
|
|
<template slot="title">
|
|
@@ -73,29 +75,39 @@
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-primary"
|
|
class="button-primary"
|
|
- v-if="!!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
|
|
|
|
- @click="handleProduct(record, 'edit')"
|
|
|
|
- id="shelfMonitoringList-edit-btn">修改信息</a-button>
|
|
|
|
|
|
+ v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
|
|
|
|
+ @click="handleProduct(record, 'bind')"
|
|
|
|
+ >绑定产品</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-primary"
|
|
class="button-primary"
|
|
- v-if="!!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
|
|
|
|
|
|
+ v-else
|
|
@click="handleReplace(record)"
|
|
@click="handleReplace(record)"
|
|
- id="shelfMonitoringList-replace-btn">更换产品</a-button>
|
|
|
|
|
|
+ >更换产品</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-primary"
|
|
class="button-primary"
|
|
|
|
+ @click="editHW(record)"
|
|
|
|
+ >编辑</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ class="button-error"
|
|
v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
|
|
v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
|
|
- @click="handleProduct(record, 'bind')"
|
|
|
|
- id="shelfMonitoringList-bind-btn">绑定产品</a-button>
|
|
|
|
|
|
+ @click="handleDel(record)"
|
|
|
|
+ >删除</a-button>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-card>
|
|
</a-card>
|
|
</a-spin>
|
|
</a-spin>
|
|
|
|
+ <!-- 基础设置 -->
|
|
|
|
+ <basic-info-modal :openModal="openInfoModal" :nowData="basicInfoData" @ok="handleInfoOk" @close="openInfoModal=false" />
|
|
<!-- 修改信息/绑定产品/更换产品 -->
|
|
<!-- 修改信息/绑定产品/更换产品 -->
|
|
<bind-product-modal :openModal="openModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
|
|
<bind-product-modal :openModal="openModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
|
|
|
|
+ <!-- 编辑、新增货位 -->
|
|
|
|
+ <addHwModal :openModal="openHwModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
|
|
<!-- 更换产品 -->
|
|
<!-- 更换产品 -->
|
|
<common-modal
|
|
<common-modal
|
|
:openModal="openTipsModal"
|
|
:openModal="openTipsModal"
|
|
@@ -106,8 +118,8 @@
|
|
@close="openTipsModal=false" />
|
|
@close="openTipsModal=false" />
|
|
<!-- 导入产品 -->
|
|
<!-- 导入产品 -->
|
|
<importGuideModal :openModal="openGuideModal" :params="{shelfSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
|
|
<importGuideModal :openModal="openGuideModal" :params="{shelfSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
|
|
- <!-- 基础设置 -->
|
|
|
|
- <basic-info-modal :openModal="openInfoModal" :nowData="basicInfoData" @ok="handleInfoOk" @close="openInfoModal=false" />
|
|
|
|
|
|
+ <!-- 导入货位模板 -->
|
|
|
|
+ <importHuoweiModal :openModal="openImportModal" @close="openImportModal=false" @ok="$refs.table.refresh(true)" :shelfSn="$route.params.sn"></importHuoweiModal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -115,13 +127,15 @@
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import commonModal from '@/views/common/commonModal.vue'
|
|
import commonModal from '@/views/common/commonModal.vue'
|
|
|
|
+import addHwModal from './addHwModal.vue'
|
|
import bindProductModal from './bindProductModal.vue'
|
|
import bindProductModal from './bindProductModal.vue'
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
import ImportGuideModal from './importGuideModal.vue'
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
import basicInfoModal from './basicInfoModal.vue'
|
|
-import { shelfDetail, shelfProductList, shelfProductBatchInsert } from '@/api/shelf'
|
|
|
|
|
|
+import importHuoweiModal from './importHuoweiModal.vue'
|
|
|
|
+import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn } from '@/api/shelf'
|
|
export default {
|
|
export default {
|
|
name: 'ShelfMonitoringWarehousing',
|
|
name: 'ShelfMonitoringWarehousing',
|
|
- components: { STable, VSelect, commonModal, bindProductModal, ImportGuideModal, basicInfoModal },
|
|
|
|
|
|
+ components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -167,13 +181,35 @@ export default {
|
|
nowData: null,
|
|
nowData: null,
|
|
openGuideModal: false,
|
|
openGuideModal: false,
|
|
modalType: null,
|
|
modalType: null,
|
|
- openInfoModal: false
|
|
|
|
|
|
+ openInfoModal: false,
|
|
|
|
+ openHwModal: false,
|
|
|
|
+ openImportModal: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 编辑基本信息
|
|
|
|
- handleInfoEdit () {
|
|
|
|
- this.openInfoModal = true
|
|
|
|
|
|
+ // 导入或新增货位
|
|
|
|
+ addHW (type) {
|
|
|
|
+ // 导入货位
|
|
|
|
+ if (type == 0) {
|
|
|
|
+ this.openImportModal = true
|
|
|
|
+ } else {
|
|
|
|
+ // 新增货位
|
|
|
|
+ this.nowData = this.basicInfoData
|
|
|
|
+ this.modalType = 'add'
|
|
|
|
+ this.openHwModal = true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 编辑货位
|
|
|
|
+ editHW (row) {
|
|
|
|
+ // 已绑定产品,不能编辑货位号,只能编辑已绑定产品的销售价、结算价、最大库容
|
|
|
|
+ if (row.shelfProductApiEntity && row.shelfProductApiEntity.productSn) {
|
|
|
|
+ this.handleProduct(row, 'edit')
|
|
|
|
+ } else {
|
|
|
|
+ // 货位没有绑定产品,仅编辑货位号
|
|
|
|
+ this.nowData = Object.assign(this.basicInfoData, row)
|
|
|
|
+ this.modalType = 'edit'
|
|
|
|
+ this.openHwModal = true
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 基本信息
|
|
// 基本信息
|
|
getDetail () {
|
|
getDetail () {
|
|
@@ -185,6 +221,25 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 删除货位
|
|
|
|
+ handleDel (row) {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '删除后无法恢复,确认删除?',
|
|
|
|
+ centered: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ delShelfPlaceSn({ shelfPlaceSn: row.shelfPlaceSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 更换产品
|
|
// 更换产品
|
|
handleReplace (row) {
|
|
handleReplace (row) {
|
|
if (row.shelfProductApiEntity.qty) {
|
|
if (row.shelfProductApiEntity.qty) {
|
|
@@ -204,8 +259,10 @@ export default {
|
|
this.openModal = true
|
|
this.openModal = true
|
|
},
|
|
},
|
|
handleCancel () {
|
|
handleCancel () {
|
|
|
|
+ this.modalType = null
|
|
this.nowData = null
|
|
this.nowData = null
|
|
this.openModal = false
|
|
this.openModal = false
|
|
|
|
+ this.openHwModal = false
|
|
},
|
|
},
|
|
// 导入成功
|
|
// 导入成功
|
|
handleGuideOk (obj) {
|
|
handleGuideOk (obj) {
|