|
@@ -19,6 +19,9 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="图号">
|
|
|
+ <el-input v-model="dataForm.mapNumber" placeholder="图号" clearable/>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button @click="search()">查询</el-button>
|
|
|
<el-button v-if="isAuth('pro:product:save')" type="primary" @click="addOrUpdateHandle(0, false)">新建</el-button>
|
|
@@ -219,12 +222,23 @@
|
|
|
fixed="right"
|
|
|
header-align="center"
|
|
|
align="center"
|
|
|
- width="200"
|
|
|
+ min-width="80"
|
|
|
+ :formatter="formatReadState"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ label="读写状态">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="240"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button v-if="isAuth('pro:product:info')" type="text" size="small" @click="detailHandle(scope.row.productId)">查看</el-button>
|
|
|
<el-button v-if="isAuth('pro:product:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.productId, false)">编辑</el-button>
|
|
|
<el-button v-if="isAuth('pro:product:change')" type="text" size="small" @click="changeHandle(scope.row.productId)">变更</el-button>
|
|
|
+ <el-button v-if="isAuth('pro:product:read') && Number(scope.row.writeState) === 2" type="text" size="small" @click="readHandle(scope.row.productId)">只读</el-button>
|
|
|
+ <el-button v-if="isAuth('pro:product:write') && Number(scope.row.writeState) === 1" type="text" size="small" @click="writeHandle(scope.row.productId)">读写</el-button>
|
|
|
<el-button v-if="isAuth('pro:product:pause') && Number(scope.row.state) === 1" type="text" size="small" @click="pauseHandle(scope.row.productId)">暂停生产</el-button>
|
|
|
<el-button v-if="isAuth('pro:product:regain') && Number(scope.row.state) === 2" type="text" size="small" @click="regainHandle(scope.row.productId)">恢复生产</el-button>
|
|
|
</template>
|
|
@@ -262,7 +276,7 @@
|
|
|
import AttachDetail from '../common/attach-detail'
|
|
|
import NoticeChangeSetting from './product-notice-change-setting'
|
|
|
import ChangeForm from './product-change'
|
|
|
- import {bomStateOption} from '@/utils/enums'
|
|
|
+ import {bomStateOption, writeStateOption} from '@/utils/enums'
|
|
|
export default {
|
|
|
name: 'product-management',
|
|
|
components: {
|
|
@@ -292,7 +306,8 @@ export default {
|
|
|
dataListLoading: false,
|
|
|
dataListSelections: [],
|
|
|
optionsType: [],
|
|
|
- bomStateOption: bomStateOption
|
|
|
+ bomStateOption: bomStateOption,
|
|
|
+ writeStateOption: writeStateOption
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -329,10 +344,9 @@ export default {
|
|
|
this.dataListLoading = true
|
|
|
this.addOrUpdateVisible = false
|
|
|
let params = {
|
|
|
+ ...this.dataForm,
|
|
|
'current': this.pageIndex,
|
|
|
- 'size': this.pageSize,
|
|
|
- 'productName': this.dataForm.productName ? this.dataForm.productName : null,
|
|
|
- 'productType': this.dataForm.productType ? this.dataForm.productType : null
|
|
|
+ 'size': this.pageSize
|
|
|
}
|
|
|
getProductList(params).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
@@ -478,6 +492,14 @@ export default {
|
|
|
}
|
|
|
return ''
|
|
|
},
|
|
|
+ formatReadState (row) {
|
|
|
+ if (!row.writeState) return ''
|
|
|
+ let option = this.writeStateOption.find(t => t.value === row.writeState)
|
|
|
+ if (option != null) {
|
|
|
+ return option.label
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
pauseHandle (id) {
|
|
|
if (!id) return
|
|
|
this.$confirm(`确定暂停?`, '提示', {
|
|
@@ -531,6 +553,60 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}).catch(() => {})
|
|
|
+ },
|
|
|
+ readHandle (id) {
|
|
|
+ if (!id) return
|
|
|
+ this.$confirm(`确定只读?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/product/read`),
|
|
|
+ method: 'POST',
|
|
|
+ data: {id: id}
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
+ writeHandle (id) {
|
|
|
+ if (!id) return
|
|
|
+ this.$confirm(`确定读写?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/product/write`),
|
|
|
+ method: 'POST',
|
|
|
+ data: {id: id}
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
}
|
|
|
}
|
|
|
}
|