Browse Source

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

Your Name 3 years ago
parent
commit
017f022f33

+ 1 - 1
config/index.js

@@ -56,7 +56,7 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
-    target: "http://192.168.1.113:8080",
+    target: "http://172.16.33.166:8080",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"

+ 233 - 29
src/views/RMS/components/addPersonnel.vue

@@ -5,6 +5,48 @@
      <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="请选择">
+                    <el-option
+                        v-for="(item,i) in options3"
+                        :key="i"
+                        :label="item.roleName"
+                        :value="item.roleId"
+                    >
+                    </el-option>
+                </el-select>
+            </div>
+      </div>
+
     <div class="button-box">
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="makeSure">确定</el-button>
@@ -14,64 +56,213 @@
 
 <script>
 import PageTitle from "@/components/Page/Title";
-
+import { getCookie } from "@/utils/util.js";
 export default {
   components: { PageTitle },
   data() {
     return {
       form1: {},
       value: undefined,
+      //新增用户的SSO主键
+      personnelSsoId:'',
+      //token
+      token: null,
+      //二级部门
+      options1:[],
+      //选中的二级部门名称
+      value1:'',
+      //选中的二级部门机构ID和机构编码
+      map1:[],
+      // 三级部门
+      options2:[],
+      // 选中的三级部门名称
+      value2:'',
+      //选中的三级部门机构ID和机构编码
+      map2:[],
+      // 角色
+      options3:[],
+      // 选中的角色名称
+      value3:'',
+      // 选中的角色ID
+      roleId:''
     };
   },
-  mounted() {},
+  created(){
+    this.token = getCookie("accessToken");
+  },
+  mounted() {
+    //初始化二级机构和角色
+    this.initialization();
+  },
   methods: {
+     initialization(){
+       //初始化选择二级机构
+         this.axios.get('/api/v1/rms/getSecondShipper').then((res)=>{
+             this.options1 = res.data.data;
+         })
+         //初始化角色
+        const formData = new FormData();
+        this.$store.dispatch('system/rolesManage/list',formData)
+        .then((res)=>{
+          var roleList = [];
+          roleList=res.data;
+          roleList.forEach((item,i)=>{
+              if(item.roleId!='superadmin'){
+                this.options3.push(item);
+              }
+          })
+          // this.options3 = res.data;
+        })
+     },
+     onchange1(val){
+            //  查询选中的二级机构下的三级机构
+             this.value2 = '';
+             this.axios.get('/api/v1/rms/getThirdShipper?shipperId='+val).then((res)=>{
+             this.options2 = res.data.data;    
+         })
+         //获取二级部门的机构ID和机构编码
+         this.axios.post('/api/v1/rms/getShipperMap?shipperId='+val).then((res)=>{
+             this.map1 = res.data.data;
+         })
+     },
+     onchange2(val){
+         //获取三级部门的机构ID和机构编码
+         this.axios.post('/api/v1/rms/getShipperMap?shipperId='+val).then((res)=>{
+             this.map2 = res.data.data; 
+         })
+     },
+
+     //确定人员新增
      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,
-        username:this.form1.username
-      };
-      let userName={
+      //初始化用户信息
+      let userInfo = {};
+      //该用户没有三级部门
+      if(this.options2.length==0){
+      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{
+        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]);
+      });
+      //新增用户
+      this.$store.dispatch('system/usersManage/addUser',formData)
+      .then((res)=>{
 
+      //再新增RMS_PERSONNEL表信息
+      let rmsPersonnel = {
+        personnelJobNumber : this.form1.personnelJobNumber,
+        personnelPost : this.form1.personnelPost,
+        personnelName : this.form1.personnelName,
+        personnelDepartmentId : this.form1.shipperId,
+        // personnelWorkshopid : this.form1.personnelWorkshopid,
+        personnelShifts : this.form1.personnelShifts,
+        personnelTeam : this.form1.personnelTeam,
+        personnelSsoId : res.data.userId
       }
       if(
         RmsPersonnel.personnelJobNumber ==null ||
         RmsPersonnel.personnelName ==null ||
         RmsPersonnel.personnelPost ==null ||
-        RmsPersonnel.personnelWorkshopid==null ||
+        // RmsPersonnel.personnelWorkshopid==null ||
         RmsPersonnel.personnelShifts==null ||
         RmsPersonnel.departmentId==null ||
-        RmsPersonnel.personnelTeam==null
+        RmsPersonnel.personnelTeam==null ||
+        userInfo.orgName==null ||
+        userInfo.orgCode==null ||
+        userInfo.orgId==null ||
+        this.value3==null
       )this.$message.error("存在空值!");
       else
-      this.axios
-        .post(
 
-        )
-        .post(
-          "/api/v1/rms/insertPersonnel",
-           RmsPersonnel
-        )
-        .then((res) => {
-          if (res.data.code == 200) {
+      this.axios.post('/api/v1/rms/addPersonnel',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();
-        });
+          // this.$refs['table'].resetField();
+      })
+
+      //最后新增角色赋权表
+      this.axios.post('pass/v1/sysuserroles/addUserroles?userId='
+      +res.data.userId+'&userCode='+this.form1.personnelJobNumber+'&roleId='+this.value3)
+      .then((res)=>{
+          this.$router.go(-1);
+      })    
+      });
+
+      //最后新增角色赋权表
+      
+      
+
+      // 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() {
@@ -84,6 +275,7 @@ export default {
  .button-box{
     display: flex;
     justify-content: center;
+    margin-top: 2rem;
     .el-button{
       width: 80px;
       margin-right: 10px;
@@ -108,4 +300,16 @@ export default {
     }
   }
 }
+.department{
+  display: flex;
+  justify-content: center;
+  .department3{
+    margin-left: 2rem;
+  }
+}
+.role{
+  display: flex;
+  justify-content: center;
+  margin-top: 2rem;
+}
 </style>

+ 7 - 3
src/views/appoint/components/saleContract/addSaleOrder.vue

@@ -74,8 +74,8 @@
                 ></el-input>
               </template>
               <!-- 收货地址id -->
-              <template v-if="item.prop == 'saleShipperAddressName'">
-                <el-input v-model="scope.row.saleShipperAddressName" disabled>
+              <template style="width: 400px" v-if="item.prop == 'saleShipperAddressName'">
+                <el-input style="width: 200px" v-model="scope.row.saleShipperAddressName" disabled>
                 </el-input>
                 <el-button type="primary" @click="ondrawer(scope.row,scope.$index)"
                   >浏览</el-button
@@ -126,7 +126,10 @@
     <el-drawer
       :visible.sync="drawer"
       :direction="direction"
-      :before-close="handleClose"
+      :close-on-press-escape="true"
+      :show-close="true"
+      :wrapperClosable="true"
+      modal
       size="30%"
     >
       <el-input
@@ -243,6 +246,7 @@ export default {
         {
           prop: "saleShipperAddressName",
           label: "收货地址",
+          width: "300",
           slot: true,
         },
         {

+ 284 - 8
src/views/appoint/components/saleContract/saleOrder.vue

@@ -12,8 +12,8 @@
     </div>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="未上报" name="first">
-        <dilTable v-bind.sync="option">
-          <el-table-column fixed="right" label="操作" align="center" width="150">
+        <dilTable v-bind.sync="option" ref="table3">
+          <el-table-column fixed="right" label="操作" align="center" width="200">
             <template slot-scope="scope">
               <el-button
                 @click="uploadclick(scope.row.saleOrderId)"
@@ -33,17 +33,76 @@
                 @click="deleteclick(scope.row.saleOrderId)"
                 >删除</el-button
               >
+              <el-button
+                @click="detailclick3(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="tableData3" 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-tab-pane label="已上报" name="second">
-        <dilTable v-bind.sync="option2"> </dilTable>
+        <dilTable v-bind.sync="option2" ref="table2">
+        <el-table-column fixed="right" label="操作" width="70">
+            <template slot-scope="scope">
+              <el-button
+                @click="detailclick2(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="tableData2" 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-tab-pane label="财务已审批" name="third">
-        <dilTable v-bind.sync="option3">
+        <dilTable v-bind.sync="option3" ref="table1">
           <el-table-column fixed="right" label="操作" width="200">
             <template slot-scope="scope">
               <el-button
@@ -58,13 +117,40 @@
                 size="small"
                 >修改日志</el-button
               >
+              <el-button
+                @click="detailclick1(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="tableData1" 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-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 +160,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 +220,52 @@ export default {
           "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409",
       },
       
+      //记录旧的row对象 (销售公司已审批)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (销售公司已审批)
+      oldRowCount: 1,
+      //记录旧的row对象 (财务已审批)
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (财务已审批)
+      oldRowCount1: 1,
+      //记录旧的row对象 (已上报)
+      oldRow2: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (已上报)
+      oldRowCount2: 1,
+      //记录旧的row对象 (未上报)
+      oldRow3: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (未上报)
+      oldRowCount3: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop: "specificationModel",
+          label: "规格型号",
+          width: 150,
+        },
+        {
+          prop: "materialNumber",
+          label: "物资件数",
+          width: 100,
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 100,
+        },
+      ],
+      //(销售公司已审批)
+      tableData: [],
+      //(财务已审批)
+      tableData1: [],
+      //(已上报)
+      tableData2: [],
+      //(未上报)
+      tableData3: [],
     };
   },
   methods: {
@@ -136,9 +288,133 @@ 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;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData = res.data.data;
+        });
+    },
+
+    // -------查看物资详情 (财务已审批)
+    detailclick1(row) {
+      // 记录重复点击次数
+      if (this.oldRow1 === row) {
+        this.oldRowCount1 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table1.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow1 != "") {
+        if (this.oldRow1 != row) {
+          if (this.oldRowCount1 % 2 === 1) {
+            this.$refs.table1.toggleRowExpansion(this.oldRow1);
+          } else {
+            this.oldRowCount1 = 1;
+          }
+        } else {
+          this.oldRow1 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow1 = row;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData1 = res.data.data;
+        });
+    },
+
+    // -------查看物资详情 (已上报)
+    detailclick2(row) {
+      // 记录重复点击次数
+      if (this.oldRow2 === row) {
+        this.oldRowCount2 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table2.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow2 != "") {
+        if (this.oldRow2 != row) {
+          if (this.oldRowCount2 % 2 === 1) {
+            this.$refs.table2.toggleRowExpansion(this.oldRow2);
+          } else {
+            this.oldRowCount2 = 1;
+          }
+        } else {
+          this.oldRow2 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow2 = row;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData2 = res.data.data;
+        });
     },
