Browse Source

前端gjy

gjy 4 years ago
parent
commit
9dca74cf20

+ 3 - 1
src/lang/zh.js

@@ -507,6 +507,7 @@
     tranManagementDriverAdd: '添加司机',
     tranManagementDriverLook: '查看司机',
     warehouseManagementPerfectDelivery: '编辑',
+    tranManagementTransport: '运输任务',
 
     // 采购模块
     procurement: '采购管理',
@@ -4707,7 +4708,8 @@
   tranManagement: {
     tranManagementDriver: '司机管理',
     tranManagementDriverAdd: '添加司机',
-    tranManagementDriverLook: '查看司机'
+    tranManagementDriverLook: '查看司机',
+    tranManagementTransport: '运输任务',
   },
   // 年度培训
   annualTraining: {

+ 14 - 0
src/views/tranManagement/component/routers/route.js

@@ -26,6 +26,20 @@ const tranManagementRouter = {
         keepAlive: true
       }
     },
+    //运输任务
+    {
+      path: 'tranManagementTransport',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/tranManagement/tranManagementTransport'),
+      name: 'tranManagementTransport',
+      meta: {
+        title: 'tranManagementTransport',
+        shortcutEntrance: 'tranManagement',
+        module: 'tranManagement.tranManagementDriver.tranManagementTransport',
+        permissicon: [],
+        keepAlive: true
+      },
+    },
     //添加司机
     {
       path: 'tranManagementDriverAdd',

+ 338 - 0
src/views/tranManagement/tranManagementTransport.vue

@@ -0,0 +1,338 @@
+// 运输管理
+<template>
+  <div>
+    <BaseHeaderLayout :leftSpan="20">
+      <template slot="right">
+          <ws-form-item label="起点" span="1" prop="agent">
+            <ws-input
+              v-model="deptBudgetList.agent"
+              placeholder="请输入起点"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item label="终点" span="1" prop="agent">
+            <ws-input
+              v-model="deptBudgetList.agent"
+              placeholder="请输入终点"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-input
+          v-model="warehouseName"
+          placeholder="请输入仓库名"
+          clearable
+          maxlength="500"
+          type="input"
+          class="findValue"
+        ></ws-input>
+       <ws-button
+          type="primary"
+          @click="handleLook()"
+          v-hasPermission="
+            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+          "
+          >查找</ws-button
+        >
+      </template>
+      <template slot="left">
+        
+        
+      </template>
+    </BaseHeaderLayout>
+    <div class="connert">
+      <el-table
+        class="wenzi"
+        :data="driverList.records"
+        style="width: 100%; margin-top: 20px"
+        fit
+        height="780"
+      >
+        <el-table-column type="index" label="序号">
+          <template scope="scope">
+            <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+            <span v-else>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="driverName" label="姓名" width="100">
+        </el-table-column>
+        <el-table-column prop="numberCard" label="运输任务编号" width="200">
+        </el-table-column>
+        <el-table-column prop="driverPhone" label="合同编号" width="120">
+        </el-table-column>
+        <el-table-column prop="carNumber" label="货物(吨数)" width="80">
+        </el-table-column>
+        <el-table-column prop="binNumber" label="运输方式" width="120">
+        </el-table-column>
+        <el-table-column prop="carModel" label="起点" width="80">
+        </el-table-column>
+        <el-table-column prop="carLength" label="当前中转" width="80">
+        </el-table-column>
+         <el-table-column prop="carLength" label="终点" width="80">
+        </el-table-column>
+         <el-table-column prop="carLength" label="状态" width="80">
+        </el-table-column>
+        <el-table-column prop="address" label="操作" width="200">
+          <ws-button
+            type="primary"
+            @click="look()"
+            v-hasPermission="
+              `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+            "
+            >查看</ws-button
+          >
+          <ws-button
+            type="primary"
+            @click="edit()"
+            v-hasPermission="
+              `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+            "
+            >编辑</ws-button
+          >
+          <ws-button
+            type="primary"
+            @click="deletes()"
+            v-hasPermission="
+              `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+            "
+            >删除</ws-button
+          >
+          <!-- </template> -->
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-size="deptCircularPage.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="deptBudgetTotal"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+<script>
+import { selectDriver, billoperatehis } from '@/model/transport/index'
+import Pagination from '@/components/Pagination'
+// provinceAndCityData省市二级
+import { provinceAndCityData, CodeToText } from 'element-china-area-data'
+import WsUpload from '@/components/WsUpload'
+import { dayjs, fmoney, EventBus } from 'base-core-lib'
+export default {
+  name: 'viewSpareMoney',
+  components: {
+    WsUpload,
+    Pagination,
+  },
+  watch: {
+    vesselId(val) {
+      this.getList()
+    },
+    isShow(val) {
+      this.showType = val
+    },
+  },
+  data() {
+    return {
+      //弹出框
+      dialogViewSpareMoney: false,
+      dialogApproveFormVisible: false,
+      options_: provinceAndCityData,
+      // 表格显示数据
+      tableDate: [],
+      // 是否显示
+      showType: true,
+      // 年
+      year: '',
+      deptBudgetTotal: 0,
+      currentPage: 1,
+      pageSize: 10,
+      searchType: 1,
+      searchKeyWord: '',
+      contractType: 2,
+      startDate: null,
+      endDate: null,
+      searchTypeText: '',
+      // 提交类型
+      submitType: true,
+      size: 10,
+      spanArr: [],
+      compId: sessionStorage.getItem('ws-pf_compId'),
+      deptCircularPage: {},
+      date: {
+        year: dayjs().format('YYYY'),
+        month: dayjs().format('MM'),
+      },
+      driverList: [],
+      deptBudgetList: {},
+      historyList: [],
+      pickerBeginDateBefore: {
+        disabledDate: (time) => {
+          return time.getTime() > Date.now()
+        },
+      },
+      accessoryTFs: false,
+    }
+  },
+  activated() {
+    this.getList()
+    this.showType = this.isShow
+  },
+  methods: {
+    //查找
+    handleLook() {
+      this.currentPage = 1
+      this.getList()
+    },
+    //添加
+    handleAdd() {
+      this.$router.push({ path: 'tranManagementDriverAdd' })
+    },
+    //编辑
+    handleEdit() {
+      this.$router.push({ path: 'warehouseManagementEdit' })
+    },
+    handleDelete() {
+      this.$router.push({ path: 'warehouseManagementDelete' })
+    },
+    dateFormat(fmt, date) {
+      let ret
+      const opt = {
+        'Y+': date.getFullYear().toString(), // 年
+        'm+': (date.getMonth() + 1).toString(), // 月
+        'd+': date.getDate().toString(), // 日
+        'H+': date.getHours().toString(), // 时
+        // "M+": date.getMinutes().toString(),         // 分
+        // "S+": date.getSeconds().toString()          // 秒
+        // 有其他格式化字符需求可以继续添加,必须转化成字符串
+      }
+      for (let k in opt) {
+        ret = new RegExp('(' + k + ')').exec(fmt)
+        if (ret) {
+          fmt = fmt.replace(
+            ret[1],
+            ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
+          )
+        }
+      }
+      return fmt
+    },
+    handleClose() {
+      this.accessoryTFs = false
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`)
+      this.pageSize = val
+      this.getList()
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val
+      console.log(`当前页: ${val}`)
+      this.getList()
+    },
+    getList() {
+      selectDriver({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        currentPage: this.currentPage,
+        pageSize: this.pageSize,
+        searchType: this.searchType,
+        searchKeyWord: this.searchKeyWord,
+      })
+        .toPromise()
+        .then((response) => {
+          this.deptCircularPage.currentPage = response.current
+          this.deptCircularPage.pageSize = response.size
+          this.deptBudgetTotal = response.total
+          this.driverList = response
+        })
+    },
+    editClick(row) {
+      var status = ''
+      if (row.status == '待执行' || row.status == '已完成') {
+        status = '执行中'
+      } else if (row.status == '执行中') {
+        status = '已完成'
+      }
+      //cancelButtonClass: "btn-custom-cancel"
+      this.$confirm(`是否将状态改为${status}`, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          editstatus({ id: row.id })
+            .toPromise()
+            .then((response) => {
+              this.$notify.success({
+                title: '成功',
+                message: '状态修改成功',
+              })
+              this.getList()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    },
+    selecttaskType(e) {
+      this.selectedOptions = e
+    },
+    fujian(row) {
+      if (
+        row.receiveAttachmentPath === null ||
+        row.receiveAttachmentPath === ''
+      ) {
+        EventBus.$emit(
+          'warning',
+          this.$t('system.noticeCircular.NoInformation')
+        )
+      } else {
+        this.accessoryTFs = true
+      }
+      this.appendixIdss = row.receiveAttachmentPath
+    },
+    handleExamine(row) {
+      this.$router.push({
+        name: 'salesContractExamine',
+        query: { id: row.id },
+      })
+    },
+    // 关闭 dialog时 处理文件url 初始化upload组件
+    handleCloe() {
+      this.dialogViewSpareMoney = false
+    },
+    history(row) {
+      console.log(row)
+      billoperatehis({ id: row.id })
+        .toPromise()
+        .then((response) => {
+          this.historyList = response
+        })
+    },
+    find() {
+      this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
+      this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
+      this.currentPage = 1
+      this.getList()
+    },
+  },
+}
+</script>
+<style lang="scss" scoped>
+.connert {
+  width: 90%;
+  margin: 0 auto;
+}
+.vertical-text-left {
+  width: 62px;
+  text-align: right;
+}
+.findValue {
+  margin: 0 10px;
+}
+</style>

+ 43 - 10
src/views/warehouse/warehouseManagementAdd.vue

@@ -331,20 +331,23 @@ export default {
     },
 
     submit() {
-      console.log(this.deptBudgetList)
-      if (!this.deptBudgetList.warehouseName) {
+       if(!this.deptBudgetList.warehouseName){
         this.$message({
-          message: '仓库名称不能为空',
+          message: '仓库名称不能为空',
           type: 'warning',
         })
         return
       }
-      if (
-        this.deptBudgetList.warehouseName.length < 2 ||
-        this.deptBudgetList.warehouseName.length > 20
-      ) {
+      if(this.deptBudgetList.warehouseName.length < 2 || this.deptBudgetList.warehouseName.length > 20){
         this.$message({
-          message: '仓库名称长度不符合要求,请控制在2-20字符之内',
+          message: '仓库名长度不符合要求!',
+          type: 'warning',
+        })
+        return
+      }
+       if(!this.deptBudgetList.personCharge){
+        this.$message({
+          message: '负责人不能为空!',
           type: 'warning',
         })
         return
@@ -359,9 +362,38 @@ export default {
         })
         return
       }
-      if (this.deptBudgetList.personPhone.length > 11) {
+       if(!this.deptBudgetList.personPhone){
+        this.$message({
+          message: '负责人电话不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      if(this.deptBudgetList.personPhone.length != 11){
+        this.$message({
+          message: '手机号输入有误!',
+          type: 'warning',
+        })
+        return
+      }
+      //  if(!this.deptBudgetList.warehousePrivate){
+      //   this.$message({
+      //     message: '仓库所在地不能为空!',
+      //     type: 'warning',
+      //   })
+      //   return
+      // }
+       if(!this.deptBudgetList.detailedAddress){
+        this.$message({
+          message: '详细地址不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      
+      if(this.totalStorage <= 0){
         this.$message({
-          message: '手机号输入有误',
+          message: '仓位储量不能为空!',
           type: 'warning',
         })
         return
@@ -376,6 +408,7 @@ export default {
         })
         return
       }
+      // freightspace
       for (var i = 0; i < this.freightspace.length; i++) {
         for (var j = i + 1; j < this.freightspace.length; j++) {
           console.log(

+ 4 - 0
src/views/warehouse/warehouseManagementDelivery.vue

@@ -616,6 +616,10 @@ export default {
         })
         return
       }
+     
+
+
+
        this.$confirm(`确定提交出库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',

+ 85 - 2
src/views/warehouse/warehouseManagementEdit.vue

@@ -88,12 +88,13 @@
           </ws-form-item>
           <!--总储量(吨)-->
           <ws-form-item label="总储量(吨)" span="1" prop="totalStorage">
-            <ws-input
+            <!-- <ws-input
               v-model="deptBudgetList.totalStorage"
               placeholder="请输入总储量(吨)"
               maxlength="20"
               size="small"
-            />
+            /> -->
+            {{totalStorage}}
           </ws-form-item>
         </ws-info-table>
         <div v-for="(item, index) in deptBudgetList.warehousePositionInfoList">
@@ -254,7 +255,19 @@ export default {
     this.loaddata()
     this.showType = this.isShow
   },
+computed : {
+   totalStorage :function() {
+     var sum = 0
+     if(this.deptBudgetList.warehousePositionInfoList){
+       for(var i = 0;i < this.deptBudgetList.warehousePositionInfoList.length; i++ ){
 
+      sum += this.deptBudgetList.warehousePositionInfoList[i].maxStorage
+     }
+     }
+     
+     return sum
+    },
+},
   methods: {
     //返回按钮
     returnWarehouse() {
@@ -379,6 +392,76 @@ export default {
 
     //提交
     submit() {
+       if(!this.deptBudgetList.warehouseName){
+        this.$message({
+          message: '仓库名称不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      if(this.deptBudgetList.warehouseName.length < 2 || this.deptBudgetList.warehouseName.length > 20){
+        this.$message({
+          message: '仓库名长度不符合要求!',
+          type: 'warning',
+        })
+        return
+      }
+       if(!this.deptBudgetList.personCharge){
+        this.$message({
+          message: '负责人不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.personCharge.length < 2 ||
+        this.deptBudgetList.personCharge.length > 10
+      ) {
+        this.$message({
+          message: '负责人长度不符合要求,请控制在2-10字符之内',
+          type: 'warning',
+        })
+        return
+      }
+       if(!this.deptBudgetList.personPhone){
+        this.$message({
+          message: '负责人电话不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      if(this.deptBudgetList.personPhone.length != 11){
+        this.$message({
+          message: '手机号输入有误!',
+          type: 'warning',
+        })
+        return
+      }
+       if(!this.deptBudgetList.detailedAddress){
+        this.$message({
+          message: '详细地址不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      
+      if(this.totalStorage <= 0){
+        this.$message({
+          message: '仓位储量不能为空!',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.detailedAddress.length < 2 ||
+        this.deptBudgetList.detailedAddress.length > 20
+      ) {
+        this.$message({
+          message: '详细地址长度不符合要求,请控制在2-20字符之内',
+          type: 'warning',
+        })
+        return
+      }
       this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
           this.deptBudgetList.baseId = this.baseId

+ 6 - 4
src/views/warehouse/warehouseManagementList.vue

@@ -252,11 +252,16 @@ export default {
           positionId: item.binNumberId,
           warehouseName: item.warehouseName,
           binNumber: item.binNumber,
+          capacity: item.capacity,
         },
       })
     },
     //入库
     warehousing(item) {
+      var free = 0
+      for (var i = 0; i < item.warehouseNumViewList.length; i++) {
+        free += item.warehouseNumViewList[i].storage
+      }
       this.$router.push({
         path: 'warehouseManagementPut',
         query: {
@@ -264,6 +269,7 @@ export default {
           positionId: item.binNumberId,
           warehouseName: item.warehouseName,
           binNumber: item.binNumber,
+          capacity:item.capacity - free ,
         },
       })
     },
@@ -286,16 +292,13 @@ export default {
         //   this.pos = 0
         // } else {
         //不是第一项时,就根据标识去存储
-        console.log(data[index].warehouseNumViewList.length)
         if (data[index].warehouseNumViewList.length > 1) {
           // 查找到符合条件的数据时每次要把之前存储的数据+1
           this.spanArr[this.pos] = data[index].warehouseNumViewList.length
           this.spanArr.push(0)
         } else {
           // 没有符合的数据时,要记住当前的index
-
           this.spanArr.push(1)
-
           this.pos = index
         }
         // }
@@ -464,7 +467,6 @@ export default {
       this.dialogViewSpareMoney = false
     },
     history(row) {
-      console.log(row)
       billoperatehis({ id: row.id })
         .toPromise()
         .then((response) => {

+ 3 - 14
src/views/warehouse/warehouseManagementNoComplete.vue

@@ -211,7 +211,6 @@ export default {
     returnWarehouse() {
       this.$router.push({ path: 'warehouseManagementList' })
     },
-
     //编辑
     edits(row) {
       if (row.inOutFlag == 2) {
@@ -222,19 +221,9 @@ export default {
             binNumber: row.binNumber,
             baseId: row.warehouseId,
             positionId: row.binNumberId,
-            goodsName:row.goodsName,
-            grossWeight:row.grossWeight,
-            tare:row.tare,
-            netWeight:row.netWeight,
-            grade:row.grade,
-            agent:row.agent,
-            carNo:row.carNo,
-            inOutDate:row.inOutDate,
-            contractNo:row.contractNo,
-            inOutType:row.inOutType,
-           }
-           })
-      }else if(row.inOutFlag==1){
+          },
+        })
+      } else if(row.inOutFlag==1){
         this.$router.push({
           path: 'warehouseManagementPerfectDelivery',
           query: {

+ 27 - 37
src/views/warehouse/warehouseManagementPerfectput.vue

@@ -338,7 +338,6 @@ export default {
         warehouseInOutDetail: {},
       },
       historyList: [],
-
       pickerBeginDateBefore: {
         disabledDate: (time) => {
           return time.getTime() > Date.now()
@@ -389,7 +388,6 @@ export default {
                 .toPromise()
                 .then((response) => {
                   this.$message.success('暂存成功')
-                  this.deptBudgetList=response
                   this.$router.push({ path: 'warehouseManagementList' })
                 })
             } else {
@@ -404,43 +402,35 @@ export default {
     },
     //提交按钮
     submit() {
-      if (
-        this.deptBudgetList.warehouseInOutDetail.qualityInspector.length < 2 ||
-        deptBudgetList.warehouseInOutDetail.qualityInspector > 10
-      ) {
-        this.$message({
-          message: '质检员姓名长度错误!',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        this.deptBudgetList.warehouseInOutDetail.qualityInspector.length < 2 ||
-        deptBudgetList.warehouseInOutDetail.qualityInspector > 10
-      ) {
-        this.$message({
-          message: '质检员姓名长度错误!',
-          type: 'warning',
+      console.log(123456)
+      this.$confirm(`确定提交入库信息`, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+      })
+        .then(() => {
+          this.$refs.deptBudgetList.validate((valid) => {
+            if (valid) {
+              this.deptBudgetList.compId = sessionStorage.getItem(
+                'ws-pf_compId'
+              )
+              this.deptBudgetList.inOutFlag = 1
+              this.deptBudgetList.statusFlag = 3
+              addstorageputList(this.deptBudgetList)
+                .toPromise()
+                .then((response) => {
+                  this.$message.success('添加成功')
+                  this.$router.push({ path: 'warehouseManagementList' })
+                })
+            } else {
+              EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              return false
+            }
+          })
         })
-        return
-      }
-
-      this.$refs.deptBudgetList.validate((valid) => {
-        if (valid) {
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.deptBudgetList.inOutFlag = 1
-          this.deptBudgetList.statusFlag = 3
-          addstorageputList(this.deptBudgetList)
-            .toPromise()
-            .then((response) => {
-              this.$message.success('添加成功')
-              this.$router.push({ path: 'warehouseManagementList' })
-            })
-        } else {
-          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+        .catch(() => {
           return false
-        }
-      })
+        })
     },
     //暂存按钮
     returnWarehouse() {

+ 16 - 0
src/views/warehouse/warehouseManagementPut.vue

@@ -478,6 +478,15 @@ export default {
         })
         return
       }
+
+      
+      if(this.deptBudgetList.netWeight > this.$route.query.capacity){
+        this.$message({
+          message: '入库量大于该仓库容量!',
+          type: 'warning',
+        })
+        return
+      }
       this.$confirm(`确定提交入库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
@@ -604,6 +613,13 @@ export default {
           type: 'warning',
         })
         return
+      }
+       if(this.deptBudgetList.netWeight > this.$route.query.capacity){
+        this.$message({
+          message: '入库量大于该仓库容量!',
+          type: 'warning',
+        })
+        return
       }
       this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
         cancelButtonText: '取消',