Explorar el Código

2024-09-28页面

dtql hace 1 mes
padre
commit
f09c76cd15

+ 23 - 7
src/views/DocView.vue

@@ -3,23 +3,23 @@
     <el-button type="primary" @click="visible1 = true" style="margin-left: 20px">添加专家</el-button>
     <el-dialog v-model="visible1" title="添加专家信息" width="800px" class="form">
       <el-form  rules="rules" label-position="right" label-width="100px" size="small" style="font-weight: bold ; margin-top: 20px">
-        <el-form-item label="专家名称" prop="name" required>
-          <el-input  placeholder="请输入姓名" ></el-input>
+        <el-form-item label="专家名称" prop="name" required >
+          <el-input  placeholder="请输入姓名" v-model="name"></el-input>
         </el-form-item>
         <el-form-item label="专家类别" required prop="type">
-          <el-select  placeholder="请选择类别">
+          <el-select  placeholder="请选择类别" v-model="part">
             <el-option>A专家</el-option>
             <el-option>B助手</el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="身份证号" prop="ID" required>
-          <el-input  placeholder="请输入身份证号" ></el-input>
+          <el-input  placeholder="请输入身份证号" v-model="id"></el-input>
         </el-form-item>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="visible1 = false">确定</el-button>
-          <el-button  @click="visible1 = false">
+          <el-button type="primary" @click="confirm">确定</el-button>
+          <el-button  @click="cencle">
             取消
           </el-button>
         </div>
@@ -82,6 +82,9 @@ const experts = [
   }
 ]
 
+const name = ref('')
+const id = ref('')
+const part = ref('')
 const visible1 = ref(false)
 const visible2 = ref(false)
 const number = ref(null)
@@ -100,9 +103,22 @@ const tableHeader = computed(() => {
 });
 
 
+function confirm(){
+  name.value = '';
+  id.value = '';
+  part.value = '';
+  visible1.value = false
+}
+
+function cencle(){
+  name.value = '';
+  id.value = '';
+  part.value = '';
+  visible1.value = false
+}
 
 </script>
 
 <style scoped>
 
-</style>
+</style>

+ 63 - 14
src/views/GrainView.vue

@@ -6,16 +6,20 @@ const dialogFormVisible = ref(false)
 const formLabelWidth = '140px'
 
 const form = reactive({
-  name: '',
-  region: '',
-  date1: '',
-  date2: '',
-  delivery: false,
-  type: [],
-  resource: '',
-  desc: '',
-  phone:''
-})
+  phone: '',
+  name:''
+});
+
+
+const rules = {
+  phone: [
+    { required: true, message: '请输入联系电话', trigger: 'blur' },
+    { min: 11, max: 11, message: '联系电话必须是11位数字', trigger: 'blur' },
+    { pattern: /^\d{11}$/, message: '联系电话必须是11位数字', trigger: 'blur' }
+  ],
+};
+
+const formRef = ref(null);
 
 
 const tableData = [
@@ -42,6 +46,51 @@ const tableData = [
   },
 ]
 
+
+
+function confirm(){formRef.value.validate((valid) => {
+  form.name='';
+  form.name='';
+  form.region='';
+  form.date1='';
+  form.date2='';
+  form.delivery= false;
+  form.type= [];
+  form.resource= '';
+  form.desc= '';
+  form.time=0;
+  form.times=0;
+  form.intervalTime=0;
+  form.required='';
+  form.phone='';
+  if (valid) {
+    dialogFormVisible.value = false;
+    alert('提交成功!');
+  } else {
+    dialogFormVisible.value = true;
+    alert('提交失败!');
+    return false;
+  }
+});
+}
+
+function cencle(){
+  form.name='';
+  form.name= '';
+  form.region= '';
+  form.date1= '';
+  form.date2= '';
+  form.delivery= false;
+  form.type= [];
+  form.resource= '';
+  form.desc= '';
+  form.time=0;
+  form.times=0;
+  form.intervalTime=0;
+  form.required='';
+  form.phone='';
+  dialogFormVisible.value = false
+}
 </script>
 <template>
   <div style="padding-left: 20px" >