+
+    // -------查看物资详情 (未上报)
+    detailclick3(row) {
+      // 记录重复点击次数
+      if (this.oldRow3 === row) {
+        this.oldRowCount3 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table3.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow3 != "") {
+        if (this.oldRow3 != row) {
+          if (this.oldRowCount3 % 2 === 1) {
+            this.$refs.table3.toggleRowExpansion(this.oldRow3);
+          } else {
+            this.oldRowCount3 = 1;
+          }
+        } else {
+          this.oldRow3 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow3 = row;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData3 = res.data.data;
+        });
+    },
+
     // 上传
     uploadclick(saleOrderId) {
       this.$confirm("是否上传", "提示", {

+ 133 - 45
src/views/appoint/components/saleContract/saleOrderArrange.vue

@@ -13,10 +13,10 @@
     </div>
     <template>
       <div>
-        <dilTable v-bind.sync="first" @selection-change="selectionChange">
-            <el-table-column fixed="right" label="操作" width="150">
-                <template slot-scope="scope">
-                <el-button
+        <dilTable v-bind.sync="first" @selection-change="selectionChange" ref="table">
+          <el-table-column fixed="right" label="操作" width="200">
+            <template slot-scope="scope">
+              <el-button
                 @click="lookclick(scope.row.saleOrderId)"
                 type="text"
                 size="small"
@@ -28,8 +28,33 @@
                 size="small"
                 >修改日志</el-button
               >
-                </template>
-            </el-table-column>
+              <el-button
+                @click="materialclick(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>
       </div>
     </template>
@@ -47,51 +72,79 @@ export default {
         mapList: [],
       },
       activeName: "first",
+      //记录旧的row对象
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态
+      oldRowCount: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop: "specificationModel",
+          label: "规格型号",
+          width: 150,
+        },
+        {
+          prop: "materialNumber",
+          label: "物资件数",
+          width: 100,
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 100,
+        },
+      ],
+      tableData: [],
     };
