浏览代码

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

gjy 4 年之前
父节点
当前提交
b6829b7e81
共有 3 个文件被更改,包括 361 次插入144 次删除
  1. 249 138
      src/views/warehouse/warehouseManagementAdd.vue
  2. 111 5
      src/views/warehouse/warehouseManagementList.vue
  3. 1 1
      vue.config.js

+ 249 - 138
src/views/warehouse/warehouseManagementAdd.vue

@@ -27,9 +27,13 @@
       ref="deptBudgetList"
       :rules="rules"
       :model="deptBudgetList"
-      >
-      <el-radio v-model="radio" label="1" checked="true">自有库</el-radio>
-      <el-radio v-model="radio" label="2">临时库</el-radio>
+    >
+      <el-radio-group v-model="radio">
+        <el-radio :label="1">自有库</el-radio>
+        <el-radio :label="2">临时库</el-radio>
+      </el-radio-group>
+      <!-- <el-radio v-model="radio" label="1" checked="true">自有库</el-radio>
+      <el-radio v-model="radio" label="2">临时库</el-radio> -->
       <div class="small-title">基本信息</div>
       <ws-info-table>
         <!--仓库名称-->
@@ -95,7 +99,12 @@
         </ws-form-item>
 
         <!--总吨量(吨)-->
-        <ws-form-item label="总吨量(吨)" span="1" prop="settlementMethod"  v-show="radio==1">
+        <ws-form-item
+          label="总吨量(吨)"
+          span="1"
+          prop="settlementMethod"
+          v-show="radio == 1"
+        >
           <ws-input
             class="totalStorage"
             :readonly="true"
@@ -108,7 +117,7 @@
           style="width: 100%"
           class="flex position"
           v-for="(item, index) in freightspace"
-          v-show="radio==1"
+          v-show="radio == 1"
         >
           <ws-form-item
             label="仓位编号"
@@ -160,9 +169,9 @@
       </ws-info-table>
     </ws-form>
     <ws-form ref="deptBudgetList" :model="deptBudgetList">
-      <div class="small-title" v-show="radio==1">上传仓库照片</div>
+      <div class="small-title" v-show="radio == 1">上传仓库照片</div>
       <ws-upload
-       v-show="radio==1"
+        v-show="radio == 1"
         ref="upload"
         table-name="maintain_work_order"
         oss-key="mainPlan"
@@ -198,7 +207,7 @@ import {
   addxiala,
   editxiala,
   delxiala,
-  increase
+  increase,
 } from '@/model/warehouse/index'
 import WsUpload from '@/components/WsUpload'
 import mapDrag from '@/components/mapdrag/mapdrag'
@@ -323,7 +332,7 @@ export default {
     returnsales() {
       this.deptBudgetList = {}
       this.freightspace = {}
-      this.selectedOptions = ""
+      this.selectedOptions = ''
       this.$router.push({ path: 'warehouseManagementList' })
     },
     // confirmPosition() {
@@ -342,145 +351,247 @@ export default {
     },
     onChange(files) {
       this.fileNum = files
-      this.$refs.upload.handleSaveBill().then((res) => {
-      })
+      this.$refs.upload.handleSaveBill().then((res) => {})
     },
 
     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.warehousePrivate){
-      //   this.$message({
-      //     message: '仓库所在地不能为空!',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      if (!this.deptBudgetList.detailedAddress) {
-        this.$message({
-          message: '详细地址不能为空!',
-          type: 'warning',
-        })
-        return
-      }
+      if (this.radio == 1) {
+        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.warehousePrivate){
+        //   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字符之内',
+        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
+        }
+        // freightspace
+        for (var i = 0; i < this.freightspace.length; i++) {
+          for (var j = i + 1; j < this.freightspace.length; j++) {
+            console.log(
+              this.freightspace[i].binNumber,
+              this.freightspace[j].binNumber
+            )
+            if (
+              this.freightspace[i].binNumber == this.freightspace[j].binNumber
+            ) {
+              this.$message({
+                message: '仓位编号重复',
+                type: 'warning',
+              })
+              return
+            }
+          }
+        }
+        this.$confirm(`确定提交仓库信息?`, {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
           type: 'warning',
         })
