Procházet zdrojové kódy

Merge branch 'wsm' of http://139.196.39.194:9021/chenc/cd-work-flow-web into wsm

shenji před 1 rokem
rodič
revize
a6835fa8ea

+ 2 - 2
src/mixins/JEditableTableMixin.js

@@ -62,13 +62,13 @@ export const JEditableTableMixin = {
       this.edit({})
     },
     /** 当点击了编辑(修改)按钮时调用此方法 */
-    edit(record) {
+    edit(record,state) {
       if (typeof this.editBefore === 'function') this.editBefore(record)
       this.visible = true
       this.activeKey = this.refKeys[0]
       this.form.resetFields()
       this.model = Object.assign({}, record)
-      if (typeof this.editAfter === 'function') this.editAfter(this.model)
+      if (typeof this.editAfter === 'function') this.editAfter(this.model,state)
     },
     /** 关闭弹窗,并将所有JEditableTable实例回归到初始状态 */
     close() {

+ 2 - 2
src/mixins/JeecgListMixin.js

@@ -230,8 +230,8 @@ export const JeecgListMixin = {
       // 新增/修改 成功时,重载列表
       this.loadData();
     },
-    handleDetail:function(record){
-      this.$refs.modalForm.edit(record);
+    handleDetail:function(record,state){
+      this.$refs.modalForm.edit(record,state);
       this.$refs.modalForm.title="详情";
       this.$refs.modalForm.disableSubmit = true;
     },

+ 1 - 1
src/views/oa/EnrollmentList.vue

@@ -137,7 +137,7 @@
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)"  v-if="record.status==1" >编辑</a>
           <a-divider type="vertical"  v-if="record.status==2" />
-          <a href="javascript:;"  v-if="record.status==2" @click="handleDetail(record)">详情</a>
+          <a href="javascript:;"  v-if="record.status==2" @click="handleDetail(record,'detail')">详情</a>
           <a-divider type="vertical"  v-if="record.status==1" />
           <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"  v-if="record.status==1">
               <a  v-if="record.status==1">删除</a>

+ 36 - 27
src/views/oa/modules/EnrollmentModal.vue

@@ -7,6 +7,10 @@
     :confirmLoading="confirmLoading"
     @ok="handleOk"
     @cancel="handleCancel">
+    <template slot="footer">
+      <a-button @click="handleCancel">取消</a-button>
+      <a-button @click="handleOk" type="primary" v-if="!show">保存</a-button>
+    </template>
     <a-spin :spinning="confirmLoading">
       <!-- 主表单区域 -->
       <a-form :form="form">
@@ -30,12 +34,12 @@
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="登记日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-date placeholder="请选择登记日期" v-decorator="[ 'operateDate', validatorRules.operateDate]" :trigger-change="true" style="width: 100%"/>
+              <j-date placeholder="请选择登记日期" v-decorator="[ 'operateDate', validatorRules.operateDate]" :trigger-change="true" style="width: 100%" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input v-decorator="[ 'realname', validatorRules.realname]" placeholder="请输入姓名"></a-input>
+              <a-input v-decorator="[ 'realname', validatorRules.realname]" placeholder="请输入姓名" :disabled="show"></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
@@ -45,7 +49,7 @@
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-decorator="['gender', validatorRules.gender]" placeholder="请选择性别">
+              <a-select v-decorator="['gender', validatorRules.gender]" placeholder="请选择性别" :disabled="show">
                 <a-select-option :value="1">男</a-select-option>
                 <a-select-option :value="2">女</a-select-option>
               </a-select>
@@ -53,7 +57,7 @@
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="证件类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-decorator="['idType', validatorRules.idType]" placeholder="请选择证件类型">
+              <a-select v-decorator="['idType', validatorRules.idType]" placeholder="请选择证件类型" :disabled="show"> 
                 <a-select-option value="身份证">身份证</a-select-option>
                 <a-select-option value="其他">其他</a-select-option>
               </a-select>
@@ -61,32 +65,32 @@
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="证件号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input v-decorator="[ 'idNo', validatorRules.idNo]" placeholder="请输入证件号码"></a-input>
+              <a-input v-decorator="[ 'idNo', validatorRules.idNo]" placeholder="请输入证件号码" :disabled="show"></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-date placeholder="请选择生日" v-decorator="[ 'birthday', validatorRules.birthday]" :trigger-change="true" style="width: 100%"/>
+              <j-date placeholder="请选择生日" v-decorator="[ 'birthday', validatorRules.birthday]" :trigger-change="true" style="width: 100%" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="入职日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-date placeholder="请选择入职日期" v-decorator="[ 'joinDate', validatorRules.joinDate]" :trigger-change="true" style="width: 100%"/>
+              <j-date placeholder="请选择入职日期" v-decorator="[ 'joinDate', validatorRules.joinDate]" :trigger-change="true" style="width: 100%" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', validatorRules.post]" />
+              <j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', validatorRules.post]" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="职级" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input v-decorator="[ 'postLevel', validatorRules.postLevel]" placeholder="请输入职级"></a-input>
+              <a-input v-decorator="[ 'postLevel', validatorRules.postLevel]" placeholder="请输入职级" :disabled="show"></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="学历" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-decorator="['education', validatorRules.education]" placeholder="请选择学历">
+              <a-select v-decorator="['education', validatorRules.education]" placeholder="请选择学历" :disabled="show">
                 <a-select-option value="大专">大专</a-select-option>
                 <a-select-option value="本科">本科</a-select-option>
                 <a-select-option value="硕士">硕士</a-select-option>
@@ -96,7 +100,7 @@
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="岗位类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-decorator="['positionType', validatorRules.positionType]" placeholder="请选择岗位类型">
+              <a-select v-decorator="['positionType', validatorRules.positionType]" placeholder="请选择岗位类型" :disabled="show">
                 <a-select-option value="管理类">管理类</a-select-option>
                 <a-select-option value="专技类">专技类</a-select-option>
               </a-select>
@@ -104,42 +108,42 @@
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="部门" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-select-depart v-decorator="['departIds', validatorRules.departIds]" :trigger-change="true"/>
+              <j-select-depart v-decorator="['departIds', validatorRules.departIds]" :trigger-change="true" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input v-decorator="[ 'mobile', validatorRules.mobile]" placeholder="请输入手机号码"></a-input>
+              <a-input v-decorator="[ 'mobile', validatorRules.mobile]" placeholder="请输入手机号码" :disabled="show"></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="座机" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input v-decorator="[ 'phone', validatorRules.phone]" placeholder="请输入座机"></a-input>
+              <a-input v-decorator="[ 'phone', validatorRules.phone]" placeholder="请输入座机" :disabled="show"></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="联系地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input v-decorator="[ 'address', validatorRules.address]" placeholder="请输入联系地址"></a-input>
+              <a-input v-decorator="[ 'address', validatorRules.address]" placeholder="请输入联系地址" :disabled="show"></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="试用结束日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-date placeholder="请选择试用结束日期" v-decorator="[ 'probationEnd', validatorRules.probationEnd]" :trigger-change="true" style="width: 100%"/>
+              <j-date placeholder="请选择试用结束日期" v-decorator="[ 'probationEnd', validatorRules.probationEnd]" :trigger-change="true" style="width: 100%" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="合同起始日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-date placeholder="请选择合同起始日期" v-decorator="[ 'contractStart', validatorRules.contractStart]" :trigger-change="true" style="width: 100%"/>
+              <j-date placeholder="请选择合同起始日期" v-decorator="[ 'contractStart', validatorRules.contractStart]" :trigger-change="true" style="width: 100%" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="合同结束日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-date placeholder="请选择合同结束日期" v-decorator="[ 'contractEnd', validatorRules.contractEnd]" :trigger-change="true" style="width: 100%"/>
+              <j-date placeholder="请选择合同结束日期" v-decorator="[ 'contractEnd', validatorRules.contractEnd]" :trigger-change="true" style="width: 100%" :disabled="show"/>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-radio-group  v-decorator="[ 'identity', validatorRules.identity]">
+              <a-radio-group  v-decorator="[ 'identity', validatorRules.identity]" :disabled="show">
                 <a-radio :value="1">普通用户</a-radio>
                 <a-radio :value="2">上级</a-radio>
               </a-radio-group>
@@ -147,17 +151,17 @@
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input v-decorator="[ 'remark', validatorRules.remark]" placeholder="请输入备注"></a-input>
+              <a-input v-decorator="[ 'remark', validatorRules.remark]" placeholder="请输入备注" :disabled="show"></a-input>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="签字图片" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-upload v-decorator="['signature', validatorRules.signature]" :trigger-change="true"></j-upload>
+              <j-upload v-decorator="['signature', validatorRules.signature]" :trigger-change="true" :disabled="show"></j-upload>
             </a-form-item>
           </a-col>
           <a-col :span="8  ">
             <a-form-item label="附件" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-upload v-decorator="['attachment', validatorRules.attachment]" :trigger-change="true"></j-upload>
+              <j-upload v-decorator="['attachment', validatorRules.attachment]" :trigger-change="true" :disabled="show"></j-upload>
             </a-form-item>
           </a-col>
 
@@ -176,7 +180,7 @@
             :maxHeight="300"
             :rowNumber="true"
             :rowSelection="true"
-            :actionButton="true"/>
+            :actionButton="!show"/>
         </a-tab-pane>
 
         <a-tab-pane tab="工作经历" :key="refKeys[1]" :forceRender="true">
@@ -188,7 +192,7 @@
             :maxHeight="300"
             :rowNumber="true"
             :rowSelection="true"
-            :actionButton="true"/>
+            :actionButton="!show"/>
         </a-tab-pane>
         
         <a-tab-pane tab="学习经历" :key="refKeys[2]" :forceRender="true">
@@ -200,7 +204,7 @@
             :maxHeight="300"
             :rowNumber="true"
             :rowSelection="true"
-            :actionButton="true"/>
+            :actionButton="!show"/>
         </a-tab-pane>
         
       </a-tabs>
@@ -233,6 +237,7 @@
     },
     data() {
       return {
+        show:false,
         labelCol: {
           span: 6
         },
@@ -459,7 +464,12 @@
         return Promise.all(values)
       },
       /** 调用完edit()方法之后会自动调用此方法 */
-      editAfter() {
+      editAfter(record,stat2) {
+        this.show = false
+      if(stat2=='detail'){
+        this.show = true
+      }
+
         let fieldval = pick(this.model,'operator','operatorDept','operateDate','realname','username','gender','idType','idNo','birthday','joinDate','post','postLevel','education','positionType','departIds','mobile','phone','address','probationEnd','contractStart','contractEnd','remark','identity','signature','attachment')
         this.$nextTick(() => {
           this.form.setFieldsValue(fieldval)
@@ -474,7 +484,6 @@
       },
       /** 整理成formData */
       classifyIntoFormData(allValues) {
-        debugger
         let main = Object.assign(this.model, allValues.formValue)
 
         return {