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

批量设置费用有效期

祁鹏飞 пре 1 месец
родитељ
комит
9a2f5cebd6
2 измењених фајлова са 47 додато и 3 уклоњено
  1. 2 0
      src/api/modules/agreement.ts
  2. 45 3
      src/views/quoteConfig/agreement/agreementDetails.vue

+ 2 - 0
src/api/modules/agreement.ts

@@ -15,6 +15,8 @@ const agreementApi = (axiosInstance: ApiInstance) => ({
   agreementGet: (data: any) => axiosInstance.get(`agreement/agreementGet?id=${data}`),
   //协议授权保存
   authSave: (data: Types.authSaveRequest) => axiosInstance.post('agreement/authSave', data),
+  //批量修改协议费用有效期
+  agreementCostBatchUpdateValidDate: (data) => axiosInstance.post('agreement/agreementCostBatchUpdateValidDate', data),
   //根据机构获取后线人员列表
   getUserByDeptId: (deptId?: string, searchValue?: string) => axiosInstance.get(`agreement/getUserByDeptId?deptId=${deptId}&searchValue=${searchValue}`),
   //协议授权机构查询

+ 45 - 3
src/views/quoteConfig/agreement/agreementDetails.vue

@@ -150,8 +150,10 @@
                     :label="costitem.productName" :name="costitem.productName">
                     <span class="strong">{{ costitem.productName }}费用({{ costitem.ptlAgreementCostVoList.length
                       }}条)</span>
-                      <el-button type="primary" link @click="handleCopy({})"> 批量复制
-                        </el-button>
+                    <el-button type="primary" link @click="handleUpdateValidDate()"> 批量设置有效期
+                    </el-button>
+                    <el-button type="primary" link @click="handleCopy({})"> 批量复制
+                    </el-button>
                     <ComplexTable showSelect :tableData="costitem.ptlAgreementCostVoList" :columns="columns"
                       :maxHeight="250" :showIndex="false" :columnwidth="200" @selectionChange="(arr) => costIds = arr"
                       @select-all="(arr) => costIds = arr">
@@ -276,6 +278,17 @@
         <autoLoadingButton type="primary" :on-click="submitCopy">确定</autoLoadingButton>
       </template>
     </el-dialog>
+    <el-dialog :close-on-click-modal="false" v-model="copyDialog2" title="复制" width="500">
+      <el-form inline>
+        <el-form-item label="有效期">
+          <el-date-picker v-model="effectiveFailureTime" type="daterange" range-separator="至" start-placeholder="开始时间"
+            end-placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <autoLoadingButton type="primary" :on-click="submitUpdate">确定</autoLoadingButton>
+      </template>
+    </el-dialog>
   </div>
 </template>
 <!-- 行为区域 -->
@@ -928,7 +941,7 @@ const rulesList = ref([])
 const handleCopy = (row) => {
   agreementId.value = ''
   coverRuleId.value = ''
-  if(row.id) costIds.value = [row.id]
+  if (row.id) costIds.value = [row.id]
   openDialog()
 }
 
@@ -1059,6 +1072,35 @@ const uploadImage = (file: any) => {
   });
 
 }
+
+const copyDialog2 = ref(false)
+const effectiveFailureTime = ref([])
+const handleUpdateValidDate = () => {
+  if (!costIds.value.length) {
+    ElMessage.error('请选择费用')
+    return
+  }
+  effectiveFailureTime.value = []
+  copyDialog2.value = true
+}
+const submitUpdate = () => {
+  if (!effectiveFailureTime.value.length) {
+    ElMessage.error('请选择有效期')
+    return
+  }
+  const params={
+    costIds:costIds.value,
+    effectiveTime:effectiveFailureTime.value[0],
+    failureTime:effectiveFailureTime.value[1],
+  }
+  api.agreementApi.agreementCostBatchUpdateValidDate(params).then((res: any) => {
+    if (res.code == '200') {
+      ElMessage.success('修改成功')
+      copyDialog2.value = false
+      agreementRulesList()
+    }
+  });
+}
 </script>
 <!-- 样式区域 -->
 <style lang='scss' scoped>