+    
   },
   methods: {
-    Issue(){
-    if(this.first.mapList.length==0){
-      this.$message({
-            type: "warning",
-            message: "请先选择订单!",
-          });
-    }else{
-    this.$confirm("是否下发", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
-      })
-      .then(() => {
-      //初始化maplist
-      var mapList = [];
-      this.first.mapList.forEach((item,i) => {
-        //初始化mapItem
-        var mapItem={
-                //销售订单物资中间表id
-                saleOrderMaterialId : 0,
-            };
-        mapItem.saleOrderMaterialId=item.saleOrderMaterialId;
-        mapList.push(mapItem);
-      });
-          this.$message({
-            type: "success",
-            message: "下发成功!",
-          });
-         this.axios.post("/api/v1/ams/issueTruckNo", mapList).then((res) => {
-          if (res.data.code == "200") {
-            this.$router.go(0);
-          }
+    Issue() {
+      if (this.first.mapList.length == 0) {
+        this.$message({
+          type: "warning",
+          message: "请先选择订单!",
         });
+      } else {
+        this.$confirm("是否下发", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          center: true,
         })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "取消上传!",
+          .then(() => {
+            //初始化maplist
+            var mapList = [];
+            this.first.mapList.forEach((item, i) => {
+              //初始化mapItem
+              var mapItem = {
+                //销售订单物资中间表id
+                saleOrderMaterialId: 0,
+              };
+              mapItem.saleOrderMaterialId = item.saleOrderMaterialId;
+              mapList.push(mapItem);
+            });
+            this.$message({
+              type: "success",
+              message: "下发成功!",
+            });
+            this.axios.post("/api/v1/ams/issueTruckNo", mapList).then((res) => {
+              if (res.data.code == "200") {
+                this.$router.go(0);
+              }
+            });
+          })
+          .catch(() => {
+            this.$message({
+              type: "info",
+              message: "取消上传!",
+            });
           });
-        });
-    }
+      }
     },
     lookclick(saleOrderId) {
       this.$router.push("/saleOrderDetailApproved/" + saleOrderId);
@@ -99,6 +152,41 @@ export default {
     passclick(saleOrderId) {
       this.$router.push("/saleOrderUpdateLog/" + saleOrderId);
     },
+    materialclick(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.saleOrderMaterialId);
+    },
+    // 根据车序号id查询物资信息
+    getMaterial(saleOrderMaterialId) {
+      this.axios
+        .post(
+          "/api/v1/ams/getTruckNoMaterialList?saleOrderMaterialId=" +
+            saleOrderMaterialId
+        )
+        .then((res) => {
+          this.tableData = res.data.data;
+        });
+    },
     selectionChange(selection) {
       this.first.mapList = selection;
     },

+ 159 - 45
src/views/sale/components/transport_appointment/directionalDispatch.vue

@@ -20,11 +20,42 @@
       <div>
         <el-tabs v-model="activeName">
           <el-tab-pane label="未下发" name="first">
-            <dilTable v-bind.sync="first" @selection-change="selectionChange">
+            <dilTable v-bind.sync="first" ref="table" @selection-change="selectionChange">
+
+              <el-table-column fixed="right" label="操作" width="70">
+            <template slot-scope="scope">
+              <el-button
+                @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-tab-pane label="已下发" name="second">
-            <dilTable v-bind.sync="second">
+            <dilTable v-bind.sync="second" ref="table1">
               <el-table-column fixed="right" label="操作" width="100">
                 <template slot-scope="scope">
                   <el-button
@@ -33,8 +64,35 @@
                     size="small"
                     >公开</el-button
                   >
+                  <el-button
+                    @click="detailclick1(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="tableData1" 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>
@@ -89,6 +147,38 @@ export default {
         mapList: [],
       },
 
+      //记录旧的row对象(未下发)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未下发)
+      oldRowCount: 1,
+      //记录旧的row对象(已下发)
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(已下发)
+      oldRowCount1: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop: "specificationModel",
+          label: "规格型号",
+          width: 150,
+        },
+        {
+          prop: "materialNumber",
+          label: "物资数量(件数/重量)",
+          width: 150,
+        },
+        // {
+        //   prop: "materialWeight",
+        //   label: "物资重量",
+        //   width: 100,
+        // },
+      ],
+      tableData: [],
+      tableData1: [],
     };
   },
   methods: {
@@ -139,6 +229,7 @@ export default {
     //监听模态框点击事件
     currentRadioChange1(row) {
       this.carrierId = row.carrierId;
+      console.log("this.carrierId",this.carrierId)
     },
     //模糊查询承运商
     onclick(){
@@ -183,49 +274,72 @@ export default {
       }
       
     },
-    // Issue() {
-    //   console.log();
-    //   if (this.first.mapList.length !== 0) {
-    //     this.$confirm("是否下发", "提示", {
-    //       confirmButtonText: "确定",
-    //       cancelButtonText: "取消",
-    //       type: "warning",
-    //       center: true,
-    //     })
-    //       .then(() => {
-    //         this.axios
-    //           .post(
-    //             "/api/v1/ams/addFixedAmsDispatchSaleOrder",
-    //             this.first.mapList
-    //           )
-    //           .then((res) => {
-    //             if (res.data.code == "200") {
-    //               this.$message({
-    //                 type: "success",
-    //                 message: "下发成功!",
-    //               });
-		// 		  this.$router.go(0)
-    //             } else {
-    //               this.$message({
-    //                 message: "下发失败",
-    //                 type: "warning",
-    //               });
-    //             }
-    //           });
-    //       })
-    //       .catch(() => {
-    //         this.$message({
-    //           type: "info",
-    //           message: "取消下发!",
-    //         });
-    //       });
-    //   } else {
-    //     this.$message({
-    //       type: "warning",
-    //       message: "请选择订单后再下发!",
-    //     });
-    //   }
-    // },
+
+    // -------查看物资详情(未下发)
+    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.saleOrderMaterialId);
+    },
+    // 根据销售订单物资中间表id查询物资信息
+    getMaterial(saleOrderMaterialId) {
+      this.axios
+        .post("/api/v1/ams/getTruckNoMaterialList?saleOrderMaterialId=" +saleOrderMaterialId)
+        .then((res) => {
+          this.tableData = res.data.data;
+        });
+    },
+    // --------查看物资详情(已下发)
+    detailclick1(row) {
+      // 记录重复点击次数
+      if (this.oldRow1 === row) {
+        this.oldRowCount1 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table1.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow1 != "") {
+        if (this.oldRow1 != row) {
+          if (this.oldRowCount1 % 2 === 1) {
+            this.$refs.table1.toggleRowExpansion(this.oldRow1);
+          } else {
+            this.oldRowCount1 = 1;
+          }
+        } else {
+          this.oldRow1 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow1 = row;
+      //根据销售订单物资中间表id查询物资信息
+
+      this.axios
+        .post("/api/v1/ams/getDispatchMaterialList?dispatchId=" +row.dispatchId)
+        .then((res) => {
+          this.tableData1 = res.data.data;
+        });
+    },
+
   },
 };
 </script>

