chris 1 年之前
父節點
當前提交
0a45752deb
共有 2 個文件被更改,包括 79 次插入5 次删除
  1. 4 4
      src/views/common/login.vue
  2. 75 1
      src/views/modules/cus/quoted.vue

+ 4 - 4
src/views/common/login.vue

@@ -33,10 +33,10 @@
           </div>
         </div>
       </div>
-      <div class="site-wrapper site-sidebar--fold"
-        v-loading.fullscreen.lock="loading"
-        element-loading-text="加载中">
-      </div>
+<!--      <div class="site-wrapper site-sidebar&#45;&#45;fold"-->
+<!--        v-loading.fullscreen.lock="loading"-->
+<!--        element-loading-text="加载中">-->
+<!--      </div>-->
     </div>
 </template>
 

+ 75 - 1
src/views/modules/cus/quoted.vue

@@ -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(() => {})
     }
   }
 }