浏览代码

合作单位修改完毕

1
mo 4 年之前
父节点
当前提交
bb3851f5cb

+ 9 - 2
src/api/systemManage.js

@@ -7,16 +7,23 @@ export function cooperationOrganAdd (data) {
   return request({
     url: api + '/cooperationOrgan/add',
     method: 'post',
-    data: qs.stringify(data)
+    data,
+    headers: {
+      'Content-Type': 'application/json',
+    },
   })
 }
 
 // 修改合作单位(教学点)
+//     data: qs.stringify(data),    data: qs.stringify(data),
 export function cooperationOrganUpdate (data) {
   return request({
     url: api + '/cooperationOrgan/update',
     method: 'put',
-    data: qs.stringify(data)
+    data,
+    headers: {
+      'Content-Type': 'application/json',
+    },
   })
 }
 

+ 1 - 0
src/utils/request.js

@@ -4,6 +4,7 @@ import { Message } from 'element-ui'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
 import cleanDeep from 'clean-deep'
+import qs from 'querystring'
 // import { Loading } from 'element-ui'
 import { showFullScreenLoading, tryHideFullScreenLoading } from './request-loading'
 import router from '@/router/index'

+ 237 - 98
src/views/categroyManager/insideSetting/branchManager.vue

@@ -107,6 +107,11 @@
           <el-table-column align="center" label="操作" width="100">
             <template slot-scope="scope">
               <el-button
+                @click="openTeaching('look',scope.row)"
+                type="text"
+                >查看</el-button
+              >
+              <el-button
                 @click="openTeaching('update', scope.row)"
                 v-permission="'cooperationOrgan/update'"
                 type="text"
@@ -136,98 +141,173 @@
       :title="formTitle[formActionTitle]"
       :visible.sync="teachingStatus"
       @close="onFormClose('ruleForm')"
-      width="500px"
+      width="1060px"
     >
-      <el-form :model="form" :rules="rules" ref="ruleForm">
-        <el-form-item
-          label="单位名称"
-          prop="name"
-          :label-width="formLabelWidth"
-        >
-          <el-input v-model.trim="form.name" autocomplete="off"></el-input>
-        </el-form-item>
-        <el-form-item
-          label="所属分部"
-          prop="organId"
-          :label-width="formLabelWidth"
-        >
-          <el-select
-            v-model.trim="form.organId"
-            @change="changeOrgan"
-            filterable
-            clearable
+      <el-form :model="form" :rules="rules" ref="ruleForm" :inline="true">
+        <el-row>
+          <el-form-item
+            label="单位名称"
+            prop="name"
+            :label-width="formLabelWidth"
           >
-            <el-option
-              v-for="item in selects.branchs"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item
-          label="乐团主管"
-          prop="educationUserId"
-          :label-width="formLabelWidth"
-          :rules="[{ required: true, message: '乐团主管不能为空' }]"
-        >
-          <el-select
-            :disabled="!form.organId"
-            v-model.trim="form.educationUserId"
-            filterable
-            clearable
+            <el-input
+              v-model.trim="form.name"
+              autocomplete="off"
+              style="width: 180px !important"
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            label="所属分部"
+            prop="organId"
+            :label-width="formLabelWidth"
           >
-            <el-option
-              v-for="(item, index) in educationList"
-              :key="index"
-              :label="item.realName"
-              :value="item.userId"
+            <el-select
+              style="width: 180px !important"
+              v-model.trim="form.organId"
+              @change="changeOrgan"
+              filterable
+              clearable
             >