+ 170 - 14
src/views/sale/components/transport_appointment/openDistribution.vue

@@ -14,24 +14,50 @@
     <div class="table">
       <el-tabs v-model="activeName" @tab-click="handleClick">
       <!-- 未抢单 -->
-      	<el-tab-pane label="未接收" name="first">
-						  <dilTable v-bind.sync="first">
-             <el-table-column fixed="right" label="操作" width="50">
+      	<el-tab-pane label="未接收" name="first" >
+						  <dilTable v-bind.sync="first" ref="table">
+             <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
           <el-button @click="Grab(scope)" type="text" size="small">
             接收
           </el-button>
+          <el-button @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-tab-pane label="已接收" name="second">
 				<dilTable v-bind.sync="second">
-          <el-table-column fixed="right" label="操作" width="50">
+          <el-table-column fixed="right" label="操作" width="120">
             <template slot-scope="scope">
           <el-button @click="dispatch(scope)  " type="text" size="small">
-            <!-- ,handleBtnClick1() -->
             派单
+          </el-button>
+          <el-button @click="detailclick1(scope.row)" type="text" size="small">
+            物资详情
           </el-button>
             </template>
       </el-table-column>
@@ -55,10 +81,12 @@
 </template>
 
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
   data(){
     return{
       drawer: false,
+      ssoId:null,
 			direction: 'rtl',
       activeName: "first",
       inputText:"",
@@ -66,29 +94,85 @@ export default {
       input:"",
       first:{
         // first请求数据的地址
-        requestUrl: "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0",
+        requestUrl: "",
       },
       second:{
-        requestUrl:"/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierId=73",
+        requestUrl:"",
       },
       third:{
         requestUrl:"/api/v1/oms/getCapacityAndDriverList?apiId=246",
         selectionType: "radio",
 				mapList: []      
-      }
+      },
+      //记录旧的row对象(未接收)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未接收)
+      oldRowCount: 1,
+      //记录旧的row对象(已接收)
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(已接收)
+      oldRowCount1: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop: "specificationModel",
+          label: "规格型号",
+          width: 150,
+        },
+        {
+          prop: "materialNumber",
+          label: "物资件数",
+          width: 100,
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 100,
+        },
+      ],
+      tableData: [],
+      tableData1: [],
     }
   },
