Jelajahi Sumber

fix: 商用登录新增前检查

Howie 1 tahun lalu
induk
melakukan
1a81a11c8f

+ 9 - 0
src/api/frock.js

@@ -134,3 +134,12 @@ export function getHistory(params) {
     params
   })
 }
+
+// 商用工程登录单-检查登录额
+export function checkTradeLoginLimit(params) {
+  return request({
+    url: `/trade/login/order/check/limit`,
+    method: 'post',
+    data: params
+  })
+}

+ 59 - 49
src/views/commercialEngineering/crossDistrict/crossDistrictkList.vue

@@ -10,7 +10,7 @@
     :options-evens-group="optionsEvensGroup"
     :table-attributes="tableAttributes"
     :table-events="tableEvents"
-    :replaceOrNotMap ="false"
+    :replaceOrNotMap="false"
     :ellipsis="false"
 
   >
@@ -25,7 +25,9 @@
       <Detail v-if="['detail'].includes(module)" :detail-id="detailId" :module="module" @updateList="handleClose" />
       <Examine v-if="['examine'].includes(module)" :detail-id="detailId" :module="module" @updateList="handleClose" />
     </Popu>
-    <Operate v-if="operateVisible" :operate-visible="operateVisible" :operate-type="operateType" :operate-title="operateTitle" :detail-id="detailId" :record-selected="recordSelected" @close="handleClose" />
+    <Operate v-if="operateVisible" :operate-visible="operateVisible" :operate-type="operateType"
+             :operate-title="operateTitle" :detail-id="detailId" :record-selected="recordSelected" @close="handleClose"
+    />
 
   </template-page>
 </template>
@@ -36,15 +38,17 @@ import import_mixin from '@/components/template/import_mixin.js'
 import add_callback_mixin from '@/components/template/add_callback_mixin.js'
 import Popu from '@/components/template/popu.vue'
 import CrossDistrictForm from './crossDistrictForm.vue'
+import list_mixin from '../mixin/list'
 import Detail from './detail.vue'
 import Examine from './examine.vue'
 import Operate from '../components/operate.vue'
 import { mapGetters } from 'vuex'
 
 import { getLoginCrossDistrictList, exportLoginCrossDistrict } from '@/api/crossDistrict'
+
 export default {
   components: { TemplatePage, Popu, CrossDistrictForm, Detail, Examine, Operate },
-  mixins: [import_mixin, add_callback_mixin],
+  mixins: [import_mixin, add_callback_mixin, list_mixin],
   data() {
     return {
       visible: false,
@@ -77,9 +81,13 @@ export default {
           [
             {
               name: '添加记录',
-              click: this.addOn(() => {
-                this.visible = true
-              })
+              click: () => {
+                this.checkTradeLogin(() => {
+                  this.addOn(() => {
+                    this.visible = true
+                  })()
+                }, { isSpan: true})
+              }
             }
           ]
         ],
@@ -133,36 +141,36 @@ export default {
             ]
             : []
         })(),
-              [
-                [
-                  {
-                    name: '删除',
-                    click: () => {
-                      if (this.recordSelected.length === 0) {
-                        this.$message.error('请选择需要删除的数据')
-                        return
-                      }
-                      if(!this.isTradeExaminer){
-                        for (let index = 0; index < this.recordSelected.length; index++) {
-                        if (this.recordSelected[index].orderStatus !== 'SAVE') {
-                          this.$message.error('请选择保存的数据')
-                          return
-                        }
-                      }
-                      }
-                      // for (let index = 0; index < this.recordSelected.length; index++) {
-                      //   if (this.recordSelected[index].orderStatus !== '已审核') {
-                      //     this.$message.error('请选择审核通过的数据')
-                      //     return
-                      //   }
-                      // }
-                      this.operateType = 'delete'
-                      this.operateTitle = '删除'
-                      this.operateVisible = true
+        [
+          [
+            {
+              name: '删除',
+              click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                if (!this.isTradeExaminer) {
+                  for (let index = 0; index < this.recordSelected.length; index++) {
+                    if (this.recordSelected[index].orderStatus !== 'SAVE') {
+                      this.$message.error('请选择保存的数据')
+                      return
                     }
                   }
-                ]
-              ]
+                }
+                // for (let index = 0; index < this.recordSelected.length; index++) {
+                //   if (this.recordSelected[index].orderStatus !== '已审核') {
+                //     this.$message.error('请选择审核通过的数据')
+                //     return
+                //   }
+                // }
+                this.operateType = 'delete'
+                this.operateTitle = '删除'
+                this.operateVisible = true
+              }
+            }
+          ]
+        ]
       ]
     }
   },
