Jelajahi Sumber

销售公司关单

xiaosonghong 1 bulan lalu
induk
melakukan
74b165d1da

+ 845 - 0
src/views/ADMINISTRATORS/components/ADMINISTRATORS2.vue

@@ -0,0 +1,845 @@
+// 采购内转需求
+<template>
+  <div class="admin">
+    <template>
+      <div class="admin1">
+        <el-tabs v-model="activeName" tab-position="left">
+          <el-tab-pane label="运输订单关闭接口" name="first">
+            <div class="admin2">
+              <div class="carrier from">
+                <el-form
+                  :inline="true"
+                  class="demo-form-inline"
+                  label-width="80px"
+                >
+                  <el-form-item label="车牌号:">
+                    <el-autocomplete
+                      class="inline-input"
+                      v-model="capacityName"
+                      :fetch-suggestions="querySearchCapacity"
+                      placeholder="车牌号"
+                      :trigger-on-focus="false"
+                      @select="handleSelectCapacity"
+                    >
+                      <template slot-scope="{ item }">
+                        <div class="name">{{ item.capacityNumber }}</div>
+                      </template>
+                    </el-autocomplete>
+                  </el-form-item>
+                </el-form>
+              </div>
+              <div class="poundNo from">
+                <span class="text">运输订单号:</span>
+                <el-input v-model="orderNumber"></el-input>
+              </div>
+              <div class="button_box">
+                <el-button
+                  type="primary"
+                  @click="updateOrderStatus"
+                  :disabled="disabled"
+                  >确认</el-button
+                >
+              </div>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
+    </template>
+  </div>
+</template>
+<script>
+import { toDateString, toDateNo, toDateStringDay } from '../app.js'
+import { jsonStrToMap } from '@/utils/sharedJsFile'
+import { getCookie } from '@/utils/util.js'
+
+export default {
+  data() {
+    return {
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() > Date.now()
+        },
+        shortcuts: [
+          {
+            text: '今天',
+            onClick(picker) {
+              picker.$emit('pick', new Date())
+            }
+          },
+          {
+            text: '昨天',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(date.getTime() - 3600 * 1000 * 24)
+              picker.$emit('pick', date)
+            }
+          },
+          {
+            text: '一周前',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
+              picker.$emit('pick', date)
+            }
+          },
+          {
+            text: '元年',
+            onClick(picker) {
+              const date = new Date()
+              date.setTime(0)
+              picker.$emit('pick', date)
+            }
+          }
+        ]
+      },
+      startTime: null,
+      saleLog: '',
+      options: [
+        {
+          label: '计量传输物流实绩',
+          value: '计量传输物流实绩'
+        },
+        {
+          label: '委托发送报文',
+          value: '委托发送报文'
+        },
+        {
+          label: '物流金蝶订单操作',
+          value: '物流金蝶订单操作'
+        },
+        {
+          label: '金蝶通讯报文',
+          value: '金蝶通讯报文'
+        }
+      ],
+      serverName: '',
+      orderNumber: null,
+      first: true,
+      second: true,
+      activeName: 'first',
+      capacityName: null,
+      stateCapacity: null,
+      materialList: [],
+      capacityId: null,
+      materialId: null,
+      value1: null,
+      value2: null,
+      disabled: false,
+      orderId: null,
+      firstWeight: null,
+      secondWeight: null,
+      netWeight: null,
+      poundNo: null,
+      truckCalFirstList: [],
+      truckCalSecondList: [],
+      truckCalFirst: null,
+      truckCalSecond: null,
+      switchValue: true,
+      truckCalFirstNum: null,
+      truckCalSecondNum: null,
+      lineQuence: null,
+      gatePostList: [],
+      enFactoryGatepost: null,
+      gatePostId: null,
+      orderStatus: null,
+      loadDetail: {},
+      jsonStringValue: '',
+      transferMap: {},
+      transferList: [],
+      orderNumber1: null,
+      orderNumber2: null,
+      orderNumber3: null,
+      orderStatus3: null,
+      toOrderStatus3: null,
+      userNameCode: null
+    }
+  },
+  created() {
+    this.value1 = new Date()
+    this.value2 = new Date()
+  },
+  mounted() {
+    this.information()
+  },
+  watch: {
+    saleLog() {
+      if (
+        this.saleLog == '计量传输物流实绩' ||
+        this.saleLog == '物流金蝶订单操作'
+      ) {
+        this.serverName = 'dil-join-api/'
+      } else if (this.saleLog == '委托发送报文') {
+        this.serverName = 'dil-tms-truck-api/'
+      } else if (this.saleLog == '金蝶通讯报文') {
+        this.serverName = 'dil-ams-api/'
+      }
+    }
+  },
+  methods: {
+    downLoadFile() {
+      console.log(
+        toDateStringDay(new Date(this.startTime)) + '-' + this.saleLog
+      )
+      const ele = document.createElement('a')
+      const url =
+        'https://wl.dasteel.cn:32322/api/v1/uc/getFile?path=/data/' +
+        this.serverName +
+        toDateStringDay(new Date(this.startTime)) +
+        '-' +
+        this.saleLog +
+        '.txt'
+      ele.setAttribute('href', url) //设置下载文件的url地址
+      ele.setAttribute('download', 'download') //用于设置下载文件的文件名
+      ele.click()
+    },
+    selectLoadingIdRemark() {
+      if (
+        this.loadDetail.orderNumber &&
+        this.loadDetail.orderNumber.length == 21
+      ) {
+        this.axios
+          .post('/api/v1/tms/selectLoadingIdRemark', this.loadDetail)
+          .then(res => {
+            console.log(res)
+            if (res.data.status == 'succeed') {
+              this.loadDetail = res.data.data
+            } else {
+              this.$message.error(res.data.data)
+            }
+          })
+      } else {
+        this.loadDetail = {}
+      }
+    },
+    querySearchMaterial(queryString, cb) {
+      if (queryString.length < 1) {
+        return
+      }
+      this.axios
+        .get('/api/v1/uc/getMaterialByLike?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            cb(res.data.data)
+          }
+        })
+    },
+    handleSelectMaterial(item) {
+      console.log('material:', item)
+      this.loadDetail.materialId = item.materialId
+      this.loadDetail.materialName = item.materialName
+    },
+    querySearchWareHouse(queryString, cb) {
+      if (queryString.length < 1) {
+        return
+      }
+      this.axios
+        .get('/api/v1/uc/getWareHouseNameLike?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            cb(res.data.data)
+          }
+        })
+    },
+    handleSelectLoading(item) {
+      console.log('load:', item)
+      this.loadDetail.loadingId = item.warehouseId
+      this.loadDetail.loadingName = item.warehouseName
+    },
+    handleSelectUnloading(item) {
+      console.log('unload:', item)
+      this.loadDetail.unloadingId = item.warehouseId
+      this.loadDetail.unloadingName = item.warehouseName
+    },
+    //修改装卸货信息
+    updateLoadingIdRemark() {
+      this.axios
+        .post('/api/v1/tms/updateLoadingIdRemark', this.loadDetail)
+        .then(res => {
+          if (res.data.data == 0) {
+            this.$message.success('修改成功!')
+          } else if (res.data.data == 11) {
+            this.$message.error('内转订单无需求计划,请先做需求或计划')
+          } else {
+            this.$message.error(res.data.data)
+          }
+        })
+    },
+    linkageDeleteTransportOrder() {
+      let good = ''
+      let goodspa = ''
+      let goodList = []
+      let mapList = []
+      if (this.materialId != null) {
+        goodList = this.materialList.filter(e => {
+          if (e.materialId == this.materialId) {
+            return e
+          }
+        })
+        good = goodList[0].good
+        goodspa = goodList[0].goodspa
+      }
+      let map = {
+        orderNumber: this.orderNumber,
+        good: good,
+        goodspa: goodspa,
+        resultCrossWeightTime: toDateString(this.value1)
+      }
+      mapList.push(map)
+      this.axios
+        .post(
+          '/api/v1/join/tmstruckweightresult/linkageDeleteTransportOrder',
+          mapList
+        )
+        .then(res => {
+          console.log(res)
+        })
+      console.log(toDateString(this.value1))
+    },
+    updateOrderStatus() {
+      if (
+        this.orderNumber != null &&
+        this.orderNumber != ''
+      ) {
+        this.axios
+          .post('/api/v1/bp/updateOrderStatusSell', {
+            orderNumber: this.orderNumber,
+            orderOperator: getCookie('userId')
+          })
+          .then(res => {
+            if (res.data.code == 200) {
+              this.$message.success('修改成功')
+              this.capacityName = null;
+              this.orderNumber = null;
+            } else {
+              this.$message.error('操作失败:' + res.data.data)
+            }
+          })
+      } else {
+        this.$message.error('运输订单号不能为空!')
+      }
+    },
+    updateCanwork() {
+      console.log(this.orderNumber)
+      this.axios
+        .post('/api/v1/bp/updateOrderCanWork?orderNumber=' + this.orderNumber)
+        .then(res => {
+          this.$message.success('修改成功')
+          this.$router.go(0)
+        })
+    },
+    enFactoryResultByPDA() {
+      let map = {
+        orderNumber: this.orderNumber + ' ',
+        gatepostId: this.enFactoryGatepost
+      }
+      this.axios.post('/api/v1/tms/enFactoryResultByPDA', map).then(res => {
+        console.log(res)
+        if (res.data.status == 'succeed') {
+          this.$message.success('进厂成功!')
+        } else {
+          this.$message.error('操作失败:' + res.data.data)
+        }
+      })
+    },
+    leaveFactoryResultByPDA() {
+      let map = {
+        orderNumber: this.orderNumber + ' ',
+        gatepostId: this.enFactoryGatepost
+      }
+      this.axios.post('/api/v1/tms/addLeaveFactoryResult', map).then(res => {
+        console.log(res)
+        if (res.data.status == 'succeed') {
+          this.$message.success('出厂成功!')
+        } else {
+          this.$message.error('操作失败:' + res.data.data)
+        }
+      })
+    },
+    allowEnfactoryClick() {
+      if (
+        this.orderNumber != null &&
+        this.orderNumber != ''
+      ) {
+        this.axios
+          .post('/api/v1/bp/passThroughOrder', {
+            orderNumber: this.orderNumber
+          })
+          .then(res => {
+            if (res.data.code == 200) {
+              this.$message.success('修改成功')
+              this.$router.go(0)
+            } else {
+              this.$message.error(res.data.data)
+            }
+          })
+      }
+    },
+    queueClick() {
+      this.axios
+        .post('/api/v1/qms/addQueueResult?vno=' + this.capacityName)
+        .then(res => {
+          if (res.data.code == 200) {
+            this.$message.success('操作成功')
+            this.$router.go(0)
+          } else {
+            this.$message.error(res.data.data)
+          }
+        })
+    },
+    deleteMoreResult() {
+      console.log(this.orderNumber)
+      this.axios
+        .post('/api/v1/bp/deleteErrorResult?orderNumber=' + this.orderNumber)
+        .then(res => {
+          if (res.data.code == '200') {
+            this.$message.success('删除成功')
+          }
+        })
+    },
+    clearEnAndQue() {
+      console.log(this.orderNumber)
+      this.axios
+        .post('/api/v1/bp/clearEnAndQue', { orderNumber: this.orderNumber })
+        .then(res => {
+          this.$message.success(res.data.data)
+        })
+    },
+    updateLineSqe() {
+      let map = {
+        orderId: this.orderId,
+        orderLineSqe: this.lineQuence
+      }
+      this.axios.post('/api/v1/uc/updateLineSqe', map).then(res => {
+        console.log(res.data)
+        if (res.data.code == '200') {
+          this.$message.success('修改路段顺序号成功')
+          this.$router.go(0)
+        }
+      })
+    },
+    oninput() {},
+    onchange() {
+      if (this.switchValue) {
+        this.first = true
+        this.second = true
+      } else {
+        this.second = false
+      }
+    },
+    onchange1() {
+      console.log(this.truckCalFirst)
+      this.truckCalFirstList.forEach(e => {
+        if (this.truckCalFirst == e.value) {
+          this.truckCalFirstNum = e.label
+        }
+      })
+    },
+    onchange2() {
+      this.truckCalSecondList.forEach(e => {
+        if (this.truckCalSecond == e.value) {
+          this.truckCalSecondNum = e.label
+        }
+      })
+    },
+    //运力弹出层
+    handleSelectCapacity(item) {
+      this.capacityId = item.capacityId
+      this.capacityName = item.capacityNumber
+      this.axios
+        .get('/api/v1/uc/getOrderNumber?capacityId=' + this.capacityId)
+        .then(res => {
+          if (res.data.code == '200') {
+            this.orderId = res.data.data.orderId
+            this.orderNumber = res.data.data.orderNumber
+            this.axios
+              .get('/api/v1/uc/getMaterialIdByOrderId?orderId=' + this.orderId)
+              .then(res => {
+                if (res.data.code == '200') {
+                  this.materialList = res.data.data
+                }
+              })
+          }
+        })
+    },
+    //以下是运力边输边查搜索
+    querySearchCapacity(queryString, cb) {
+      if (queryString.length < 3) {
+        return
+      }
+      this.axios
+        .get('/api/v1/uc/getCapacityNumber?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            var restaurantsCarrier = res.data.data
+            this.transferList = res.data.data
+            console.log(restaurantsCarrier, 'restaurantsCarrier')
+            var results = queryString
+              ? restaurantsCarrier.filter(this.createFilterCarrier(queryString))
+              : restaurantsCarrier
+            // 调用 callback 返回建议列表的数据
+            cb(results)
+          }
+        })
+    },
+    createFilterCarrier(queryString) {
+      return restaurantsCarrier => {
+        return (
+          restaurantsCarrier.capacityNumber
+            .toLowerCase()
+            .indexOf(queryString.toLowerCase()) > -1
+        )
+      }
+    },
+    //以上是承运商边输边查搜索
+    information() {
+      this.axios.get('/api/v1/uc/getAllCalculateMes').then(res => {
+        this.truckCalFirstList = res.data
+        this.truckCalSecondList = res.data
+      })
+      this.axios.get('/api/v1/uc/getAllGatepost').then(res => {
+        console.log(res)
+        this.gatePostList = res.data
+      })
+    },
+    onClickConfirm() {
+      console.log(this.jsonStringValue, 'jsonStringValue')
+      this.poundNo = 'jlbl' + toDateNo(new Date())
+      console.log(typeof this.transferMap.orderNumber)
+      if (!this.jsonStringValue) {
+        if (this.switchValue) {
+          if (
+            this.orderNumber == null ||
+            this.truckCalFirst == null ||
+            this.truckCalSecond == null ||
+            this.firstWeight == null ||
+            this.secondWeight == null ||
+            this.value1 == null ||
+            this.value2 == null ||
+            this.materialId == null
+          ) {
+            this.$message.warning('请填写所有值!!!')
+            return
+          }
+        } else {
+          if (
+            this.orderNumber == null ||
+            this.truckCalFirst == null ||
+            this.firstWeight == null ||
+            this.value1 == null ||
+            this.materialId == null
+          ) {
+            this.$message.warning('请填写所有值!!!')
+            return
+          }
+        }
+      } else {
+      }
+
+      let mapFirst = {
+        orderNumber: this.orderNumber,
+        resultTareCalculateNumber: this.truckCalFirstNum,
+        resultTareWeight: this.firstWeight + '',
+        resultTareWeightTime: toDateString(this.value1),
+        resultPoundNo: this.poundNo,
+        materialId: this.materialId + ''
+      }
+      //如果首次大于二次,那么是先毛后皮,首次放在毛重上面,二次放在皮重上面
+      if (this.firstWeight >= this.secondWeight) {
+        var mapSecond = {
+          orderNumber: this.orderNumber,
+          resultTareCalculateNumber: this.truckCalSecondNum,
+          resultCrossCalculateNumber: this.truckCalFirstNum,
+          resultTareWeight: this.secondWeight + '',
+          resultCrossWeight: this.firstWeight + '',
+          resultNetWeight:
+            Math.abs(this.firstWeight - this.secondWeight).toFixed(2) + '',
+          resultTareWeightTime: toDateString(this.value2),
+          resultCrossWeightTime: toDateString(this.value1),
+          resultPoundNo: this.poundNo,
+          materialId: this.materialId + ''
+        }
+      } else {
+        //如果首次小于二次,那么是先皮后毛,首次放在皮重上面,二次放在毛重上面
+        var mapSecond = {
+          orderNumber: this.orderNumber,
+          resultTareCalculateNumber: this.truckCalFirstNum,
+          resultCrossCalculateNumber: this.truckCalSecondNum,
+          resultTareWeight: this.firstWeight + '',
+          resultCrossWeight: this.secondWeight + '',
+          resultNetWeight:
+            Math.abs(this.secondWeight - this.firstWeight).toFixed(2) + '',
+          resultTareWeightTime: toDateString(this.value1),
+          resultCrossWeightTime: toDateString(this.value2),
+          resultPoundNo: this.poundNo,
+          materialId: this.materialId + ''
+        }
+      }
+      var arr = []
+      if (!this.jsonStringValue) {
+        if (this.switchValue) {
+          arr.push(mapSecond)
+        } else {
+          arr.push(mapFirst)
+        }
+      } else {
+        arr.push(JSON.parse(this.jsonStringValue))
+      }
+      console.log(arr, 'arr')
+      this.axios.post('/api/v1/uc/recordingWeightResult', arr).then(res => {
+        this.$message.success('补录计量实绩成功')
+        this.$router.go(0)
+      })
+    },
+    onClickCancel() {},
+    interchangeOrderClick() {
+      if (
+        this.orderNumber1 != null &&
+        this.orderNumber1 != '' &&
+        this.orderNumber2 != null &&
+        this.orderNumber2 != ''
+      ) {
+        this.$confirm("确定交换:" + this.orderNumber1 + ";" + this.orderNumber2, "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          center: true,
+        }).then(() => {
+            this.axios
+              .post('/api/v1/bp/interchangeOrder', {
+                orderNumber1: this.orderNumber1,
+                orderNumber2: this.orderNumber2
+              })
+              .then(res => {
+                if (res.data.code == 200) {
+                  this.$message.success('修改成功')
+                  this.$router.go(0)
+                } else {
+                  this.$message.error(res.data.data)
+                }
+              })
+        }).catch(() => {
+            this.$message({
+              type: "info",
+              message: "取消交换!",
+            })
+        });
+      }
+    },
+    modifyOrderStatus(){
+      if (
+        this.orderNumber3 != null &&
+        this.orderNumber3 != '' &&
+        this.orderStatus3 != null &&
+        this.orderStatus3 != '' &&
+        this.toOrderStatus3 != null &&
+        this.toOrderStatus3 != ''
+      ){
+        this.axios
+              .post('/api/v1/bp/modifyOrderStatus', {
+                orderNumber: this.orderNumber3,
+                orderStatus: this.orderStatus3,
+                toOrderStatus: this.toOrderStatus3
+              })
+              .then(res => {
+                if (res.data.code == 200) {
+                  this.$message.success('修改成功')
+                  this.$router.go(0)
+                } else {
+                  this.$message.error(res.data.data)
+                }
+              })
+      }
+    },
+    resetPassword(){
+      if (
+        this.userNameCode != null && this.userNameCode != '' 
+      ){
+        this.axios
+              .post('/api/v1/bp/resetPassword', {
+                userNameCode: this.userNameCode
+              })
+              .then(res => {
+                if (res.data.code == 200) {
+                  this.$message.success('重置成功')
+                  this.$router.go(0)
+                } else {
+                  this.$message.error(res.data.data)
+                }
+              })
+      }
+    }
+  }
+}
+</script>
+<style lang="scss">
+.admin {
+  .admin1 {
+    margin-top: 40px;
+    margin-left: 40px;
+    .switch {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      margin-top: 20px;
+      color: aqua;
+    }
+    .button_box {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 100%;
+      height: 100px;
+    }
+    .admin2 {
+      margin-top: 40px;
+      .from {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        margin-top: 20px;
+        margin-bottom: 20px;
+        .el-input {
+          width: 250px;
+        }
+      }
+      .load {
+        align-items: center;
+        justify-content: center;
+        margin-top: 20px;
+        margin-bottom: 20px;
+        .el-input {
+          width: 250px;
+        }
+      }
+      .carrier {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .el-form-item {
+          text-align: right;
+        }
+        .el-autocomplete {
+          width: 250px;
+        }
+      }
+      .material {
+        display: flex;
+        justify-content: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+      .poundNo {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+      .block {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .el-input {
+          width: 250px;
+        }
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+      }
+      .truckCalFirst {
+        display: flex;
+        justify-content: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+      .truckCalSecond {
+        display: flex;
+        justify-content: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+      .secondWeight {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+      .firstWeight {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+      .netWeight {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 20px;
+        margin-right: 100px;
+        .text {
+          display: inline-block;
+          width: 170px;
+          text-align: right;
+        }
+        .el-input {
+          width: 250px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 8 - 0
src/views/ADMINISTRATORS/router/index.js

@@ -5,6 +5,7 @@ import routerBefore from '@/config/routerBefore.js'
 import main from '@/components/main.vue'
 // 系统配置管理
 import ADMINISTRATORS1 from '../components/ADMINISTRATORS1.vue'
+import ADMINISTRATORS2 from '../components/ADMINISTRATORS2.vue'
 import tmstruckCommisson from '../components/tmstruckCommisson.vue'
 import saleLog from '../components/saleLog.vue'
 Vue.use(Router)
@@ -23,6 +24,13 @@ const constantRouterMap = [
         component: () =>
           import('@/views/ADMINISTRATORS/components/ADMINISTRATORS1')
       },
+      {
+        path: 'ADMINISTRATORS2',
+        name: 'ADMINISTRATORS2',
+        meta: { code: 'xtpzgl-jggl' },
+        component: () =>
+          import('@/views/ADMINISTRATORS/components/ADMINISTRATORS2')
+      },
       {
         path: 'tmstruckCommisson',
         name: 'tmstruckCommisson',