+  created(){
+      this.firstGetRequestUrl();
+      this.secondGetRequestUrl();
+  },
   methods:{
       handleClick(tab, event) {
       console.log(tab, event);
+    },
+    firstGetRequestUrl(){
+    if(getCookie("orgCode") == "chengyunshang"){
+      console.log("enter",getCookie('userId'))
+      this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId="+ getCookie('userId');
+    }else{
+      console.log("out",this.ssoId)
+     this.first.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&dispatchType=0&carrierSsoId=" + this.ssoId;
+    }
+
+    },
+    secondGetRequestUrl(){
+    if(getCookie("orgCode") == "chengyunshang"){
+      console.log("enter",getCookie('userId'))
+      this.second.requestUrl = "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierSsoId="+ getCookie('userId');
+    }else{
+            console.log("out",this.ssoId)
+     this.second.requestUrl = "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierSsoId=" + this.ssoId;
+    }
+
     },
     onclick1(){
-       if(this.activeName == "first"){
-        this.option1.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&con=" + this.input;
-      }else if
+       if(this.activeName == "first"){
+         this.option1.requestUrl = "/api/v1/ams/getPCDispatchSaleOrderList?apiId=242&con=" + this.input;
+      }else if
         (this.activeName == "second"){
-        this.option2.requestUrl = "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierId=1&con=" + this.input;
-      }
+        this.option2.requestUrl = "/api/v1/ams/selectDispatchSaleOrderList?apiId=233&carrierId=1&con=" + this.input;
+    }
     },
     dispatch(scope){
       this.dispatchId = scope.row.dispatchId
@@ -148,8 +232,14 @@ export default {
         center: true,
       })
         .then(() => {
+          var carrierSsoId = '';
+          if(getCookie("orgCode") == "chengyunshang"){
+            carrierSsoId =  getCookie('userId');
+          }else{
+            carrierSsoId = null;
+          }
           this.axios
-            .post("/api/v1/ams/lockDispatchSaleOrder?dispatchId="+ scope.row.dispatchId+"&carrierId=" + 73)
+            .post("/api/v1/ams/lockDispatchSaleOrder?dispatchId="+ scope.row.dispatchId+"&carrierSsoId=" + carrierSsoId)
             .then((res) => {
               if (res.data.code == 200) {
                 this.$message({
@@ -172,6 +262,72 @@ export default {
           });
         });
     },
+
+    // -------查看物资详情(未接收)
+    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.dispatchId);
+    },
+    // 根据销售订单物资中间表id查询物资信息
+    getMaterial(dispatchId) {
+      this.axios
+        .post("/api/v1/ams/getDispatchMaterialList?dispatchId=" +dispatchId)
+        .then((res) => {
+          this.tableData = res.data.data;
+        });
+    },
+
+    // -------查看物资详情(已接收)
+    detailclick1(row) {
+      // 记录重复点击次数
+      if (this.oldRow1 === row) {
+        this.oldRowCount1 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table1.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow1 != "") {
+        if (this.oldRow1 != row) {
+          if (this.oldRowCount1 % 2 === 1) {
+            this.$refs.table1.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount1 = 1;
+          }
+        } else {
+          this.oldRow1 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow1 = row;
+      // 根据销售订单物资中间表id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getDispatchMaterialList?dispatchId=" +dispatchId)
+        .then((res) => {
+          this.tableData1 = res.data.data;
+        });
+    },
+
   }
 }
 </script>

+ 5 - 0
src/views/sale/components/transport_excute/enFactoryResult.vue

@@ -70,6 +70,11 @@ export default {
           label: "物资件数",
           width: 100,
         },
+        {
+          prop: "orderMaterialWeight",
+          label: "物资重量",
+          width: 100,
+        },
       ],
       tableData: [],
     };

