Procházet zdrojové kódy

Merge branch 'qingban' of http://maven.jgiot.com:7012/jiaxiaoqiang/JG-CLIENT-TEMP into qingban

# Conflicts:
#	src/views/pro-operation/report-work/index.vue
lupeng před 6 dny
rodič
revize
6e4999d459
1 změnil soubory, kde provedl 23 přidání a 7 odebrání
  1. 23 7
      src/views/pro-operation/report-work/index.vue

+ 23 - 7
src/views/pro-operation/report-work/index.vue

@@ -13,7 +13,14 @@
     <template #default>
       <el-scrollbar>
         <div id="drawContent">
-          <el-form ref="formRef" :disabled="formDisabled" label-position="left" label-width="auto" size="large">
+          <el-form
+            :model="formData"
+            ref="formRef"
+            :disabled="formDisabled"
+            label-position="left"
+            label-width="auto"
+            size="large"
+          >
             <el-row :gutter="20">
               <el-col :span="10">
                 <el-select
@@ -29,8 +36,13 @@
 
             <el-row>
               <el-col :span="24">
-                <el-input v-model="operateCondition" placeholder="实时工艺条件" style="margin-bottom: 20px" type="textarea" />
-              </el-col>
+                <el-input v-model="operateCondition" placeholder="备注" style="margin-bottom: 20px" type="textarea" /><el-form-item
+                  prop="operateCondition"
+                  style="margin-bottom: 20px"
+                  :rules="[{ required: true, message: '请输入实时工艺条件', trigger: 'blur' }]"
+                >
+                  <el-input v-model="formData.operateCondition" placeholder="请输入实时工艺条件" type="textarea" />
+                </el-form-item>              </el-col>
             </el-row>
 
             <el-row v-for="(per, index) in persons" :key="per.userName" :gutter="20" style="width: 100%">
@@ -133,7 +145,9 @@ const formDisabled = ref(true);
 const signNameList = ref<any[]>([]);
 const selectedSign = ref<any[]>([]);
 
-const operateCondition = ref("");
+const formData = reactive({
+  operateCondition: "",
+});
 
 const checkAll = ref(false);
 const x = () => {};
@@ -196,7 +210,7 @@ const removeSeq = (item) => {
 const openReportWorkDrawer = () => {
   // 初始化数据
   selectedSign.value = [];
-  operateCondition.value = "";
+  formData.operateCondition = "";
   persons.value = [
     {
       userName: userStore.user.username ?? "",
@@ -234,7 +248,9 @@ const cancelClick = () => {
   drawerVisible.value = false;
 };
 
-const confirmClick = () => {
+const confirmClick = async () => {
+  let validataStatus = await formRef.value?.validate();
+  if (!validataStatus) return;
   let total = 0;
   persons.value.forEach((item) => {
     total += item.workingHoursRate ?? 0;
@@ -249,7 +265,7 @@ const confirmClick = () => {
     processUserReportList: persons.value,
     seqList: selectedProcess.value,
     signatureId: Array.isArray(selectedSign.value) && selectedSign.value.length === 0 ? null : selectedSign.value,
-    operateCondition: operateCondition.value,
+    operateCondition: formData.operateCondition,
   };
 
   reportWork(params).then((res: any) => {