Forráskód Böngészése

出库管理质检管理

zxz 3 éve
szülő
commit
a2f476a7d6

+ 8 - 0
src/api/V2/outboundManagement/index.js

@@ -0,0 +1,8 @@
+//质检列表
+export const API_GET_INSPECT_GETINSPECTLIST = '/qualityInspectionManagement/selectQualityInspection'
+//质检查看
+export const API_GET_INSPECT_GETINSPECTLOOK = '/qualityInspectionManagement/api/getQualityInspection'
+//质检添加
+export const API_POST_INSPECT_ADDOUT = '/qualityInspectionManagement/api/addQualityInspectionOut'
+//查询仓库列表
+export const API_GET_WAREHOUSESELF = '/warehouseBaseInfo/selectWarehouseSelf'

+ 2 - 0
src/lang/zh.js

@@ -1005,6 +1005,7 @@
     outboundManagement: '出库管理',
     weighingManagement: '检斤管理',
     qualityInspectionManagement: '质检管理',
+    qualityInspection: '质检信息',
     collectionManagement: '收款管理',
 
   },
@@ -7440,6 +7441,7 @@
   outboundManagement: {
     weighingManagement: '检斤管理',
     qualityInspectionManagement: '质检管理',
+    qualityInspection:'质检信息',
     collectionManagement: '收款管理',
   }
      

+ 15 - 2
src/model/outboundManagement/index.js

@@ -2,6 +2,19 @@ import { errorCatcher, errorHandle, filter } from 'base-core-lib'
 import { appRx } from '../defalutConfig/indexRx'
 
 import {
-  
+    API_POST_INSPECT_ADDOUT,
+    API_GET_INSPECT_GETINSPECTLIST,
+    API_GET_INSPECT_GETINSPECTLOOK,
+    API_GET_WAREHOUSESELF
+
+}   from '@/api/V2/outboundManagement'
 
-} from '@/api/V2/outboundManagement'
+  //质检列表
+  export const getinspectList = appRx.get(API_GET_INSPECT_GETINSPECTLIST, errorCatcher, errorHandle, filter)
+  //质检查看
+  export const getinspectLook = appRx.get(API_GET_INSPECT_GETINSPECTLOOK, errorCatcher, errorHandle, filter)
+  //质检添加
+  export const addOut = appRx.post(API_POST_INSPECT_ADDOUT, errorCatcher, errorHandle, filter)
+  //查看仓库
+  export const selectWarehouseSelf = appRx.get(API_GET_WAREHOUSESELF, errorCatcher, errorHandle, filter)
+  

+ 31 - 14
src/views/outboundManagement/component/route.js