+ 5 - 0
src/views/sale/components/transport_excute/outFactory/outFactoryResult.vue

@@ -70,6 +70,11 @@ export default {
           label: "物资件数",
           width: 100,
         },
+        {
+          prop: "orderMaterialWeight",
+          label: "物资重量",
+          width: 100,
+        },
       ],
       tableData: [],
     };

+ 95 - 2
src/views/sale/components/transport_order/receiveOrder.vue

@@ -11,14 +11,43 @@
 		<template>
 			<div>
 				<el-tabs v-model="activeName" @tab-click="handleClick">
+					<!-- 已接收 -->
 					<el-tab-pane label="已接收" name="first">
-						<dilTable v-bind.sync="first" >
+						<dilTable v-bind.sync="first" ref="table">
+							<el-table-column fixed="right" label="操作" width="50">
+								<template slot-scope="scope">
+								<el-button @click="detailclick1(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-tab-pane label="已拒绝" name="second">
 						<dilTable v-bind.sync="second">
 						</dilTable>
 					</el-tab-pane>
+					<!-- 未接收 -->
 					<el-tab-pane label="未接收" name="third">
 						<dilTable v-bind.sync="third">
 						</dilTable>
@@ -47,6 +76,37 @@
 					requestUrl: "/api/v1/oms/getDriverInfoForSale?apiId=226&orderType=1&orderStatus=4&carrierId=73",
 				},
 				activeName: "first",
