فهرست منبع

拉取微信扫描页修改

zouzhd 3 سال پیش
والد
کامیت
577d3bf215
3فایلهای تغییر یافته به همراه289 افزوده شده و 48 حذف شده
  1. 2 2
      build/utils.js
  2. 205 42
      src/views/RMS/components/addPersonnel.vue
  3. 82 4
      src/views/appoint/components/saleContract/saleOrder.vue

+ 2 - 2
build/utils.js

@@ -33,8 +33,8 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // let devModules = ['index','systemConfig', 'formGenerator', 'preview', 'metaData', 'serviceManager', 'configManager', 'custom'];
 // let devModules = ['index', 'systemConfig','formGenerator', 'preview', 'metaData', 'serviceManager', 'configManager', 'btnControll'];
 // let devModules = ['index','inward','SporadicManage']
-let devModules = ['all'];
-// let devModules = ['index','inward','appoint','sale']
+// let devModules = ['all'];
+let devModules = ['index','appoint','sale','RMS','systemConfig']
 
 
 if (pathSrc.indexOf('node_modules') > -1) {

+ 205 - 42
src/views/RMS/components/addPersonnel.vue

@@ -2,10 +2,51 @@
   <!-- 添加人员信息 -->
   <div class="addWagonLoad">
     <PageTitle>返回</PageTitle>
-    <el-divider content-position="left">人员信息</el-divider>
      <div class="form-box" style="margin-right: 10rem">
         <dil-form :formId="325" v-model="form1" ref="from1"></dil-form>
       </div>
+
+      <div class="department">
+        <div class="department2">
+                <span>二级部门:</span>
+                <el-select v-model="value1" placeholder="请选择" @change="onchange1">
+                    <el-option
+                    v-for="(item,i) in options1"
+                    :key="i"
+                    :label="item.label"
+                    :value="item.value"
+                    >
+                    </el-option>
+                </el-select>
+            </div>
+            <div class="department3">
+                <span>三级部门:</span>
+                <el-select v-model="value2" placeholder="请选择" @change="onchange2">
+                    <el-option
+                        v-for="(item,i) in options2"
+                        :key="i"
+                        :label="item.label"
+                        :value="item.value"
+                    >
+                    </el-option>
+                </el-select>
+            </div>
+      </div>
+      <div>
+        <div class="role">
+                <span>赋权角色:</span>
+                <el-select v-model="value3" placeholder="请选择" @change="onchange3">
+                    <el-option
+                        v-for="(item,i) in options3"
+                        :key="i"
+                        :label="item.label"
+                        :value="item.value"
+                    >
+                    </el-option>
+                </el-select>
+            </div>
+      </div>
+
     <div class="button-box">
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="makeSure">确定</el-button>
@@ -15,57 +56,167 @@
 
 <script>
 import PageTitle from "@/components/Page/Title";
-
+import { getCookie } from "@/utils/util.js";
 export default {
   components: { PageTitle },
   data() {
     return {
       form1: {},
       value: undefined,
+      //token
+      token: null,
+      //二级部门
+      options1:[],
+      //选中的二级部门名称
+      value1:'',
+      //选中的二级部门机构ID和机构编码
+      map1:[],
+      // 三级部门
+      options2:[],
+      // 选中的三级部门名称
+      value2:'',
+      //选中的三级部门机构ID和机构编码
+      map2:[],
+      // 角色
+      options3:[],
+      // 选中的角色名称
+      value3:'',
+      // 选中的角色ID
+      roleId:''
     };
   },
-  mounted() {},
+  created(){
+    this.token = getCookie("accessToken");
+    console.log('this.token',this.token)
+  },
+  mounted() {
+    //初始化二级机构和角色
+    this.initialization();
+  },
   methods: {
+     initialization(){
+       //初始化选择二级机构
+         this.axios.get('/api/v1/rms/getSecondShipper').then((res)=>{
+             this.options1 = res.data.data;
+             console.log("this.options1",this.options1)
+         })
+         //初始化角色
+         this.axios({
+           Headers:{
+            //  'Content-Type':'application/x-www-form-urlencoded',
+             'authorization' : 'Bearer' + this.token
+           },
+           method:'get',
+           url:'https://wl.dasteel.cn:32322/icore.icp.web/pass/v1/sysroles/getRolesUser?companyId=713710108567277568&appId=821034072422879232',
+         })
+         .then((res)=>{
+           console.log('res',res)
+             this.options3 = res.data.data;
+             console.log("this.options3",this.options3)
+         })
+     },
+     onchange1(val){
+            console.log("val",val);
+            //  查询选中的二级机构下的三级机构
+             this.value2 = '';
+             this.axios.get('/api/v1/rms/getThirdShipper?shipperId='+val).then((res)=>{
+             this.options2 = res.data.data;    
+              console.log("this.options2",this.options2)
+         })
+         //获取二级部门的机构ID和机构编码
+         this.axios.post('/api/v1/rms/getShipperMap?shipperId='+val).then((res)=>{
+             this.map1 = res.data.data;
+              console.log("this.map1",this.map1)
+         })
+     },
+     onchange2(val){
+            console.log("val",val);
+         //获取三级部门的机构ID和机构编码
+         this.axios.post('/api/v1/rms/getShipperMap?shipperId='+val).then((res)=>{
+             this.map2 = res.data.data; 
+              console.log("this.map2",this.map2)
+         })
+     },
+
+
+
+     //确定人员新增
      makeSure() {
-      console.log(this.form1)
-      let RmsPersonnel={
-        personnelId:this.form1.personnelId,
-        personnelJobNumber: this.form1.personnelJobNumber,
-        personnelName: this.form1.personnelName,
-        personnelPost: this.form1.personnelPost,
-        personnelWorkshopid: this.form1.personnelWorkshopid,
-        personnelShifts: this.form1.personnelShifts,
-        personnelTeam:this.form1.personnelTeam,
-        departmentId: this.form1.shipperId
-      };
-      if(
-        RmsPersonnel.personnelJobNumber ==null ||
-        RmsPersonnel.personnelName ==null ||
-        RmsPersonnel.personnelPost ==null ||
-        RmsPersonnel.personnelWorkshopid==null ||
-        RmsPersonnel.personnelShifts==null ||
-        RmsPersonnel.departmentId==null ||
-        RmsPersonnel.personnelTeam==null
-      )this.$message.error("存在空值!");
-      else
-      this.axios
-        .post(
-          "/api/v1/rms/insertPersonnel",
-           RmsPersonnel
-        )
-        .then((res) => {
-          if (res.data.code == 200) {
-            this.$message({
-              type: "success",
-              message: "新增成功!",
-            });
-            // this.$refs.table.refreshData();
-            this.$router.go(-1);
-          } else {
-            this.$message.error("新增失败,可能存在重复!");
-          }
-          this.$refs['table'].resetField();
-        });
+      if(this.options2.length==0){
+      let userInfo = {
+        userName : this.form1.personnelName,
+        userCode : this.form1.personnelJobNumber,
+        orgCode : this.map1.shipperOrgCode,
+        orgName : this.value1,
+        orgId : this.map1.shipperSsoId,
+        mobile : '13500000011',
+        email : '123456789@qq.com',
+        groupId : '506514577756917769',
+        companyId : '713710108567277568'
+      }
+      }else{
+        let userInfo = {
+        userName : this.form1.personnelName,
+        userCode : this.form1.personnelJobNumber,
+        orgCode : this.map2.shipperOrgCode,
+        orgName : this.value1,
+        orgId : this.map2.shipperSsoId,
+        mobile : '13500000011',
+        email : '123456789@qq.com',
+        groupId : '506514577756917769',
+        companyId : '713710108567277568'
+      }
+      }
+       //先新增SSO中的用户
+      
+      const formData = new FormData();
+      Object.keys(userInfo).forEach((key) => {
+      formData.append(key, userInfo[key]);
+      });
+      console.log('formData',formData)
+      //  this.axios.post('https://wl.dasteel.cn:32322/icore.icp.web/pass/v1/sysusers/',)
+      //  .then((res)=>{
+      //    console.log("res",res)
+      //  })
+
+      // let RmsPersonnel={
+      //   personnelId:this.form1.personnelId,
+      //   personnelJobNumber: this.form1.personnelJobNumber,
+      //   personnelName: this.form1.personnelName,
+      //   personnelPost: this.form1.personnelPost,
+      //   personnelWorkshopid: this.form1.personnelWorkshopid,
+      //   personnelShifts: this.form1.personnelShifts,
+      //   personnelTeam:this.form1.personnelTeam,
+      //   departmentId: this.form1.shipperId
+      // };
+      // if(
+      //   RmsPersonnel.personnelJobNumber ==null ||
+      //   RmsPersonnel.personnelName ==null ||
+      //   RmsPersonnel.personnelPost ==null ||
+      //   RmsPersonnel.personnelWorkshopid==null ||
+      //   RmsPersonnel.personnelShifts==null ||
+      //   RmsPersonnel.departmentId==null ||
+      //   RmsPersonnel.personnelTeam==null
+      // )this.$message.error("存在空值!");
+      // else
+      // this.axios
+      //   .post(
+      //     "/api/v1/rms/insertPersonnel",
+      //      RmsPersonnel
+      //   )
+      //   .then((res) => {
+      //     if (res.data.code == 200) {
+      //       this.$message({
+      //         type: "success",
+      //         message: "新增成功!",
+      //       });
+      //       // this.$refs.table.refreshData();
+      //       this.$router.go(-1);
+      //     } else {
+      //       this.$message.error("新增失败,可能存在重复!");
+      //     }
+      //     this.$refs['table'].resetField();
+      //   });
     },
     // 取消
     cancel() {
@@ -102,4 +253,16 @@ export default {
     }
   }
 }
+.department{
+  display: flex;
+  justify-content: center;
+  .department3{
+    margin-left: 2rem;
+  }
+}
+.role{
+  display: flex;
+  justify-content: center;
+  margin-top: 2rem;
+}
 </style>

+ 82 - 4
src/views/appoint/components/saleContract/saleOrder.vue

@@ -64,7 +64,7 @@
       </el-tab-pane>
       <!-- 销售公司已审批 -->
        <el-tab-pane label="销售公司已审批" name="four">
-        <dilTable v-bind.sync="option4">
+        <dilTable v-bind.sync="option4" ref="table">
           <el-table-column fixed="right" label="操作" width="130">
             <template slot-scope="scope">
               <el-button
@@ -74,13 +74,33 @@
                 >新增车序号</el-button
               >
               <el-button
-                @click="detailedClick(scope.row.saleOrderId)"
+                @click="detailclick(scope.row)"
                 type="text"
                 size="small"
                 >物资详情</el-button
               >
             </template>
           </el-table-column>
+          <!-- 物资详情抽屉 -->
+        <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+        </el-table-column>
+
         </dilTable>
       </el-tab-pane>
     </el-tabs>
@@ -114,6 +134,28 @@ export default {
           "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409",
       },
       
+      //记录旧的row对象
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态
+      oldRowCount: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop: "specificationModel",
+          label: "规格型号",
+          width: 150,
+        },
+        {
+          prop: "orderMaterialNumber",
+          label: "物资件数",
+          width: 100,
+        },
+      ],
+      tableData: [],
     };
   },
   methods: {
@@ -136,9 +178,45 @@ export default {
     addClick(saleOrderId){
       this.$router.push("/addSaleOrderArrange/" + saleOrderId);
     },
-    detailedClick(saleOrderId){
-      this.$router.push("saleOrderMaterial/" + saleOrderId);
+    // detailedClick(saleOrderId){
+    //   this.$router.push("saleOrderMaterial/" + saleOrderId);
+    // },
+    // 查看物资详情
+    detailclick(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      // this.getMaterial(row.saleOrderId);
+            this.getMaterial();
+    },
+    // 根据销售订单id查询物资信息
+    getMaterial() {
+      this.axios
+      // "/api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId
+        .get("/api/v1/tms/getMaterial?orderId=" +1074)
+        .then((res) => {
+          this.tableData = res.data.data;
+        });
     },
+
     // 上传
     uploadclick(saleOrderId) {
       this.$confirm("是否上传", "提示", {