@@ -58,20 +107,20 @@ const tableData = [
     </el-button>
 
     <el-dialog v-model="dialogFormVisible" title="添加供应商" width="500">
-      <el-form :model="form">
+      <el-form :model="form" :rules="rules" ref="formRef" label-width="120px">
         <el-form-item label="部门名称" :label-width="formLabelWidth" required="required" prop="name">
           <el-input v-model="form.name" autocomplete="off" />
         </el-form-item>
-        <el-form-item label="联系电话" :label-width="formLabelWidth" required="required" prop="number">
+        <el-form-item label="联系电话" :label-width="formLabelWidth" required="required" prop="phone">
           <el-input v-model="form.phone" autocomplete="off" />
         </el-form-item>
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="dialogFormVisible = false">
+          <el-button type="primary" @click="confirm">
             确定
           </el-button>
-          <el-button @click="dialogFormVisible = false">取消</el-button>
+          <el-button @click="cencle">取消</el-button>
         </div>
       </template>
     </el-dialog>

+ 49 - 2
src/views/MsgView.vue

@@ -124,8 +124,8 @@
 
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="dialogFormVisible = false">确定</el-button>
-          <el-button  @click="dialogFormVisible = false">
+          <el-button type="primary" @click="confirm">确定</el-button>
+          <el-button  @click="cencle">
             取消
           </el-button>
         </div>
@@ -256,6 +256,53 @@ function toBiddingView(){
 }
 
 
+function confirm(){
+ value1.value = '';
+  value2.value = '';
+  value3.value = '';
+  value4.value = '';
+  value5.value = '';
+  value6.value = '';
+  value7.value = '';
+  value8.value = '';
+  value9.value = '';
+  value10.value = '';
+  value11.value = '';
+  value12.value = '';
+  value13.value = '';
+  value14.value = '';
+  value15.value = '';
+  value16.value = '';
+  value17.value = '';
+  value18.value = '';
+  value19.value = '';
+  value20.value = '';
+  dialogFormVisible.value = false
+}
+
+function cencle(){
+  value1.value = '';
+  value2.value = '';
+  value3.value = '';
+  value4.value = '';
+  value5.value = '';
+  value6.value = '';
+  value7.value = '';
+  value8.value = '';
+  value9.value = '';
+  value10.value = '';
+  value11.value = '';
+  value12.value = '';
+  value13.value = '';
+  value14.value = '';
+  value15.value = '';
+  value16.value = '';
+  value17.value = '';
+  value18.value = '';
+  value19.value = '';
+  value20.value = '';
+  dialogFormVisible.value = false
+}
 
 </script>
 

+ 40 - 3
src/views/RulesView.vue

@@ -17,7 +17,7 @@ const form = reactive({
   time:0,
   times:0,
   intervalTime:0,
-
+  required:'',
 })
 
 
@@ -48,6 +48,43 @@ const tableData = [
   },
 ]
 
+
+
+function confirm(){
+  form.name='';
+  form.name='';
+  form.region='';
+  form.date1='';
+  form.date2='';
+  form.delivery= false;
+  form.type= [];
+  form.resource= '';
+  form.desc= '';
+  form.time=0;
+  form.times=0;
+  form.intervalTime=0;
+  form.required='';
+  dialogFormVisible.value = false
+}
+
+function cencle(){
+  form.name='';
+  form.name= '';
+  form.region= '';
+  form.date1= '';
+  form.date2= '';
+  form.delivery= false;
+  form.type= [];
+  form.resource= '';
+  form.desc= '';
+  form.time=0;
+  form.times=0;
+  form.intervalTime=0;
+  form.required='';
+  dialogFormVisible.value = false
+}
+
+
 </script>
 <template>
   <div style="padding-left: 20px">