-        return
-      }
-      // freightspace
-      for (var i = 0; i < this.freightspace.length; i++) {
-        for (var j = i + 1; j < this.freightspace.length; j++) {
-          console.log(
-            this.freightspace[i].binNumber,
-            this.freightspace[j].binNumber
-          )
-          if (
-            this.freightspace[i].binNumber == this.freightspace[j].binNumber
-          ) {
-            this.$message({
-              message: '仓位编号重复',
-              type: 'warning',
+          .then(() => {
+            this.$refs.deptBudgetList.validate((valid) => {
+              if (valid) {
+                this.deptBudgetList.compId =
+                  sessionStorage.getItem('ws-pf_compId')
+                this.deptBudgetList.warehousePrivate =
+                  CodeToText[this.selectedOptions[0]]
+                this.deptBudgetList.warehouseCity =
+                  CodeToText[this.selectedOptions[1]]
+                this.deptBudgetList.warehouseArea =
+                  CodeToText[this.selectedOptions[2]]
+                this.deptBudgetList.warehousePositionInfoList =
+                  this.freightspace
+                this.deptBudgetList.totalStorage = this.totalStorage
+                addList(this.deptBudgetList)
+                  .toPromise()
+                  .then((response) => {
+                    this.$message.success('添加成功')
+                    this.deptBudgetList = {}
+                    this.freightspace = {}
+                    this.selectedOptions = ''
+                    this.$router.push({ path: 'warehouseManagementList' })
+                  })
+              } else {
+                EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+                return false
+              }
             })
-            return
-          }
+          })
+          .catch(() => {
+            return false
+          })
+      } else if (this.radio == 2) {
+        if (!this.deptBudgetList.warehouseName) {
+          this.$message({
+            message: '仓库名称不能为空!',
+            type: 'warning',
+          })
+          return
         }
-      }
-      this.$confirm(`确定提交仓库信息?`, {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-        .then(() => {
-          this.$refs.deptBudgetList.validate((valid) => {
-            if (valid) {
-              this.deptBudgetList.compId =
-                sessionStorage.getItem('ws-pf_compId')
-              this.deptBudgetList.warehousePrivate =
-                CodeToText[this.selectedOptions[0]]
-              this.deptBudgetList.warehouseCity =
-                CodeToText[this.selectedOptions[1]]
-              this.deptBudgetList.warehouseArea =
-                CodeToText[this.selectedOptions[2]]
-              this.deptBudgetList.warehousePositionInfoList = this.freightspace
-              this.deptBudgetList.totalStorage = this.totalStorage
-              addList(this.deptBudgetList)
-                .toPromise()
-                .then((response) => {
-                  this.$message.success('添加成功')
-                  this.deptBudgetList = {}
-                  this.freightspace = {}
-                  this.selectedOptions = ""
-                  this.$router.push({ path: 'warehouseManagementList' })
-                })
-            } else {
-              EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-              return false
-            }
+        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.warehousePrivate){
+        //   this.$message({
+        //     message: '仓库所在地不能为空!',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        if (!this.deptBudgetList.detailedAddress) {
+          this.$message({
+            message: '详细地址不能为空!',
+            type: 'warning',
+          })
+          return
+        }
+        this.$confirm(`确定提交仓库信息?`, {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         })
-        .catch(() => {
-          return false
-        })
+          .then(() => {
+            this.$refs.deptBudgetList.validate((valid) => {
+              if (valid) {
+                this.deptBudgetList.compId =
+                  sessionStorage.getItem('ws-pf_compId')
+                this.deptBudgetList.warehousePrivate =
+                  CodeToText[this.selectedOptions[0]]
+                this.deptBudgetList.warehouseCity =
+                  CodeToText[this.selectedOptions[1]]
+                this.deptBudgetList.warehouseArea =
+                  CodeToText[this.selectedOptions[2]]
+                this.deptBudgetList.warehousePositionInfoList =
+                  this.freightspace
+                this.deptBudgetList.totalStorage = this.totalStorage
+                increase(this.deptBudgetList)
+                  .toPromise()
+                  .then((response) => {
+                    this.$message.success('添加成功')
+                    this.deptBudgetList = {}
+                    this.freightspace = {}
+                    this.selectedOptions = ''
+                    this.$router.push({ path: 'warehouseManagementList' })
+                  })
+              } else {
+                EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+                return false
+              }
+            })
+          })
+          .catch(() => {
+            return false
+          })
+      }
     },
     resetForm(deptBudgetList) {
       this.$refs[deptBudgetList].resetFields()

+ 111 - 5
src/views/warehouse/warehouseManagementList.vue

@@ -40,7 +40,16 @@
           >删除</ws-button
         >
       </template>
-      <template slot="right">
+      <template slot="left">
+        <div style="margin-top: 2px">
+    <el-radio-group v-model="warehouseType" @change="changeradio"  size="small">
+      <el-radio-button label="1" >自有库</el-radio-button>
+      <el-radio-button label="2" >临时库</el-radio-button>
+      
+    </el-radio-group>
+  </div>
+      </template>
+      <template slot="right" >
         <ws-input
           v-model="warehouseName"
           placeholder="请输入仓库名"
@@ -71,7 +80,7 @@
         /></ws-button>
       </template>
     </BaseHeaderLayout>
-    <div>
+    <div v-show="this.warehouseType == '1'"> 
       <el-table
         class="wenzi"
         :data="warehouseList"
@@ -170,6 +179,97 @@
         </el-table-column>
       </el-table>
     </div>
+    
+      <div v-show="this.warehouseType == '2'">
+      <el-table
+        class="wenzi"
+        :data="warehouseList"
+        style="width: 100%; margin-top: 20px"
+        height="780"
+      >
+        <el-table-column prop="index" label="序号" width="80">
+        </el-table-column>
+        <el-table-column prop="warehouseName" label="仓库名" width="80">
+        </el-table-column>
+        <el-table-column prop="address" label="临时库地址">
+          <template slot-scope="scope">
+            <div
+              v-if="scope.row.address != 'null' && scope.row.address != null"
+            >
+              {{ scope.row.address }}
+            </div>
+          </template>
+        </el-table-column>
+        
+        <el-table-column label="入库量(吨)">
+          <template slot-scope="scope">
+            <div
+              style="height: 24px"
+              v-for="(item, i) in scope.row.warehouseNumViewList"
+            >
+              {{ item.inNetWeight }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="出库量(吨)">
+          <template slot-scope="scope">
+            <div
+              style="height: 24px"
+              v-for="(item, i) in scope.row.warehouseNumViewList"
+            >
+              {{ item.outNetWeight }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="应余量(吨)">
+          <template slot-scope="scope">
+            <div
+              style="height: 24px"
+              v-for="(item, i) in scope.row.warehouseNumViewList"
+            >
+             {{ item.storage }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="seller" label="出入库" width="300">
+          <template slot-scope="scope">
+            <ws-button
+              class="completed"
+              @click="nocomplete(scope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+            >
+              待完成({{ scope.row.number }})
+            </ws-button>
+            <ws-button
+              class="putstorage"
+              @click="warehousing(scope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+            >
+              入库
+            </ws-button>
+            <ws-button
+              class="deliverystorage"
+              @click="delivery(scope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+            >
+              出库
+            </ws-button>
+          </template>
+        </el-table-column>
+        <el-table-column prop="address" label="操作" width="200">
+          <template slot-scope="scope">
+            <div class="record" @click="record(scope.row)">记录</div>
+            <div class="adjustment" @click="loss(scope.row)">清仓</div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
   </div>
 </template>
 <script>
@@ -217,7 +317,7 @@ export default {
       searchTypeText: '未完成',
       searchKeyWord: '',
       contractType: 2,
-      warehouseType: 1,
+      warehouseType: "1",
       // 提交类型
       submitType: true,
       size: 10,
@@ -245,6 +345,7 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    
     //出库
     delivery(item) {
       this.$router.push({
@@ -347,6 +448,9 @@ export default {
         },
       })
     },
+    changeradio(e){
+    this.getList()
+    },
     //查看
     handleLook() {
       this.$router.push({ path: 'warehouseManagementLook' })
@@ -398,14 +502,13 @@ export default {
       this.getList()
     },
     getList() {
-      getList({
+        getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
         warehouseName: this.warehouseName,
         warehouseType: this.warehouseType,
       })
         .toPromise()
         .then((response) => {
-          console.log(1111)
           this.warehouseList = response
         })
     },
@@ -577,4 +680,7 @@ export default {
   height: 12px;
   background: #e9ecf7;
 }
+/deep/.el-radio-button:first-child .el-radio-button__inner{
+  margin-left: 10px;
+}
 </style>

+ 1 - 1
vue.config.js

@@ -144,7 +144,7 @@ module.exports = {
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
         // target: 'http://192.168.1.121:8090/',
-        target: 'http://192.168.1.124:8090/',
+        target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址
         // target: 'http://product-server.winsea.com/',