-              <span style="float: left">{{ item.realName }}</span>
-              <span style="float: right; color: #8492a6; font-size: 13px">{{
-                String(item.userId)
-              }}</span>
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item
-          label="状态"
-          prop="isEnable"
-          :label-width="formLabelWidth"
-        >
-          <el-select v-model.trim="form.isEnable" filterable clearable>
-            <el-option label="开启" :value="true"></el-option>
-            <el-option label="关闭" :value="false"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item
-          label="联系人"
-          prop="linkman"
-          :label-width="formLabelWidth"
-        >
-          <el-input v-model.trim="form.linkman" autocomplete="off"></el-input>
-        </el-form-item>
-        <el-form-item label="职位" prop="job" :label-width="formLabelWidth">
-          <el-input v-model.trim="form.job" autocomplete="off"></el-input>
-        </el-form-item>
-        <el-form-item
-          label="手机号"
-          prop="mobileNo"
-          :label-width="formLabelWidth"
-        >
-          <el-input v-model.trim="form.mobileNo" autocomplete="off"></el-input>
-        </el-form-item>
-        <el-form-item
-          label="是否全职资源"
-          prop="fullJobResource"
-          :label-width="formLabelWidth"
+              <el-option
+                v-for="item in selects.branchs"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-row>
+        <el-row>
+          <el-form-item
+            label="乐团主管"
+            prop="educationUserId"
+            :label-width="formLabelWidth"
+            :rules="[{ required: true, message: '乐团主管不能为空' }]"
+          >
+            <el-select
+              style="width: 180px !important"
+              :disabled="!form.organId|| basdisabled"
+              v-model.trim="form.educationUserId"
+              filterable
+              clearable
+            >
+              <el-option
+                v-for="(item, index) in educationList"
+                :key="index"
+                :label="item.realName"
+                :value="item.userId"
+              >
+                <span style="float: left">{{ item.realName }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{
+                  String(item.userId)
+                }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="合作单位状态"
+            prop="isEnable"
+            :label-width="formLabelWidth"
+          >
+            <el-select
+            :disabled="basdisabled"
+              v-model.trim="form.isEnable"
+              filterable
+              clearable
+              style="width: 180px !important"
+            >
+              <el-option label="开启" :value="true"></el-option>
+              <el-option label="关闭" :value="false"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="是否全职资源"
+            prop="fullJobResource"
+            :label-width="formLabelWidth"
+          >
+            <el-select
+            :disabled="basdisabled"
+              v-model.trim="form.fullJobResource"
+              style="width: 180px !important"
+            >
+              <el-option label="是" :value="1"></el-option>
+              <el-option label="否" :value="0"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-row>
+        <el-row
+          v-for="(item, index) in form.cooperationOrganLinkmanList"
+          :key="index"
         >
-          <el-select v-model.trim="form.fullJobResource">
-            <el-option label="是" :value="1"></el-option>
-            <el-option label="否" :value="0"></el-option>
-          </el-select>
-        </el-form-item>
+          <el-form-item
+            :rules="[
+              { required: true, message: '请输入联系人', trigger: 'blur' },
+            ]"
+            :label="'联系人' + (index + 1)"
+            :prop="'cooperationOrganLinkmanList.' + index + '.linkman'"
+            :label-width="formLabelWidth"
+          >
+            <el-input
+            :disabled="basdisabled"
+              v-model.trim="item.linkman"
+              autocomplete="off"
+              style="width: 180px !important"
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            :rules="[
+              { required: true, message: '请输入职位', trigger: 'blur' },
+            ]"
+            :label="'联系人' + (index + 1) + '职位'"
+            :prop="'cooperationOrganLinkmanList.' + index + '.job'"
+            :label-width="formLabelWidth"
+          >
+            <el-input
+            :disabled="basdisabled"
+              v-model.trim="item.job"
+              autocomplete="off"
+              style="width: 180px !important"
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            :rules="[
+              { required: true, validator: validPhone, trigger: 'blur' },
+              ,
+              {
+                pattern: /^1[3456789]\d{9}$/,
+                message: '请输入正确的手机号',
+                trigger: 'blur',
+              },
+            ]"
+            :label="'联系人' + (index + 1) + '手机号'"
+            :prop="'cooperationOrganLinkmanList.' + index + '.mobileNo'"
+            :label-width="formLabelWidth"
+          >
+            <el-input
+            :disabled="basdisabled"
+              v-model.trim="item.mobileNo"
+              autocomplete="off"
+              style="width: 180px !important"
+            ></el-input>
+          </el-form-item>
+          <i
+            class="el-icon-remove-outline marginLeft10 iconStyle"
+            v-if="form.cooperationOrganLinkmanList.length > 1 && !basdisabled"
+            @click="deleteLinkMan(index)"
+            style="font-size: 20px; cursor: pointer"
+          ></i>
+          <i
+            class="el-icon-circle-plus-outline marginLeft10 iconStyle"
+            v-if="
+              !basdisabled &&
+              index + 1 == form.cooperationOrganLinkmanList.length
+            "
+            @click="addLinkMan"
+            style="font-size: 20px; cursor: pointer"
+          ></i>
+        </el-row>
       </el-form>
+
       <span slot="footer" class="dialog-footer">
         <el-button @click="teachingStatus = false">取 消</el-button>
         <el-button type="primary" @click="onTeachingSubmit('ruleForm')"