@@ -93,10 +130,10 @@ const tableData = [
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="dialogFormVisible = false">
+          <el-button type="primary" @click="confirm">
             确定
           </el-button>
-          <el-button @click="dialogFormVisible = false">取消</el-button>
+          <el-button @click="cencle">取消</el-button>
         </div>
       </template>
     </el-dialog>

+ 51 - 18
src/views/SupplierView.vue

@@ -21,44 +21,77 @@ const rules = {
 
 const formRef = ref(null);
 
-function submitForm() {
-  formRef.value.validate((valid) => {
-    if (valid) {
-      dialogFormVisible.value = false;
-      alert('提交成功!');
-    } else {
-      dialogFormVisible.value = true;
-      alert('提交失败!');
-      return false;
-    }
-  });
-}
-
-
-
 const tableData = [
   {
+    id:1,
     name: '工商管理部',
     phone:'13546851126',
     isDepartmentEnabled: true
   },
   {
+    id:2,
     name: '工商管理部',
     phone:'13546851126',
     isDepartmentEnabled: true
   },
   {
+    id:3,
     name: '工商管理部',
     phone:'13546851126',
     isDepartmentEnabled: true
   },
   {
+    id:4,
     name: '工商管理部',
     phone:'13546851126',
     isDepartmentEnabled: true
 
   },
 ]
+function confirm(){formRef.value.validate((valid) => {
+  form.name='';
+  form.name='';
+  form.region='';
+  form.date1='';
+  form.date2='';
+  form.delivery= false;
+  form.type= [];
+  form.resource= '';
+  form.desc= '';
+  form.time=0;
+  form.times=0;
+  form.intervalTime=0;
+  form.required='';
+  form.phone='';
+  if (valid) {
+    dialogFormVisible.value = false;
+    alert('提交成功!');
+  } else {
+    dialogFormVisible.value = true;
+    alert('提交失败!');
+    return false;
+  }
+});
+}
+
+function cencle(){
+  form.name='';
+  form.name= '';
+  form.region= '';
+  form.date1= '';
+  form.date2= '';
+  form.delivery= false;
+  form.type= [];
+  form.resource= '';
+  form.desc= '';
+  form.time=0;
+  form.times=0;
+  form.intervalTime=0;
+  form.required='';
+  form.phone='';
+  dialogFormVisible.value = false
+}
+
 
 </script>
 <template>
@@ -86,10 +119,10 @@ const tableData = [
       </el-form>
         <template #footer>
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitForm">
+          <el-button type="primary" @click="confirm">
             确定
           </el-button>
-          <el-button @click="dialogFormVisible = false">取消</el-button>
+          <el-button @click="cencle">取消</el-button>
         </div>
         </template>
     </el-dialog>
@@ -99,7 +132,7 @@ const tableData = [
   </div>
 
   <div>
-    <el-table :data="tableData" style="width: 100%" align="center" :header-cell-style="{'text-align':'center',background:'#eef1f6',color:'#606266'}">
+    <el-table :data="tableData" style="width: 100%" :header-cell-style="{'text-align':'center',background:'#eef1f6',color:'#606266'}">
       <el-table-column type="selection" width="30"></el-table-column>
       <el-table-column prop="name" label="部门名称" width="360" align="center"/>
       <el-table-column prop="phone" label="联系电话" width="360" align="center"/>

+ 18 - 2
src/views/UserManView.vue

@@ -60,8 +60,8 @@
 
           <template #footer>
             <div class="dialog-footer">
-              <el-button type="primary" @click="dialogFormVisible = false">确定</el-button>
-              <el-button  @click="dialogFormVisible = false">
+              <el-button type="primary" @click="confirm">确定</el-button>
+              <el-button  @click="cencle">
                 取消
               </el-button>
             </div>
@@ -164,6 +164,22 @@ const value2 = ref('');
 const value3 = ref('');
 const value4 = ref('');
 
+function confirm(){
+  value1.value='';
+  value2.value='';
+  value3.value='';
+  value4.value='';
+  value7.value='';
+  dialogFormVisible.value = false
+}
+function cencle(){
+  value1.value='';
+  value2.value='';
+  value3.value='';
+  value4.value='';
+  value7.value='';
+  dialogFormVisible.value = false
+}
 </script>
 
 <style scoped>