@@ -14,14 +14,14 @@ const outboundManagementRouter = {
     children: [
         // 检斤管理
         {
-            path: 'weighingManagement',
+            path:'weighingManagement',
             component: () =>
                 import(/* webpackChunkName: "sparepartList" */ '@/views/outboundManagement/weighingManagement'),
-            name: 'weighingManagement',
+            name:'weighingManagement',
             meta: {
-                title: 'weighingManagement',
-                shortcutEntrance: 'outboundManagement',
-                module: 'procurement.procurementOrder.delete',
+                title:'weighingManagement',
+                shortcutEntrance:'outboundManagement',
+                module:'procurement.procurementOrder.delete',
                 permissicon: [],
                 keepAlive: true
             }
@@ -31,25 +31,42 @@ const outboundManagementRouter = {
             path: 'qualityInspectionManagement',
             component: () =>
                 import(/* webpackChunkName: "sparepartList" */ '@/views/outboundManagement/qualityInspectionManagement'),
-            name: 'qualityInspectionManagement',
+            name:'qualityInspectionManagement',
             meta: {
-                title: 'qualityInspectionManagement',
-                shortcutEntrance: 'outboundManagement',
-                module: 'procurement.procurementOrder.delete',
+                title:'qualityInspectionManagement',
+                shortcutEntrance:'outboundManagement',
+                module:'procurement.procurementOrder.delete',
                 permissicon: [],
                 keepAlive: true
             }
         },
+        // 查看/编辑质检信息
+        {
+            path: 'qualityInspection',
+            component: () =>
+              import(/* webpackChunkName: "sparepartList" */ '@/views/outboundManagement/qualityInspection'),
+            name: 'qualityInspection',
+            meta: {
+              title: 'qualityInspection',
+              shortcutEntrance: 'qualityInspection',
+              
+              module: 'procurement.procurementOrder.delete',
+              permissicon: [],
+              keepAlive: true
+            },
+            hidden: true
+          },
+
         // 付款管理
         {
-            path: 'collectionManagement',
+            path:'collectionManagement',
             component: () =>
                 import(/* webpackChunkName: "sparepartList" */ '@/views/outboundManagement/collectionManagement'),
-            name: 'collectionManagement',
+            name:'collectionManagement',
             meta: {
-                title: 'collectionManagement',
-                shortcutEntrance: 'outboundManagement',
-                module: 'procurement.procurementOrder.delete',
+                title:'collectionManagement',
+                shortcutEntrance:'outboundManagement',
+                module:'procurement.procurementOrder.delete',
                 permissicon: [],
                 keepAlive: true
             }

+ 392 - 0
src/views/outboundManagement/qualityInspection.vue

@@ -0,0 +1,392 @@
+<!--质检信息-->
+<template>
+  <div class="center">
+    <el-row>
+      <el-col :span="12">
+        <h2 class="bg-left titleup">{{ information }}质检信息</h2>
+      </el-col>
+      <el-col :span="12" class="bg-right">
+        <el-button class="bg-bottom" type="primary" size="small" @click="cancel"
+          ><img
+            width="6"
+            height="10"
+            style="vertical-align: bottom; margin-right: 3px"
+            src="../../../public/img/lujing.png"
+            alt=""
+          />返回</el-button
+        >
+      </el-col>
+    </el-row>
+    <div class="substance">
+      <ws-form>
+        <div style="width: 50%; margin: 0 auto">
+          <div class="title">基本信息</div>
+          <ws-info-table>
+            <ws-form-item label="合同编号" span="1" prop="contractNo">
+              <ws-input
+                v-model="inspect.contractNo"
+                placeholder="请输入合同编号"
+                maxlength="100"
+                disabled
+                size="small"
+              />
+            </ws-form-item>
+            <ws-form-item label="仓位号" span="1" prop="binNumber">
+              <ws-input
+                v-model="inspect.binNumber"
+                placeholder="请输入仓位号"
+                maxlength="100"
+                disabled
+                size="small"
+              />
+            </ws-form-item>
+            <ws-form-item label="囤位号" span="1" prop="storageTagNo">
+             <ws-input
+                v-model="inspect.storageTagNo"
+                placeholder="请输入囤位号"
+                maxlength="100"
+                disabled
+                size="small"
+              />
+            </ws-form-item>
+            <ws-form-item label="车牌号" span="1" prop="carNumber">
+               <ws-input
+                v-model="inspect.carNumber"
+                placeholder="请输入车牌号"
+                maxlength="100"
+                disabled
+                size="small"
+              />
+            </ws-form-item>
+            <ws-form-item label="货名" span="1" prop="goodsName">
+              <ws-input
+                v-model="inspect.goodsName"
+                placeholder="请输入货名"
+                maxlength="100"
+                disabled
+                size="small"
+              />
+            </ws-form-item>
+          </ws-info-table>
+
+          <div class="title">质检数据</div>
+          <ws-info-table>
+            <ws-form-item label="等级" span="1" prop="grade">
+              <ws-select
+                v-model="inspect.grade"
+                placeholder="请输入等级"
+                class="typeselect"
+                @change="waterContentChange"
+                :disabled="disabled"
+              >
+                <ws-option
+                  v-for="item in gradeList"
+                  :key="item.constKey"
+                  :label="item.constValue"
+                  :value="item.constValue"
+                />
+              </ws-select>
+            </ws-form-item>
+            <ws-form-item label="杂质(%)" span="1" prop="impurity">
+              <ws-input
+                v-model="inspect.impurity"
+                placeholder="请输入杂质占比"
+                maxlength="100"
+                size="small"
+                :disabled="disabled"
+              />
+            </ws-form-item>
+            <ws-form-item label="水分(%)" span="1" prop="waterContent">
+              <ws-input
+                v-model="inspect.waterContent"
+                placeholder="请输入水分占比"
+                maxlength="100"
+                size="small"
+                @change = "waterContentChange"
+                :disabled="disabled"
+              />
+            </ws-form-item>
+            <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
+              <ws-input
+                v-model="inspect.mildewGrain"
+                placeholder="请输入霉变粒占比"
+                maxlength="100"
+                size="small"
+                :disabled="disabled"
+              />
+            </ws-form-item>
+            <ws-form-item label="容重(克/升)" span="1" prop="bulkDensity">
+              <ws-input
+                v-model="inspect.bulkDensity"
+                placeholder="请输入容重"
+                maxlength="100"
+                size="small"
+                :disabled="disabled"
+              />
+            </ws-form-item>
+            <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
+              <ws-input
+                v-model="inspect.jiaorenli"
+                placeholder="请输入热损伤占比"
+                maxlength="100"
+                size="small"
+                :disabled="disabled"
+              />
+            </ws-form-item>
+            <ws-form-item label="不完整粒(%)" span="1" prop="imperfectGrain">
+              <ws-input
+                v-model="inspect.imperfectGrain"
+                placeholder="请输入不完整粒占比"
+                maxlength="100"
+                size="small"
+                :disabled="disabled"
+              />
+            </ws-form-item>
+          </ws-info-table>
+          <div class="but">
+            <el-button @click="cancel" v-if="this.types != 2" type="primary"
+              >取消</el-button
+            >
+            <el-button @click="print" v-if="this.types != 2" type="primary"
+              >提交</el-button
+            >
+            <el-button @click="cancel" v-if="this.types == 2" type="primary"
+              >关闭</el-button
+            >
+          </div>
+        </div>
+      </ws-form>
+    </div>
+  </div>
+</template>
+<script>
+import {
+  addOut,
+  getinspectLook,
+} from '@/model/outboundManagement/index'
+import { packList } from '@/model/contarct/index'
+// import houseSelfCollectPrint from './houseSelfCollectPrint.vue'
+export default {
+  components: {
+    //houseSelfCollectPrint,
+  },
+  watch: {},
+  data() {
+    return {
+      inspect: {},
+      disabled: false,
+      types: '1',
+      information : '添加',
+      goodnameList: [],
+      gradeList: [],
+      customerList: [],
+      getbinNumberList: [],
+      cangid: '', //仓库id
+      warehouseName:'',
+       unitPrice:0,
+       count:0,
+       cangNo:'',
+    }
+  },
+  activated() {
+    this.types = this.$route.query.type
+    this.cangid = this.$route.query.cangid
+    this.warehouseName = this.$route.query.warehouseName
+    this.inspect.contractNo = this.$route.query.contractNo
+    this.inspect.binNumber = this.$route.query.binNumber
+    this.inspect.carNumber = this.$route.query.carNumber
+    this.inspect.goodsName = this.$route.query.goodsName
+    this.inspect.storageTagNo = this.$route.query.storageTagNo
+    //this.inspect.personCharge = this.$route.query.personCharge
+    let id = this.$route.query.id
+    this.cangNo = this.$route.query.warehouseNo
+    this.count = Number(this.$route.query.count)+1 
+    if (this.types == 2) {
+      this.disabled = true
+      this.information = '查看'
+    }
+    // this.calculation()
+    this.getList(id)
+  },
+  methods: {
+    getdate() {
+      var date = new Date()
+      var year = date.getFullYear() //获取完整的年份(4位)
+      var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
+      var datetime = date.getDate() //获取当前日(1-31)
+      if (mouth < 10) {
+        mouth = '0' + mouth
+      }
+      if (datetime < 10) {
+        datetime = '0' + datetime
+      }
+      return year + mouth + datetime
+    },
+    // calculation() {
+    //   let number ='000'+ this.count
+    //   number = number.substring(number.length - 4,number.length)
+    //   this.inspect.qualityNo = 'SGRK' + this.getdate()+this.cangNo+number //SGRK+8位时间+3位仓库编号+4位序列号
+    //   // + this.verifyinit()
+    // },
+    print() {
+      this.inspect.warehouseName = this.warehouseName
+      this.inspect.id = this.$route.query.id
+      this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
+          this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
+      // if(this.types == null || this.types == ''){
+         this.$confirm('确定保存质检信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          
+          addOut(this.inspect)
+            .toPromise()
+            .then((response) => {
+              this.$message.success('保存成功')
+              // this.xx = true;
+              // let newstr = document.getElementById('print').innerHTML
+              // let oldstr = document.body.innerHTML
+              // document.body.innerHTML = newstr
+              // window.print()
+              // document.body.innerHTML = oldstr
+              // // window.location.reload()
+              this.$router.push({ path: 'qualityInspectionManagement' })
+            })
+        })
+        .catch(() => {
+          return false
+        })
+
+      // }else if(this.types == 1){
+      //    this.$confirm('确定保存质检信息?', '提示', {
+      //   confirmButtonText: '确定',
+      //   cancelButtonText: '取消',
+      //   type: 'warning',
+      // })
+      //   .then(() => {
+      //     // return
+      //     getinspectEdit(this.inspect)
+      //       .toPromise()
+      //       .then((response) => {
+      //         this.$message.success('修改成功')
+      //         // this.xx = true;
+      //         // let newstr = document.getElementById('print').innerHTML
+      //         // let oldstr = document.body.innerHTML
+      //         // document.body.innerHTML = newstr
+      //         // window.print()
+      //         // document.body.innerHTML = oldstr
+      //         // window.location.reload()
+      //         this.$router.push({ path: 'paymentManagement' })
+      //       })
+      //   })
+      //   .catch(() => {
+      //     return false
+      //   })
+
+      // }
+     
+    },
+    cancel() {
+      this.$router.push({ path: 'qualityInspectionManagement' })
+    },
+    getList(ids) {
+      // 品级
+      packList({ constId: 'CON3' })
+        .toPromise()
+        .then((response) => {
+          this.gradeList = response
+        })
+      if (this.types == 2) {
+        //查看
+        getinspectLook({ id: ids })
+          .toPromise()
+          .then((response) => {
+            this.inspect = response
+          })
+      }
+    },
+  },
+}
+</script>
+<style lang="scss" scoped>
+.center {
+  background: #f6f7fc;
+}
+
+.ws-info-table {
+  border: none;
+}
+.ws-info-table .el-form-item {
+  width: 50%;
+  border: none;
+}
+/deep/.ws-info-table .el-form-item .el-form-item__label {
+  width: 30%;
+  text-align: center;
+  background: #ffffff;
+  font-size: 14px;
+  color: #8890b1;
+}
+/deep/.ws-info-table .el-form-item .el-form-item__content {
+  border: none;
+}
+.title {
+  font-size: 16px;
+  font-weight: 600;
+  margin: 10px;
+}
+.titleup {
+  position: relative;
+}
+.title::before {
+  content: '';
+  display: inline-block;
+  width: 5px;
+  height: 15px;
+  background: #8890b1;
+  margin-right: 5px;
+}
+
+.substance {
+  background: #ffffff;
+  width: 100%;
+  border-radius: 4px;
+  margin: 0 auto;
+  padding-top: 20px;
+}
+/deep/.el-table .el-table__header .cell,
+.el-table .el-table__body .cell {
+  text-align: center;
+}
+/deep/.el-table--enable-row-transition .el-table__body td {
+  text-align: center;
+}
+.bg-left {
+  padding-left: 30px;
+}
+.bg-right {
+  padding-right: 10px;
+  text-align: right;
+}
+.bg-bottom {
+  margin: 15px 0px;
+}
+.titleup {
+  position: relative;
+}
+.titleup::before {
+  content: '';
+  display: inline-block;
+  width: 5px;
+  height: 30px;
+  background: #5473e8;
+  position: absolute;
+  left: 0;
+}
+.but {
+  text-align: center;
+  margin: 20px auto;
+}
+</style>

+ 222 - 0
src/views/outboundManagement/qualityInspectionManagement.vue

@@ -0,0 +1,222 @@
+<!--质检管理-->
+<template>
+  <div>
+    <BaseHeaderLayout :leftSpan="12">
+      <template slot="right">
+        <ws-select
+          v-model="warehouseName"
+          placeholder=""
+          @change="selecttaskType"
+          :value="searchType"
+        >
+          <ws-option
+            v-for="item in warehouseList"
+            :key="item.value"
+            :label="item.value"
+            :value="item.value"
+            style="color: #8890b1"
+          />
+        </ws-select>
+        <div></div>
+        <ws-input
+          v-model="searchKeyWord"
+          placeholder="可按合同编号、车牌号查找"
+          clearable
+          maxlength="500"
+          type="input"
+        ></ws-input>
+        <ws-button class="find" type="primary" @click="find()"
+          ><img
+            width="16"
+            height="16"
+            style="
+              vertical-align: text-top;
+              position: relative;
+              top: 0px;
+              left: -8px;
+            "
+            src="../../../public/img/sousuo.png"
+            alt=""
+        /></ws-button>
+      </template>
+    </BaseHeaderLayout>
+    <el-table
+      :data="inspect"
+      style="width: 100%; margin-top: 20px"
+      ref="inspect"
+      border
+      height="780"
+    >
+      <el-table-column type="index" label="序号" width="50">
+        <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="contractNo" label="合同编号"></el-table-column>
+      <el-table-column prop="carNumber" label="车牌号"></el-table-column>
+      <el-table-column prop="goodsName" label="货名"></el-table-column>
+       <el-table-column prop="bulkDensity" label="容重(克/升)"></el-table-column>
+      <el-table-column prop="waterContent" label="水分(%)"></el-table-column>
+      <el-table-column prop="binNumber" label="仓位号"></el-table-column>
+      <el-table-column prop="storageTagNo" label="囤位号"></el-table-column>
+      <el-table-column prop="qualityInspector" label="质检员"></el-table-column>
+      <el-table-column prop="updateDate" label="质检时间"></el-table-column>
+      <el-table-column prop="status" label="状态"></el-table-column>
+      <el-table-column width="300" label="操作">
+        <template slot-scope="scope">
+          <span v-if="scope.row.status == '已质检'"><el-button @click="qualityInspection(scope.row, 2)">查看</el-button></span>
+          <span v-if="scope.row.status == '已称皮重' || scope.row.status == '' || scope.row.status == null"><el-button @click="qualityInspection(scope.row, 1)">质检</el-button></span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="text-align: center">
+      <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 {
+  selectWarehouseSelf,
+  getinspectList,
+} from '@/model/outboundManagement/index'
+
+export default {
+  components: {},
+  watch: {},
+  data() {
+    return {
+      //分页
+      currentPage: 1,
+      pageSize: 10,
+      deptCircularPage: {},
+      deptBudgetTotal: 0,
+
+      searchKeyWord: '',
+      taskTypeList: [],
+      searchType: 0,
+      warehouseName: '',
+      inspect: [],
+      warehouseList: [],
+      cangid: '', //仓库id
+    }
+  },
+  activated() {
+    this.getList()
+  },
+  methods: {
+    find(){
+     this.getList()
+    },
+    qualityInspection(row, index) {
+      //添加/查看
+      console.log(row.id, 'id值')
+      this.$router.push({
+        path: 'qualityInspection',
+        query: { type: index, cangid: this.cangid, id: row.id ,warehouseName:this.warehouseName,count:this.warehouseCount,
+        warehouseNo:this.warehouseNo,contractNo:row.contractNo,binNumber:row.binNumber,carNumber:row.carNumber,
+        storageTagNo:row.storageTagNo,goodsName:row.goodsName},
+      })
+    },
+    selecttaskType(e) {
+      console.log(e)
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`)
+      this.pageSize = val
+      this.getList()
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val
+      console.log(`当前页: ${val}`)
+      this.getList()
+    },
+    getList() {
+      selectWarehouseSelf({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        personCharge: sessionStorage.getItem('ws-pf_staffName'),
+      })
+        .toPromise()
+        .then((response) => {
+          this.warehouseList = []
+          for (let i = 0; i < response.length; i++) {
+            this.warehouseList.push({
+              // valueKey: i,
+              value: response[i].warehouseName,
+              id: response[i].id,
+            })
+          }
+          this.warehouseName = response[0].warehouseName
+          this.cangid = response[0].id
+        })
+
+      getinspectList({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        currentPage: this.currentPage,
+        pageSize: this.pageSize,
+        searchKeyWord: this.searchKeyWord,
+        warehouseName: this.warehouseName,
+      })
+        .toPromise()
+        .then((response) => {
+          // for (let i = 0; i < response.length; i++) {
+          //   this.warehouseList.push({
+          //     valueKey: i,
+          //     value: response[i].warehouseName,
+          //     id:response[i].id
+          //   })
+          // }
+          // this.searchTypeText = response[0].warehouseName
+          // this.id = response[0].id
+          // console.log(response)
+          this.inspect = response.records
+          console.log(this.inspect,'容重')
+          this.deptBudgetTotal = response.total
+        })
+    },
+  },
+}
+</script>
+<style lang="scss" scoped>
+.title {
+  font-size: 20px;
+  font-weight: 600;
+  margin: 20px 0 0 20px;
+}
+.tit {
+  font-size: 16px;
+  font-weight: 600;
+  margin: 20px;
+}
+.ws-info-table {
+  border: none;
+}
+.ws-info-table .el-form-item {
+  width: 50%;
+  border: none;
+}
+/deep/.ws-info-table .el-form-item .el-form-item__label {
+  width: 30%;
+  text-align: center;
+  background: #ffffff;
+  color: #8890b1;
+}
+/deep/.ws-info-table .el-form-item .el-form-item__content {
+  border: none;
+}
+/deep/.el-table .el-table__header .cell,
+.el-table .el-table__body .cell {
+  text-align: center;
+}
+/deep/.el-table--enable-row-transition .el-table__body td {
+  text-align: center;
+}
+</style>