@@ -181,7 +189,8 @@ export default {
     columnParsing(item, defaultData) {
       if (item.colName === 'project_no') {
         defaultData.render = (h, { row, index, column }) => {
-          return ( <div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
+          return (
+            <div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
               <el-link
                 type="primary"
                 underline={false}
@@ -216,11 +225,11 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class='operation-btns'>
-               {!this.isTradeExaminer && ((row.orderStatus === 'OK') && row.status === 'ING' && !row.isApplyUpdate) ? (
+          <div class="operation-btns">
+            {!this.isTradeExaminer && ((row.orderStatus === 'OK') && row.status === 'ING' && !row.isApplyUpdate) ? (
               <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.detailId = row.id
                   this.operateType = 'apply'
@@ -233,8 +242,8 @@ export default {
             ) : null}
             {this.isTradeExaminer && row.orderStatus !== 'SAVE' ? (
               <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.content = '审核'
                   this.module = 'examine'
@@ -262,8 +271,8 @@ export default {
             row.orderStatus === 'SAVE' ||
             row.orderStatus === 'RETURN'
               ? <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.content = '编辑'
                   this.module = 'edit'
@@ -271,24 +280,25 @@ export default {
                   this.visible = true
                 }}
               >
-              编辑
+                编辑
               </el-button> : null
             }
             {row.orderStatus === 'OK' && row.status === 'ING'
-              ? <el-button size='mini' type='text' onClick={() => {
+              ? <el-button size="mini" type="text" onClick={() => {
                 this.operateType = 'update'
                 this.operateTitle = '更新'
                 this.recordSelected = [row]
                 this.operateVisible = true
-              }}>
-              更新
+              }}
+              >
+                更新
               </el-button> : null
             }
 
             {this.isTradeExaminer && ((row.orderStatus === 'OK' || row.orderStatus === 'FAIL') && row.isApplyUpdate) ? (
               <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.detailId = row.id
                   this.operateType = 'examine'

+ 50 - 43
src/views/commercialEngineering/frock/frockList.vue

@@ -45,11 +45,14 @@ import FrockForm from './frockForm.vue'
 import Detail from './detail.vue'
 import Examine from './examine.vue'
 import Operate from '../components/operate.vue'
+import list_mixin from '../mixin/list'
+
 import { getLoginFrockList, exportLoginFrock } from '@/api/frock'
 import { mapGetters } from 'vuex'
+
 export default {
   components: { TemplatePage, Popu, FrockForm, Detail, Examine, Operate },
-  mixins: [import_mixin, add_callback_mixin],
+  mixins: [import_mixin, add_callback_mixin, list_mixin],
   data() {
     return {
       visible: false,
@@ -81,9 +84,13 @@ export default {
           [
             {
               name: '添加记录',
-              click: this.addOn(() => {
-                this.visible = true
-              })
+              click: () => {
+                this.checkTradeLogin(() => {
+                  this.addOn(() => {
+                    this.visible = true
+                  })()
+                }, { isSpan: false, orderType: 'WORK' })
+              }
             }
           ]
         ],
@@ -91,57 +98,57 @@ export default {
           console.log(this.isTradeExaminer, 9999)
           return this.isTradeExaminer
             ? [
+              [
                 [
-                  [
-                    {
-                      name: '更新',
-                      click: () => {
-                        if (this.recordSelected.length === 0) {
-                          this.$message.error('请选择需要更新的数据')
-                          return
-                        }
+                  {
+                    name: '更新',
+                    click: () => {
+                      if (this.recordSelected.length === 0) {
+                        this.$message.error('请选择需要更新的数据')
+                        return
+                      }
 
-                        for (let index = 0; index < this.recordSelected.length; index++) {
-                          if (
-                            !(
-                              this.recordSelected[index].orderStatus == 'OK' &&
-                              this.recordSelected[index].status == 'ING'
-                            )
-                          ) {
-                            this.$message.error('请选择审核通过并且跟进中的数据')
-                            return
-                          }
+                      for (let index = 0; index < this.recordSelected.length; index++) {
+                        if (
+                          !(
+                            this.recordSelected[index].orderStatus == 'OK' &&
+                            this.recordSelected[index].status == 'ING'
+                          )
+                        ) {
+                          this.$message.error('请选择审核通过并且跟进中的数据')
+                          return
                         }
-                        this.operateType = 'update'
-                        this.operateTitle = '更新'
-                        this.operateVisible = true
                       }
+                      this.operateType = 'update'
+                      this.operateTitle = '更新'
+                      this.operateVisible = true
                     }
-                  ]
-                ],
+                  }
+                ]
+              ],
+              [
                 [
-                  [
-                    {
-                      name: '替换业务员',
-                      click: () => {
-                        if (this.recordSelected.length === 0) {
-                          this.$message.error('请选择需要替换业务员的数据')
+                  {
+                    name: '替换业务员',
+                    click: () => {
+                      if (this.recordSelected.length === 0) {
+                        this.$message.error('请选择需要替换业务员的数据')
+                        return
+                      }
+                      for (let index = 0; index < this.recordSelected.length; index++) {
+                        if (this.recordSelected[index].orderStatus !== 'OK') {
+                          this.$message.error('请选择审核通过的数据')
                           return
                         }
-                        for (let index = 0; index < this.recordSelected.length; index++) {
-                          if (this.recordSelected[index].orderStatus !== 'OK') {
-                            this.$message.error('请选择审核通过的数据')
-                            return
-                          }
-                        }
-                        this.operateType = 'replace'
-                        this.operateTitle = '替换业务员'
-                        this.operateVisible = true
                       }
+                      this.operateType = 'replace'
+                      this.operateTitle = '替换业务员'
+                      this.operateVisible = true
                     }
-                  ]
+                  }
                 ]
               ]
+            ]
             : []
         })(),
         [

+ 54 - 47
src/views/commercialEngineering/homeDecoration/homeDecorationList.vue

@@ -45,12 +45,13 @@ import HomeDecorationForm from './homeDecorationForm.vue'
 import Detail from './detail.vue'
 import Examine from './examine.vue'
 import Operate from '../components/operate.vue'
+import list_mixin from '../mixin/list'
 import { getLoginHomeDecorationList, exportLoginHomeDecoration } from '@/api/homeDecoration'
 import { mapGetters } from 'vuex'
 
 export default {
   components: { TemplatePage, Popu, HomeDecorationForm, Detail, Examine, Operate },
-  mixins: [import_mixin, add_callback_mixin],
+  mixins: [import_mixin, add_callback_mixin, list_mixin],
   data() {
     return {
       visible: false,
@@ -83,9 +84,13 @@ export default {
           [
             {
               name: '添加记录',
-              click: this.addOn(() => {
-                this.visible = true
-              })
+              click: () => {
+                this.checkTradeLogin(() => {
+                  this.addOn(() => {
+                    this.visible = true
+                  })()
+                }, { isSpan: false, orderType: 'HOME' })
+              }
             }
           ]
         ],
@@ -139,36 +144,36 @@ export default {
             ]
             : []
         })(),
-              [
-                [
-                  {
-                    name: '删除',
-                    click: () => {
-                      if (this.recordSelected.length === 0) {
-                        this.$message.error('请选择需要删除的数据')
-                        return
-                      }
-                      if(!this.isTradeExaminer){
-                        for (let index = 0; index < this.recordSelected.length; index++) {
-                        if (this.recordSelected[index].orderStatus !== 'SAVE') {
-                          this.$message.error('请选择保存的数据')
-                          return
-                        }
-                      }
-                      }
-                      // for (let index = 0; index < this.recordSelected.length; index++) {
-                      //   if (this.recordSelected[index].orderStatus !== '已审核') {
-                      //     this.$message.error('请选择审核通过的数据')
-                      //     return
-                      //   }
-                      // }
-                      this.operateType = 'delete'
-                      this.operateTitle = '删除'
-                      this.operateVisible = true
+        [
+          [
+            {
+              name: '删除',
+              click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                if (!this.isTradeExaminer) {
+                  for (let index = 0; index < this.recordSelected.length; index++) {
+                    if (this.recordSelected[index].orderStatus !== 'SAVE') {
+                      this.$message.error('请选择保存的数据')
+                      return
                     }
                   }
-                ]
-              ]
+                }
+                // for (let index = 0; index < this.recordSelected.length; index++) {
+                //   if (this.recordSelected[index].orderStatus !== '已审核') {
+                //     this.$message.error('请选择审核通过的数据')
+                //     return
+                //   }
+                // }
+                this.operateType = 'delete'
+                this.operateTitle = '删除'
+                this.operateVisible = true
+              }
+            }
+          ]
+        ]
       ]
     }
   },
@@ -187,7 +192,8 @@ export default {
     columnParsing(item, defaultData) {
       if (item.colName === 'project_no') {
         defaultData.render = (h, { row, index, column }) => {
-          return ( <div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
+          return (
+            <div style="padding:0 6px;cursor: pointer;" class={{ 'text-view': true, 'text-view-copy': column.isCopy }}>
               <el-link
                 type="primary"
                 underline={false}
@@ -222,11 +228,11 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class='operation-btns'>
-               {!this.isTradeExaminer && ((row.orderStatus === 'OK') && row.status === 'ING' && !row.isApplyUpdate) ? (
+          <div class="operation-btns">
+            {!this.isTradeExaminer && ((row.orderStatus === 'OK') && row.status === 'ING' && !row.isApplyUpdate) ? (
               <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.detailId = row.id
                   this.operateType = 'apply'
@@ -239,8 +245,8 @@ export default {
             ) : null}
             {this.isTradeExaminer && row.orderStatus !== 'SAVE' ? (
               <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.content = '审核'
                   this.module = 'examine'
@@ -268,8 +274,8 @@ export default {
             row.orderStatus === 'SAVE' ||
             row.orderStatus === 'RETURN'
               ? <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.content = '编辑'
                   this.module = 'edit'
@@ -277,24 +283,25 @@ export default {
                   this.visible = true
                 }}
               >
-              编辑
+                编辑
               </el-button> : null
             }
             {row.orderStatus === 'OK' && row.status === 'ING'
-              ? <el-button size='mini' type='text' onClick={() => {
+              ? <el-button size="mini" type="text" onClick={() => {
                 this.operateType = 'update'
                 this.operateTitle = '更新'
                 this.recordSelected = [row]
                 this.operateVisible = true
-              }}>
-              更新
+              }}
+              >
+                更新
               </el-button> : null
             }
 
             {this.isTradeExaminer && ((row.orderStatus === 'OK' || row.orderStatus === 'FAIL') && row.isApplyUpdate) ? (
               <el-button
-                size='mini'
-                type='text'
+                size="mini"
+                type="text"
                 onClick={() => {
                   this.detailId = row.id
                   this.operateType = 'examine'

+ 12 - 0
src/views/commercialEngineering/mixin/list.js

@@ -0,0 +1,12 @@
+import { checkTradeLoginLimit } from '@/api/frock'
+
+export default {
+
+  methods: {
+    checkTradeLogin(cd, params) {
+      checkTradeLoginLimit(params).then(res => {
+        cd()
+      })
+    }
+  }
+}