ソースを参照

提交陆运等国内贸易

caojunjie 3 年 前
コミット
ce93d5b277

+ 5 - 1
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -877,7 +877,11 @@ export default {
     flowDialog
   },
   created() {
-    this.initData(website.tenantId);
+    if (!website.tenantMode) {
+      this.initData(website.tenantId);
+    }else {
+      this.initData();
+    }
     if (this.$store.getters.userInfo.tenant_id === "096359") {
       let list = ["profitReturn", "usedProfit", "surplusProfit", "monthProfit"];
       for (let item in list) {

+ 151 - 2
src/views/basicData/fleetInformation/detailsPageEdit.vue

@@ -222,7 +222,17 @@
             @row-save="rowSave"
             @row-update="rowUpdate"
             @row-del="rowDel"
-          ></avue-crud>
+          >
+            <template slot-scope="{ type, size, row }" slot="menu">
+              <el-button
+                  icon="el-icon-check"
+                  :size="size"
+                  :type="type"
+                  @click="creatingUsers(row)"
+              >创建用户</el-button
+              >
+            </template>
+          </avue-crud>
         </basic-container>
         <!-- <containerTitle title="客户优势项目"></containerTitle>
         <basic-container style="margin-bottom: 10px">
@@ -275,6 +285,21 @@
     <el-button type="primary" @click="confirmSynchronization">确 定</el-button>
   </span>
     </el-dialog>
+    <el-dialog
+        title="创建用户"
+        :visible.sync="dialogVisibleBt"
+        append-to-body
+        width="60%"
+    >
+      <avue-form ref="formDataTwo" v-model="formDataTwo" :option="optionData">
+      </avue-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleBt = false">取 消</el-button>
+        <el-button type="primary" @click="confirmSynchronizationTwo"
+        >确 定</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -290,7 +315,7 @@ import {
   corpsfiles,
   corpsitem,
   areaTypeTree,
-  corpsAddrDelete,synchronizationCopy
+  corpsAddrDelete, synchronizationCopy, creatingUsers
 } from "@/api/basicData/customerInformation";
 import customerContact from "./configuration/customerContact.json";
 import advantageProject from "./configuration/advantageProject.json";
@@ -299,11 +324,80 @@ import flowDialog from "@/components/flow-dialog/main";
 import { CDParameter } from "@/enums/management-type";
 import { gainUser } from "@/api/basicData/customerInquiry";
 import addressOption from "./configuration/addressOption.json";
+import website from "@/config/website";
+import {getRoleTree} from "@/api/system/role";
+import {getDeptTree} from "@/api/system/dept";
+import {getPostList} from "@/api/system/post";
 
 export default {
   name: "detailsPage",
   data() {
     return {
+      dialogVisibleBt:false,
+      formDataTwo:{},
+      formRow:{},
+      optionData: {
+        span: 8,
+        menuBtn: false,
+        column: [
+          {
+            label: "所属角色",
+            prop: "roleId",
+            multiple: true,
+            type: "tree",
+            dicData: [],
+            props: {
+              label: "title"
+            },
+            checkStrictly: true,
+            slot: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择所属角色",
+                trigger: "click"
+              }
+            ]
+          },
+          {
+            label: "所属部门",
+            prop: "deptId",
+            type: "tree",
+            multiple: true,
+            dicData: [],
+            props: {
+              label: "title"
+            },
+            checkStrictly: true,
+            slot: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择所属部门",
+                trigger: "click"
+              }
+            ]
+          },
+          {
+            label: "所属岗位",
+            prop: "postId",
+            type: "tree",
+            multiple: true,
+            dicData: [],
+            props: {
+              label: "postName",
+              value: "id"
+            },
+            rules: [
+              {
+                required: true,
+                message: "请选择所属岗位",
+                trigger: "click"
+              }
+            ]
+          }
+        ]
+      },
       userList: [],
       creditRatingList:[],
       formData:{},
@@ -778,6 +872,11 @@ export default {
     flowDialog
   },
   created() {
+    if (!website.tenantMode) {
+      this.initData(website.tenantId);
+    }else {
+      this.initData();
+    }
     if (this.$store.getters.userInfo.tenant_id === "096359") {
       let list = ["profitReturn", "usedProfit", "surplusProfit", "monthProfit"];
       for (let item in list) {
@@ -829,6 +928,56 @@ export default {
     });
   },
   methods: {
+    initData(tenantId) {
+      getRoleTree(tenantId).then(res => {
+        const column = this.findObject(this.optionData.column, "roleId");
+        column.dicData = res.data.data;
+      });
+      getDeptTree(tenantId).then(res => {
+        const column = this.findObject(this.optionData.column, "deptId");
+        column.dicData = res.data.data;
+      });
+      getPostList(tenantId).then(res => {
+        const column = this.findObject(this.optionData.column, "postId");
+        column.dicData = res.data.data;
+      });
+    },
+    //确认创建用户
+    confirmSynchronizationTwo() {
+      this.$refs["formDataTwo"].validate((valid, done) => {
+        done();
+        if (valid) {
+          let data = JSON.parse(JSON.stringify(this.formDataTwo));
+          data.deptId = data.deptId.join(",");
+          data.roleId = data.roleId.join(",");
+          data.postId = data.postId.join(",");
+          creatingUsers({
+            ...data,
+            id: this.formRow.id
+          }).then(res => {
+            this.dialogVisibleBt = false;
+            this.$message.success(
+                "创建用户成功,默认帐号:联系人名称。默认密码:123456"
+            );
+          });
+        } else {
+          return false;
+        }
+      });
+    },
+    creatingUsers(row) {
+      if (row.id) {
+        if (row.tel) {
+          this.dialogVisibleBt = true;
+          this.formDataTwo = {};
+          this.formRow = row;
+        } else {
+          this.$message.error("请输入手机号");
+        }
+      } else {
+        this.$message.error("请保存数据后再点击");
+      }
+    },
     //新增客户联系人保存触发
     rowSave(row, done, loading) {
       console.log(row, done, loading);

+ 1 - 1
src/views/businessManagement/receipt/configuration/mainList.json

@@ -43,7 +43,7 @@
     },
     {
       "label": "采购订单号",
-      "prop": "srcOrderNo",
+      "prop": "orderNo",
       "search": true,
       "index": 1,
       "width": 100,

+ 25 - 2
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -2144,7 +2144,8 @@ export default {
         this.dataPolicy = res.data.list? [...res.data.list]: [];
         this.policyIndex++;
       } else {
-        this.dataPolicy = res.data.list? res.data.list: [];
+        this.dataPolicy = res.data.list? [...res.data.list]: [];
+        this.policyIndex++;
         this.$message.error(res.data.message);
       }
     },
@@ -2709,8 +2710,10 @@ export default {
       // })
       if (this.policyData.length > 0) {
         this.customerBuyFree.selection = false
+        this.customerBuyFree.menu = false
       } else {
         this.customerBuyFree.selection = true
+        this.customerBuyFree.menu = true
       }
     },
     //销售政策买赠促销选中触发
@@ -2721,13 +2724,33 @@ export default {
       // })
       if (this.policyDataTwo.length > 0) {
         this.optionPolicy.selection = false
+        this.optionPolicy.menu = false
       } else {
         this.optionPolicy.selection = true
+        this.optionPolicy.menu = true
       }
     },
+    //匹配id去重
+    deWeightFour(arr) {
+      let arrTemp = [];
+      arr = arr.reduce(function (a, b) {
+        if ( arrTemp.indexOf(b.id+b.id)==-1 ) {
+          a.push(b)
+          arrTemp.push(b.id+b.id)
+        }
+        return a
+      }, [])
+      return arr
+    },
     //导入商品政策
     importPolicy() {
-      let list = this.deepClone(this.policyData.concat(this.policyDataTwo).concat(this.goodsListPolicy).concat(this.buyAndGiveList))
+      let list = []
+      if (this.buyAndGiveList.length > 0 || this.goodsListPolicy > 0){
+        list = this.deepClone(this.buyAndGiveList.concat(this.goodsListPolicy))
+      }else {
+        list = this.deepClone(this.policyData.concat(this.policyDataTwo))
+      }
+      // list = this.deWeightFour(list)
       let listLength = this.policyDataTwo.length + this.buyAndGiveList.length
       // 买赠额外加一条
       let buyFree = []

+ 1 - 1
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -193,7 +193,7 @@
         <template slot="headerSerial" slot-scope="{column}">
           <el-tooltip class="item" effect="dark" content="录入明细" placement="top">
             <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
-                       @click="$refs.crudBox.rowCellAdd({arrivalTime:new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 14)+'00:00',landAmountD:0})"></el-button>
+                       @click="$refs.crudBox.rowCellAdd({arrivalTime:new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 14)+'00:00',landAmountD:0,landWeight:0})"></el-button>
           </el-tooltip>
         </template>
         <template slot="ctnTypeHeader" slot-scope="{column}">

+ 51 - 78
src/views/wel/home/landTransportation/components/sales-trend.vue

@@ -2,20 +2,9 @@
   <div class="home-container">
     <el-card class="home-container__card">
       <div>
-<!--        <div class="title">-->
-<!--          <span>-->
-<!--            今日业务详情(集装箱)-->
-<!--          </span>-->
-<!--          <span>-->
-<!--            <i-->
-<!--                class="el-icon-refresh-right"-->
-<!--                style="cursor: pointer;font-size:20px"-->
-<!--                @click="refresh"-->
-<!--            ></i>-->
-<!--          </span>-->
-<!--        </div>-->
         <div class="content" v-loading="loading">
-          <avue-crud :data="tableData" :option="option" :key="key" ref="crud" @refresh-change="refresh" @resetColumn="resetColumn"
+          <avue-crud :data="tableData" :option="option" :key="key" ref="crud" @refresh-change="refresh"
+                     @resetColumn="resetColumn"
                      @saveColumn="saveColumn">
             <template slot="menuLeft">
               <span>今日业务详情(集装箱)</span>
@@ -55,20 +44,6 @@
         lock-scroll
         width="80%">
       <div id="container"></div>
-      <div class="input-card" style="right: 10.3%;bottom: 10.3%" v-if="this.lineArr.length>0">
-        <h4>轨迹回放控制</h4>
-        <div class="input-item">
-          <input type="button" class="btn" value="开始动画" id="start" @click="startAnimation()"/>
-          <input type="button" class="btn" value="暂停动画" id="pause" @click="pauseAnimation()"/>
-        </div>
-        <div class="input-item">
-          <input type="button" class="btn" value="继续动画" id="resume" @click="resumeAnimation()"/>
-          <input type="button" class="btn" value="停止动画" id="stop" @click="stopAnimation()"/>
-        </div>
-      </div>
-      <div class="input-card" style="right: 10.3%;bottom: 10.3%" v-else>
-        <span style="color: red">暂无该车辆轨迹信息</span>
-      </div>
     </el-dialog>
   </div>
 </template>
@@ -90,6 +65,7 @@ export default {
       loading: false,
       tableData: [],
       map: null,
+      infoWindow: null,
       marker: null,
       lineArr: [],
       key: 0,
@@ -283,25 +259,34 @@ export default {
           query: {id: row.orderId},
         });
       } else {
-        gaude({itemId: row.id, plateNo: row.plateNo, tenantId: '234557'}).then(res => {
-          this.lineArr = res.data.data
+        // gaude({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557',color:'2'}).then(res => {
+        //   this.lineArr = res.data.data
+        //   this.dialogVisible = true
+        //   let this_ = this
+        //   setTimeout(function () {
+        //     this_.initMap();
+        //   }, 100)
+        // })
+        location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
+          console.log(res.data.data)
+          console.log(this.lineArr[this.lineArr.length - 1])
           this.dialogVisible = true
           let this_ = this
           setTimeout(function () {
-            this_.initMap();
-          }, 100)
+            this_.initMap(res.data.data, row.plateNo);
+          }, 1000)
         })
-        // location({itemId: row.id,plateNo:'陕YH0008'}).then(res => {
-        //   // console.log(res.data.data)
-        //   // console.log(this.lineArr[this.lineArr.length - 1])
-        // })
       }
     },
-    initMap() {
-      this.map = new AMap.Map("container", {
-        resizeEnable: true,
-        center: this.lineArr.length > 0 ? this.lineArr[this.lineArr.length - 1] : [120.382891, 36.066460],
-        zoom: 17
+    markerClick(e) {
+      this.infoWindow.setContent(e.target.content);
+      this.infoWindow.open(this.map, e.target.getPosition());
+    },
+    initMap(data, plateNo) {
+      this.map = new AMap.Map("container", {resizeEnable: true});
+      this.infoWindow = new AMap.InfoWindow({
+        ffset: new AMap.Pixel(0, -30),
+        offset: new AMap.Pixel(0, -30)
       });
       let icon = new AMap.Icon({
         size: new AMap.Size(52, 26), // 图标尺寸
@@ -309,53 +294,33 @@ export default {
         imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
       });
       this.marker = new AMap.Marker({
+        position: data.location,
         map: this.map,
-        position: this.lineArr.length > 0 ? this.lineArr[this.lineArr.length - 1] : [120.382891, 36.066460],
-        // icon: "https://webapi.amap.com/images/car.png",
         icon: icon,
         markerMeta: new AMap.Size(28, 28),
         offset: new AMap.Pixel(-26, -15),
         autoRotation: true,
         angle: -15
       });
-      // 绘制轨迹
-      let polyline = new AMap.Polyline({
-        map: this.map,
-        path: this.lineArr,
-        showDir: true,
-        strokeColor: "#28F", //线颜色
-        // strokeOpacity: 1,     //线透明度
-        strokeWeight: 6 //线宽
-        // strokeStyle: "solid"  //线样式
-      });
-
-      let passedPolyline = new AMap.Polyline({
-        map: this.map,
-        path: this.lineArr,
-        strokeColor: "#AF5", //线颜色
-        // strokeOpacity: 1,     //线透明度
-        strokeWeight: 6 //线宽
-        // strokeStyle: "solid"  //线样式
-      });
-
-      this.marker.on("moving", function (e) {
-        passedPolyline.setPath(e.passedPath);
-      });
-
+      this.marker.content = '<div style="width: 300px;">'
+          + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' + plateNo + '</p>'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">最后上报时间:</span>' + new Date(Number(data.time) + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19) + '</p>'
+          + '<div style="width: 150px;float: left;">'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span></p>'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">今日里程:</span>' + (data.distance.length > 0 ? data.distance : 0) + '</p>'
+          + '</div>'
+          + '<div style="width: 150px;float: right;">'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + '</p>'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">总里程:</span>' + data.mileage + '</p>'
+          + '</div>'
+          + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
+          + '</div>'
+      this.infoWindow.open(this.map, this.map.getCenter());
+      this.marker.on('click', this.markerClick);
+      this.marker.emit('click', {target: this.marker});
       this.map.setFitView();
     },
-    startAnimation() {
-      this.marker.moveAlong(this.lineArr, 100000);
-    },
-    pauseAnimation() {
-      this.marker.pauseMove();
-    },
-    resumeAnimation() {
-      this.marker.resumeMove();
-    },
-    stopAnimation() {
-      this.marker.stopMove();
-    },
     init() {
       this.getsalesTrend();
     },
@@ -429,4 +394,12 @@ export default {
 ::v-deep .el-dialog__body {
   padding: 0 20px 10px 20px !important;
 }
+
+::v-deep .amap-info-close{
+  right: 10px!important;
+  top: 12px !important;
+}
+::v-deep .amap-info-content{
+  padding: 5px 5px 5px 5px !important;
+}
 </style>