|
@@ -229,6 +229,15 @@
|
|
|
{{approveStateOption.find(t => t.value === scope.row.approveState).label}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ min-width="80"
|
|
|
+ :formatter="formatReadState"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ label="读写状态">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
fixed="right"
|
|
|
header-align="center"
|
|
@@ -299,6 +308,8 @@
|
|
|
@click="resultHandle(scope.row.priceId)"
|
|
|
>报价结果</el-button
|
|
|
>
|
|
|
+ <el-button v-if="isAuth('quoted:price:read') && Number(scope.row.writeState) === 2" type="text" size="small" @click="readHandle(scope.row.priceId)">只读</el-button>
|
|
|
+ <el-button v-if="isAuth('quoted:price:write') && Number(scope.row.writeState) === 1" type="text" size="small" @click="writeHandle(scope.row.priceId)">读写</el-button>
|
|
|
<!-- <el-button-->
|
|
|
<!-- type="text"-->
|
|
|
<!-- size="small"-->
|
|
@@ -332,7 +343,7 @@
|
|
|
import OrgComponent from '../common/org-component'
|
|
|
import {getList, revoke} from '@/api/quoted'
|
|
|
import QuotedAddOrUpdate from './quoted-add-or-update'
|
|
|
-import { productTypeOption, approveStateOption, projectStateOption } from '@/utils/enums'
|
|
|
+import {productTypeOption, approveStateOption, projectStateOption, writeStateOption} from '@/utils/enums'
|
|
|
import QuotedPrice from './quoted-price'
|
|
|
import QuotedDetail from './quoted-detail'
|
|
|
import QuotedAccredit from './quoted-accredit'
|
|
@@ -353,6 +364,7 @@ export default {
|
|
|
productTypeOption: productTypeOption,
|
|
|
approveStateOption: approveStateOption,
|
|
|
projectStateOption: projectStateOption,
|
|
|
+ writeStateOption: writeStateOption,
|
|
|
dataForm: {},
|
|
|
dataList: [],
|
|
|
pageIndex: 1,
|
|
@@ -470,6 +482,68 @@ export default {
|
|
|
},
|
|
|
attachDetails (attachList) {
|
|
|
this.$refs.attachDetail.init(attachList)
|
|
|
+ },
|
|
|
+ formatReadState (row) {
|
|
|
+ if (!row.writeState) return ''
|
|
|
+ let option = this.writeStateOption.find(t => t.value === row.writeState)
|
|
|
+ if (option != null) {
|
|
|
+ return option.label
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
+ readHandle (id) {
|
|
|
+ if (!id) return
|
|
|
+ this.$confirm(`确定只读?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/quoted/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/quoted/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(() => {})
|
|
|
}
|
|
|
}
|
|
|
}
|