Преглед изворни кода

复制协议未勾选费用二次确认窗口

@dongkboy пре 8 месеци
родитељ
комит
ecf60e2049
1 измењених фајлова са 29 додато и 16 уклоњено
  1. 29 16
      src/views/quoteConfig/agreement/agreementCopy.vue

+ 29 - 16
src/views/quoteConfig/agreement/agreementCopy.vue

@@ -23,7 +23,7 @@
           <span class="m-right-20" style="line-height: 14px;">有效状态</span>
           <span class="m-right-20" style="line-height: 14px;">有效状态</span>
           <el-dropdown trigger="click" @command="validStateCommand">
           <el-dropdown trigger="click" @command="validStateCommand">
             <el-button link style="font-size: 14px;color: #333;"> {{ valid_statusName ? valid_statusName : '全部'
             <el-button link style="font-size: 14px;color: #333;"> {{ valid_statusName ? valid_statusName : '全部'
-            }}<el-icon>
+              }}<el-icon>
                 <arrow-down />
                 <arrow-down />
               </el-icon>
               </el-icon>
             </el-button>
             </el-button>
@@ -45,7 +45,7 @@
             <template #dropdown>
             <template #dropdown>
               <el-dropdown-menu>
               <el-dropdown-menu>
                 <el-dropdown-item :command="item.label" v-for="(item, index) in is_enable" :key="index">{{ item.label
                 <el-dropdown-item :command="item.label" v-for="(item, index) in is_enable" :key="index">{{ item.label
-                }}</el-dropdown-item>
+                  }}</el-dropdown-item>
               </el-dropdown-menu>
               </el-dropdown-menu>
             </template>
             </template>
           </el-dropdown>
           </el-dropdown>
@@ -60,7 +60,7 @@
       <ElButton @click="router.back()">
       <ElButton @click="router.back()">
         取消
         取消
       </ElButton>
       </ElButton>
-      <ElButton type="primary" @click="agreementcopy" :disabled="!sysUpAndDownList.length">
+      <ElButton type="primary" @click="agreementcopy">
         复制协议
         复制协议
       </ElButton>
       </ElButton>
     </FixedActionBar>
     </FixedActionBar>
@@ -72,7 +72,7 @@
 import { ref, reactive } from 'vue'
 import { ref, reactive } from 'vue'
 import api from '@/api'
 import api from '@/api'
 import { useRoute, useRouter } from 'vue-router';
 import { useRoute, useRouter } from 'vue-router';
-import { ElMessage } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus'
 import { loadDicts, getDict } from '@/utils/composables/dictService';//字典组件
 import { loadDicts, getDict } from '@/utils/composables/dictService';//字典组件
 const route = useRoute();
 const route = useRoute();
 const router = useRouter();
 const router = useRouter();
@@ -159,9 +159,9 @@ onBeforeMount(async () => {
   if (id.value) {
   if (id.value) {
     detailsInfo();//协议信息
     detailsInfo();//协议信息
     findpage();
     findpage();
-    valid_status.value =[{label:"全部",value:""},...getDict('valid_status')]
+    valid_status.value = [{ label: "全部", value: "" }, ...getDict('valid_status')]
 
 
-    is_enable.value =[{label:"全部",value:""},...getDict('is_enable')]
+    is_enable.value = [{ label: "全部", value: "" }, ...getDict('is_enable')]
   }
   }
 })
 })
 //协议详情
 //协议详情
@@ -186,17 +186,30 @@ function findpage() {
 }
 }
 //费用复制
 //费用复制
 const agreementcopy = () => {
 const agreementcopy = () => {
-  api.agreementApi.agreementCopy({id:id.value,costIds:sysUpAndDownList.value}).then((res: any) => {
-    if (res.code == '200') {
-      ElMessage({
-        type: 'success',
-        message: res.msg,
-        plain: true,
-      })
-      router.back()
-    } else {
+  ElMessageBox.confirm(
+    '没有选中要复制的协议费用,请确认是否继续复制',
+    '提示',
+    {
+      confirmButtonText: '确定复制',
+      type: 'primary',
+      center: true,
+      confirmButtonClass: 'el-button--primary',
     }
     }
-  });
+  )
+    .then(() => {
+      api.agreementApi.agreementCopy({ id: id.value, costIds: sysUpAndDownList.value }).then((res: any) => {
+        if (res.code == '200') {
+          ElMessage({
+            type: 'success',
+            message: res.msg,
+            plain: true,
+          })
+          router.back()
+        } else {
+        }
+      });
+    })
+
 }
 }
 //多选事件
 //多选事件
 const selectionChange = (val: any) => {
 const selectionChange = (val: any) => {