+				//记录旧的row对象(未接收)
+				oldRow: "",
+				//记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(未接收)
+				oldRowCount: 1,
+				//记录旧的row对象(已接收)
+				oldRow1: "",
+				//记录上一个展开的点击次数,单数为展开状态,复数为闭合状态(已接收)
+				oldRowCount1: 1,
+				tableHead: [
+					{
+					prop: "materialName",
+					label: "物资名称",
+					width: 150,
+					},
+					{
+					prop: "specificationModel",
+					label: "规格型号",
+					width: 150,
+					},
+					{
+					prop: "materialNumber",
+					label: "物资件数",
+					width: 100,
+					},
+					{
+					prop: "materialWeight",
+					label: "物资重量",
+					width: 100,
+					},
+				],
+				tableData: [],
 			}
 		},
 		methods: {
@@ -60,7 +120,40 @@
 		  }
         
       
-		 }
+		 },
+		// -------查看物资详情(未接收)
+		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.dispatchId);
+		},
+		// 根据销售订单物资中间表id查询物资信息
+		getMaterial(dispatchId) {
+		this.axios
+			.post("/api/v1/ams/getDispatchMaterialList?dispatchId=" +dispatchId)
+			.then((res) => {
+			this.tableData = res.data.data;
+			});
+		},
 		 }
 	}
 </script>