@@ -270,6 +350,7 @@ export default {
         isEnable: null,
         search: null,
       },
+      validPhone,
       searchLsit: [],
       tableList: [],
       educationList: [],
@@ -285,6 +366,7 @@ export default {
       formTitle: {
         create: "添加合作单位",
         update: "修改合作单位",
+        look:"查看合作单位"
       },
       formLabelWidth: "120px",
       form: {
@@ -296,22 +378,15 @@ export default {
         fullJobResource: null,
         organId: null,
         educationUserId: null,
+        cooperationOrganLinkmanList: [
+          { cooperationOrganId: "", job: "", linkman: "", mobileNo: "" },
+        ],
       },
       rules: {
         name: [
           { required: true, message: "请输入教学点名称", trigger: "blur" },
         ],
-        linkman: [{ required: true, message: "请输入联系人", trigger: "blur" }],
-        job: [{ required: true, message: "请输入职位", trigger: "blur" }],
-        mobileNo: [
-          { required: true, validator: validPhone, trigger: "blur" },
-          ,
-          {
-            pattern: /^1[3456789]\d{9}$/,
-            message: "请输入正确的手机号",
-            trigger: "blur",
-          },
-        ],
+
         organId: [
           { required: true, message: "请选择所属分部", trigger: "change" },
         ],
@@ -325,6 +400,8 @@ export default {
           { required: true, message: "请选择状态", trigger: "change" },
         ],
       },
+      basdisabled: false,
+      actionRow: null,
     };
   },
   mounted() {
@@ -385,6 +462,7 @@ export default {
               // 判断有没有Id,如果有则删除
               delete this.form.id;
             }
+            console.log(this.form);
             cooperationOrganAdd(this.form).then((res) => {
               if (res.code == 200) {
                 this.$message.success("创建成功");
@@ -426,9 +504,11 @@ export default {
       // 重置数据
       this.teachingStatus = true;
       this.formActionTitle = type;
-      this.changeOrgan(rows.organId);
+
       // 修改的时候赋值
       if (type == "update") {
+        this.changeOrgan(rows.organId);
+        this.actionRow = rows;
         this.form = {
           id: rows.id,
           name: rows.name, // 教学点名称
@@ -440,7 +520,33 @@ export default {
           fullJobResource: rows.fullJobResource,
           isEnable: rows.isEnable,
           educationUserId: rows.educationUserId,
+          cooperationOrganLinkmanList:rows.cooperationOrganLinkmanList.length>0?rows.cooperationOrganLinkmanList: [
+          { cooperationOrganId: rows.id, job: "", linkman: "", mobileNo: "" },
+        ]
         };
+              this.basdisabled = false
+      } else if(type == 'look'){
+        this.changeOrgan(rows.organId);
+        this.actionRow = rows;
+            this.form = {
+          id: rows.id,
+          name: rows.name, // 教学点名称
+          linkman: rows.linkman, // 来源
+          job: rows.job, // 费用
+          mobileNo: rows.mobileNo ? rows.mobileNo : null,
+          ownershipType: rows.ownershipType,
+          organId: rows.organId,
+          fullJobResource: rows.fullJobResource,
+          isEnable: rows.isEnable,
+          educationUserId: rows.educationUserId,
+          cooperationOrganLinkmanList:rows.cooperationOrganLinkmanList
+        };
+        this.basdisabled = true
+        // 查看
+      }
+      else {
+        this.basdisabled = false
+        this.actionRow = null;
       }
     },
     onFormClose(formName) {
@@ -473,6 +579,31 @@ export default {
         }
       }
     },
+    deleteLinkMan(index) {
+      console.log(this.form.cooperationOrganLinkmanList);
+      this.form.cooperationOrganLinkmanList.splice(index, 1);
+    },
+    addLinkMan() {
+      if (this.actionRow) {
+        // 修改
+        console.log(this.actionRow);
+        this.form.cooperationOrganLinkmanList.push({
+          cooperationOrganId: this.actionRow.id,
+          job: "",
+          linkman: "",
+          mobileNo: "",
+        });
+      } else {
+        // 新增
+        this.form.cooperationOrganLinkmanList.push({
+          cooperationOrganId: "",
+          job: "",
+          linkman: "",
+          mobileNo: "",
+        });
+      }
+    },
+
   },
 };
 </script>
@@ -498,4 +629,12 @@ export default {
   margin-top: 10px;
   z-index: 99999 !important;
 }
+
+.iconStyle {
+  color: #999;
+  line-height: 40px;
+}
+.marginLeft10 {
+  margin-left: 10px;
+}
 </style>

+ 10 - 0
src/views/resetTeaming/components/archicesComponents/api.js

@@ -66,3 +66,13 @@ export const getExceptionPlan = data => request2({
   requestType:'json'
 
 })
+
+// 获取乐团档案基本细心
+export const getBasicInfo = data => request2({
+  url: '/api-web/musicGroupRecord/queryBasicInfo',
+  data ,
+  params:data,
+  method: 'get',
+  requestType:'form'
+
+})

+ 40 - 11
src/views/resetTeaming/components/archicesComponents/baseInfo.vue

@@ -3,16 +3,28 @@
     <el-alert title="基础信息" :closable="false" class="alert" type="info" />
     <descriptions :column="3" class="marginBtm22">
       <descriptions-item label="乐团编号:">
-        <overflow-text :text="'21068936448400001'" width="100%"></overflow-text
+        <overflow-text :text="baseInfo.id" width="100%"></overflow-text
       ></descriptions-item>
-      <descriptions-item label="申请时间:"> 2021-07-09</descriptions-item>
-      <descriptions-item label="开团时间:"> 2021-07-09</descriptions-item>
-      <descriptions-item label="收费模式:"> 2021-07-09</descriptions-item>
-      <descriptions-item label="收费类型:"> </descriptions-item>
-      <descriptions-item label="合作单位:"> </descriptions-item>
-      <descriptions-item label="教学点:">武汉小学音乐教室 </descriptions-item>
+      <descriptions-item label="申请时间:">
+        {{ baseInfo.createTime | formatTimer }}</descriptions-item
+      >
+      <descriptions-item label="开团时间:">
+        {{ baseInfo.billStartDate | formatTimer }}</descriptions-item
+      >
+      <descriptions-item label="收费模式:">
+        {{ baseInfo.courseViewType | courseViewType }}</descriptions-item
+      >
+      <descriptions-item label="收费类型:"
+        >{{ baseInfo.chargeTypeName }}
+      </descriptions-item>
+      <descriptions-item label="合作单位:">
+        {{ baseInfo.cooperationOrganName }}</descriptions-item
+      >
+      <descriptions-item label="教学点:"
+        >{{ baseInfo.schoolName }}
+      </descriptions-item>
       <descriptions-item label="衔接老师:">
-        张老师 / 13600000002</descriptions-item
+       {{baseInfo.transactionTeacherName}}</descriptions-item
       >
     </descriptions>
     <el-alert title="联系人" :closable="false" class="alert" type="info" />
@@ -21,13 +33,30 @@
       <descriptions-item label="联系人:"> </descriptions-item>
       <descriptions-item label="职位:"> 2021-07-09</descriptions-item>
       <descriptions-item label="手机号:"> 2021-07-09</descriptions-item>
-      <descriptions-item label="乐队指导:"> </descriptions-item>
-      <descriptions-item label="乐团主管:"> 2021-07-09</descriptions-item>
+      <descriptions-item label="乐队指导:">{{baseInfo.directorUserName}} </descriptions-item>
+      <descriptions-item label="乐团主管:"> {{baseInfo.educationalTeacherName}}</descriptions-item>
     </descriptions>
+
   </div>
 </template>
 <script>
-export default {};
+import { getBasicInfo } from "./api";
+export default {
+  data() {
+    return {
+      baseInfo: null,
+    };
+  },
+  async mounted() {
+    try {
+      const res = await getBasicInfo({ musicGroupId: this.$route.query.id });
+      this.baseInfo = res.data;
+    } catch (e) {
+      console.log(e);
+    }
+  },
+  methods: {},
+};
 </script>
 <style lang="scss" scoped="scoped">
 .marginBtm22 {

+ 2 - 0
src/views/resetTeaming/components/archicesComponents/modals/addPlan.vue

@@ -153,6 +153,7 @@ export default {
     },
     deletePlan(index) {
       console.log(index);
+       this.planform.palnList.splice(index,1)
     },
     submit() {
       this.$refs.planform.validate(async (flag) => {
@@ -166,6 +167,7 @@ export default {
               const res = await addMusicGroupTrainPlan({
                 ...this.form,
                 plans: plans,
+                musicGroupId:this.$route.query.id
               });
               this.$emit("close");
             } catch (e) {