Przeglądaj źródła

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

gjy 2 lat temu
rodzic
commit
729a187adf

+ 2 - 0
src/api/V2/houseSelfCollect/index.js

@@ -124,6 +124,8 @@ export const API_SPONSOR_WITHDRAW ='/newWorkflow/api/stopInstance'
 export const API_GET_BASEID ='/qualityInspectionManagement/selectBaseId'
 export const API_GET_BASEID ='/qualityInspectionManagement/selectBaseId'
 // 换任务号
 // 换任务号
 export const API_POST_TASK_NO = `/weighingManagement/api/changeTaskNo`
 export const API_POST_TASK_NO = `/weighingManagement/api/changeTaskNo`
+// 换客户
+export const API_POST_CUSTOMER = `/weighingManagement/api/changeCustomer`
 // 丹东港生成入库单
 // 丹东港生成入库单
 export const API_POST_DANDONG_ORDER = `/paymentManagement/api/generateOrder`
 export const API_POST_DANDONG_ORDER = `/paymentManagement/api/generateOrder`
 // 检查客户送粮量
 // 检查客户送粮量

+ 3 - 0
src/model/houseSelfCollect/index.js

@@ -61,6 +61,7 @@ import {
   API_POST_SUBMIT,
   API_POST_SUBMIT,
   API_POST_CHANE_NO,
   API_POST_CHANE_NO,
   API_POST_TASK_NO,
   API_POST_TASK_NO,
+  API_POST_CUSTOMER,
   API_POST_DANDONG_ORDER,
   API_POST_DANDONG_ORDER,
   API_POST_DELETE,
   API_POST_DELETE,
   API_GET_CONTRACT,
   API_GET_CONTRACT,
@@ -200,3 +201,5 @@ export const changeTaskNo = appRx.post(API_POST_TASK_NO, errorCatcher, errorHand
 export const dandongOrder = appRx.post(API_POST_DANDONG_ORDER, errorCatcher, errorHandle, filter)
 export const dandongOrder = appRx.post(API_POST_DANDONG_ORDER, errorCatcher, errorHandle, filter)
 // 检查客户送粮量
 // 检查客户送粮量
 export const getquality = appRx.get(API_GETQUALITY, errorCatcher, errorHandle, filter)
 export const getquality = appRx.get(API_GETQUALITY, errorCatcher, errorHandle, filter)
+// 换客户
+export const changeCustomer = appRx.post(API_POST_CUSTOMER, errorCatcher, errorHandle, filter)

+ 93 - 46
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -452,7 +452,7 @@ export default {
       tpyeNo: '1',
       tpyeNo: '1',
       disabled: true,
       disabled: true,
       relationId: '',
       relationId: '',
-      // warehouseId: '',
+      warehouseId: '',
       purchasePriceList: [],
       purchasePriceList: [],
       isShowPrint: false,
       isShowPrint: false,
       tableData: {},
       tableData: {},
@@ -997,7 +997,8 @@ export default {
         path: 'weightCheckRecord',
         path: 'weightCheckRecord',
         query: {
         query: {
           inWarehouseType: this.inWarehouseType,
           inWarehouseType: this.inWarehouseType,
-          warehouseName: this.warehouseName
+          warehouseName: this.warehouseName,
+          warehouseId: this.cangid
         }
         }
       })
       })
     },
     },
@@ -1814,14 +1815,14 @@ export default {
                             '吨',
                             '吨',
                             '提示', {
                             '提示', {
                             confirmButtonText: '确定',
                             confirmButtonText: '确定',
-                            callback: (action) => {
-                              this.$message({
-                                type: 'info',
-                                message: `累计售粮已超出上限`,
-                              })
-                            },
+                            // callback: (action) => {
+                            //   this.$message({
+                            //     type: 'info',
+                            //     message: `累计售粮已超出上限`,
+                            //   })
+                            // },
                           })
                           })
-                        } else {
+                        } 
                           //累计售粮没有超上限完成毛检保存
                           //累计售粮没有超上限完成毛检保存
                           grossWeight(this.weighingList)
                           grossWeight(this.weighingList)
                             .toPromise()
                             .toPromise()
@@ -1835,7 +1836,6 @@ export default {
                               })
                               })
                               this.getList()
                               this.getList()
                             })
                             })
-                        }
                       })
                       })
                     return
                     return
                   }
                   }
@@ -1989,7 +1989,8 @@ export default {
 
 
             // console.log(this.inWarehouseType)
             // console.log(this.inWarehouseType)
             //贸易入库需要再走入库接口
             //贸易入库需要再走入库接口
-            if (this.inWarehouseType == 1) { //贸易入库皮检
+            if (this.inWarehouseType == 1) {
+               //贸易入库皮检
               getsettleaccout({//查看结算单
               getsettleaccout({//查看结算单
                 id: this.weighingList.warehouseInOutId
                 id: this.weighingList.warehouseInOutId
               }).toPromise().then((response) => {
               }).toPromise().then((response) => {
@@ -2101,43 +2102,89 @@ export default {
 
 
               })
               })
             } else { //收购入库皮检
             } else { //收购入库皮检
-              tare(this.weighingList)
-                .toPromise()
-                .then((response) => {
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
-                  this.$notify.success({
-                    title: '成功',
-                    message: '保存成功',
-                  })
-                  this.idPrint = response
-                  if (this.weighingList.serviceManagementType == 1 && (this.warehouseName == '鲅鱼圈金信库' || this
-                    .warehouseName == '哈尔滨依兰库' || this
-                      .warehouseName == '白城内陆港' || this
-                        .warehouseName == '山东园丰库'|| this
-                        .warehouseName == '杜尔伯特家禾库'||this.warehouseName=='甘南宏旗库'||this.warehouseName=='洮南新友谊兴旺库')) {
-                    if (this.weighingList.seller && this.weighingList.buyer) {
-                      let cang = {}
-                      cang.value = this.weighingList.seller
-                      cang.label = this.weighingList.seller
-                      if (this.check(this.weighingList.seller, 1)) {
-                        this.ewCustomerOptions.push(cang)
-                      }
-                      let cang1 = {}
-                      cang1.value = this.weighingList.buyer
-                      cang1.label = this.weighingList.buyer
-                      if (this.check(this.weighingList.buyer, 2)) {
-                        this.companyNameEWOptions.push(cang1)
-                      }
-                    }
-                  }
-                  this.isShowPrintType = true
-                  this.getList()
+              var arr2 = {}
+              for (let i = 0; i < this.purchasePriceList.length; i++) {
+                if (
+                  this.weighingList.goodsName ==
+                  this.purchasePriceList[i].goodsName
+                ) {
+                  arr2 = JSON.parse(JSON.stringify(this.purchasePriceList[i]))
+                  arr2.saleLimit = this.purchasePriceList[i].saleLimit
+                }
+              }
+              if (Object.keys(arr2).length != 0) {
+                getamount({
+                  compId: localStorage.getItem('ws-pf_compId'),
+                  customerNumberCard: this.weighingList.customerNumberCard,
+                  goodsName: this.weighingList.goodsName,
                 })
                 })
-                .catch((response) => { })
+                  .toPromise()
+                  .then((response) => {
+                    //累计售粮超上限不能完成皮检保存
+                    let count = (
+                       arr2.saleLimit - response / 1000
+                    ).toFixed(2)
+                    if (count - this.weighingList.netWeight / 1000 < 0) {
+                      this.$alert(
+                        '该客户累计销售' +
+                        this.weighingList.goodsName +
+                        (response / 1000).toFixed(2) +
+                        '吨,还可售粮' +
+                        count +
+                        '吨,当前重量已超出售粮上限' + ((this.weighingList.netWeight / 1000).toFixed(2) - count).toFixed(2) + '吨',
+                        '提示',
+                        {
+                          confirmButtonText: '确定',
+                          callback: (action) => {
+                            this.$message({
+                              type: 'info',
+                              message: `累计售粮已超出上限`,
+                            })
+                          },
+                      })
+                    }
+                    else {
+                      //累计售粮没有超上限完成皮检保存
+                      tare(this.weighingList)
+                        .toPromise()
+                        .then((response) => {
+                          // if (this.reader) {
+                          //   this.reader.cancel()
+                          // }
+                          this.$notify.success({
+                            title: '成功',
+                            message: '保存成功',
+                          })
+                          this.idPrint = response
+                          if (this.weighingList.serviceManagementType == 1 && (this.warehouseName == '鲅鱼圈金信库' || this
+                            .warehouseName == '哈尔滨依兰库' || this
+                              .warehouseName == '白城内陆港' || this
+                                .warehouseName == '山东园丰库' || this
+                                  .warehouseName == '杜尔伯特家禾库' || this.warehouseName == '甘南宏旗库' || this.warehouseName == '洮南新友谊兴旺库')) {
+                            if (this.weighingList.seller && this.weighingList.buyer) {
+                              let cang = {}
+                              cang.value = this.weighingList.seller
+                              cang.label = this.weighingList.seller
+                              if (this.check(this.weighingList.seller, 1)) {
+                                this.ewCustomerOptions.push(cang)
+                              }
+                              let cang1 = {}
+                              cang1.value = this.weighingList.buyer
+                              cang1.label = this.weighingList.buyer
+                              if (this.check(this.weighingList.buyer, 2)) {
+                                this.companyNameEWOptions.push(cang1)
+                              }
+                            }
+                          }
+                          this.isShowPrintType = true
+                          this.getList()
+                        })
+                        .catch((response) => { })
+                    }
+                  })
+                return
+              }
             }
             }
-
           }
           }
         })
         })
         .catch(() => {
         .catch(() => {

+ 98 - 4
src/views/houseSelfCollect/weightCheckRecord.vue

@@ -74,14 +74,15 @@
         <el-table-column key="11" prop="secretaryWeigher" label="司称员"></el-table-column>
         <el-table-column key="11" prop="secretaryWeigher" label="司称员"></el-table-column>
         <el-table-column key="12" prop="grossDate" label="检斤时间"></el-table-column>
         <el-table-column key="12" prop="grossDate" label="检斤时间"></el-table-column>
         <el-table-column key="13" prop="status" label="状态"></el-table-column>
         <el-table-column key="13" prop="status" label="状态"></el-table-column>
-        <el-table-column key="14" label="操作" min-width="300">
+        <el-table-column key="14" label="操作" min-width="400">
           <template scope="scope">
           <template scope="scope">
             <!-- <el-button size="small" @click="print(scope.row)">打印</el-button> -->
             <!-- <el-button size="small" @click="print(scope.row)">打印</el-button> -->
             <el-button @click="print(scope.row)" v-if="scope.row.status == '已称皮重' || scope.row.status == '已称毛重'" v-hasPermission="`acquisitionManagement.acquisitionWeight.print`">打印</el-button>
             <el-button @click="print(scope.row)" v-if="scope.row.status == '已称皮重' || scope.row.status == '已称毛重'" v-hasPermission="`acquisitionManagement.acquisitionWeight.print`">打印</el-button>
             <el-button @click="backInfo(scope.row)" v-if="scope.row.status == '已称皮重'">退回</el-button>
             <el-button @click="backInfo(scope.row)" v-if="scope.row.status == '已称皮重'">退回</el-button>
-            <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchange(scope.row)" v-if="scope.row.status == '已称毛重'">换仓</el-button>
-            <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchangeNo(scope.row)" v-if="scope.row.status == '已称毛重'">换任务号</el-button>
-            <el-button @click="deleteInfo(scope.row)" v-if="scope.row.status == '已称毛重'">删除</el-button>
+            <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchange(scope.row)" v-if="scope.row.status == '已称毛重'|| scope.row.status == '已质检'">换仓</el-button>
+            <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchangeNo(scope.row)" v-if="scope.row.status == '已称毛重'|| scope.row.status == '已质检'">换任务号</el-button>
+            <el-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.huan`" class="putstorage" @click="exchangeName(scope.row)" v-if="(scope.row.status == '已称毛重'|| scope.row.status == '已质检') && warehousingType == 3">换客户</el-button>
+            <el-button @click="deleteInfo(scope.row)" v-if="scope.row.status == '已称毛重'|| scope.row.status == '已质检'">删除</el-button>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
       </el-table>
       </el-table>
@@ -192,6 +193,35 @@
             <el-button type="primary" @click="dialogVisibleconfirm1">确 定</el-button>
             <el-button type="primary" @click="dialogVisibleconfirm1">确 定</el-button>
           </span>
           </span>
         </el-dialog>
         </el-dialog>
+        <el-dialog
+          title="提示"
+          :visible.sync="dialogVisible2"
+          width="30%"
+          :before-close="handleClose2">
+          <div style="text-align:center">
+            <el-form ref="form" label-width="110px">
+              <el-form-item label="客户名">
+             <el-select filterable clearable v-model="customerName" placeholder="请选择客户" class="typeselect"
+              @change="customerChange">
+              <el-option v-for="item in customerlist" :key="item.customerName" :label="item.customerName"
+                :value="item.customerName" />
+            </el-select>
+            </el-form-item>
+           <el-form-item label="手机号">
+            <el-input v-model="customerPhone" placeholder="手机号" :disabled="disabled" maxlength="15">
+            </el-input>
+             </el-form-item>
+             <el-form-item label="身份证号码">
+            <el-input v-model="customerNumberCard" placeholder="身份证号码" :disabled="disabled" maxlength="20">
+            </el-input>
+             </el-form-item>
+         </el-form>
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="dialogVisible2 = false">取 消</el-button>
+            <el-button type="primary" @click="dialogVisibleconfirm2">确 定</el-button>
+          </span>
+        </el-dialog>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -202,6 +232,8 @@
     returnInfo,
     returnInfo,
     changeNo,
     changeNo,
     changeTaskNo,
     changeTaskNo,
+    changeCustomer,
+    getcustomer,
     importWordYk,
     importWordYk,
     getweighingDelete
     getweighingDelete
   } from '@/model/houseSelfCollect/index'
   } from '@/model/houseSelfCollect/index'
@@ -371,13 +403,18 @@
         endDate:'',
         endDate:'',
         dialogVisible:false,
         dialogVisible:false,
         dialogVisible1:false,
         dialogVisible1:false,
+        dialogVisible2:false,
         binNumber:'',
         binNumber:'',
         binnumberList:[],
         binnumberList:[],
         taskNolist:[],
         taskNolist:[],
+        customerlist:[],
         cangweiNum:'',
         cangweiNum:'',
         contractNum:'',
         contractNum:'',
         inOutTaskNo:'',
         inOutTaskNo:'',
+        customerName:'',
         contractNo:'',
         contractNo:'',
+        customerPhone:'',
+        customerNumberCard:'',
         positionId:'',
         positionId:'',
         warehouseInOutDetail:{},
         warehouseInOutDetail:{},
       }
       }
@@ -525,6 +562,7 @@
       this.compId = localStorage.getItem('ws-pf_compId')
       this.compId = localStorage.getItem('ws-pf_compId')
       this.warehousingType = this.$route.query.inWarehouseType
       this.warehousingType = this.$route.query.inWarehouseType
       this.warehouseName = this.$route.query.warehouseName //仓库名
       this.warehouseName = this.$route.query.warehouseName //仓库名
+      this.warehouseId = this.$route.query.warehouseId 
       this.getList()
       this.getList()
     },
     },
     methods: {
     methods: {
@@ -661,6 +699,15 @@
           }
           }
         }
         }
       },
       },
+      customerChange(e){
+        this.customerName = e
+        for(let i = 0 ; i < this.customerlist.length ; i++){
+          if(this.customerName == this.customerlist[i].customerName){
+            this.customerPhone = this.customerlist[i].customerPhone
+            this.customerNumberCard = this.customerlist[i].customerNumberCard
+          }
+        }
+      },
       handleClose(){
       handleClose(){
         this.dialogVisible = false
         this.dialogVisible = false
       },
       },
@@ -668,6 +715,12 @@
         this.inOutTaskNo=''
         this.inOutTaskNo=''
         this.dialogVisible1 = false
         this.dialogVisible1 = false
       },
       },
+      handleClose2(){
+        this.customerName=''
+        this.customerPhone=''
+        this.customerNumberCard=''
+        this.dialogVisible2 = false
+      },
       dialogVisibleconfirm(){
       dialogVisibleconfirm(){
         if(this.binNumber == this.cangweiNum){
         if(this.binNumber == this.cangweiNum){
           this.$message.error('已是该仓位无需修改')
           this.$message.error('已是该仓位无需修改')
@@ -720,6 +773,30 @@
           .catch(() => {
           .catch(() => {
             return false
             return false
           })
           })
+      },
+      dialogVisibleconfirm2(){
+        this.$confirm(`确定修改客户?`, {
+            cancelButtonText: '取消',
+            confirmButtonText: '确定',
+            type: 'warning',
+          })
+          .then(() => {
+              changeCustomer({id:this.id,customer:this.customerName,customerPhone:this.customerPhone,customerNumberCard:this.customerNumberCard}).toPromise()
+						.then((response) => {
+              this.$notify.success({
+                  title: '成功',
+                  message: '修改客户成功',
+                })
+                this.getList()
+                this.customerName=''
+                this.customerPhone=''
+                this.customerNumberCard=''
+                this.dialogVisible2=false
+						})
+          })
+          .catch(() => {
+            return false
+          })
       },
       },
         exchange(row){
         exchange(row){
           for(let i = 0 ; i < this.warehouseList.length; i++ ){
           for(let i = 0 ; i < this.warehouseList.length; i++ ){
@@ -751,6 +828,18 @@
             this.contractNum = row.contractNo
             this.contractNum = row.contractNo
             this.dialogVisible1 = true
             this.dialogVisible1 = true
        },
        },
+       exchangeName(row){
+           getcustomer({
+            warehouseId: this.warehouseId,
+            goodsName: row.goodsName
+          })
+          .toPromise()
+          .then((response) => {
+            this.customerlist = response
+          })
+            this.id = row.id
+            this.dialogVisible2 = true
+       },
        backInfo(row){
        backInfo(row){
            this.$confirm('确定要退回该信息?', '提示', {
            this.$confirm('确定要退回该信息?', '提示', {
             confirmButtonText: '确定',
             confirmButtonText: '确定',
@@ -1049,6 +1138,11 @@
         }
         }
       },
       },
       warehouseNameChange() {
       warehouseNameChange() {
+        for(let i = 0 ; i < this.warehouseList.length; i++ ){
+            if(this.warehouseName == this.warehouseList[i].warehouseName){
+              		this.warehouseId = this.warehouseList[i].id
+            }
+          }
         this.getList()
         this.getList()
       },
       },
       handleSizeChange(val) {
       handleSizeChange(val) {

+ 43 - 5
src/views/profitable/fixedAssets.vue

@@ -71,9 +71,36 @@
                     <el-table-column prop="businessType" label="类型" width="150"></el-table-column>
                     <el-table-column prop="businessType" label="类型" width="150"></el-table-column>
                     <el-table-column prop="leadingCadre" label="负责人"></el-table-column>
                     <el-table-column prop="leadingCadre" label="负责人"></el-table-column>
                     <el-table-column prop="purchaseQuantity" label="数量"></el-table-column>
                     <el-table-column prop="purchaseQuantity" label="数量"></el-table-column>
-                    <el-table-column prop="purchasePrice" width="120" label="采购单价(元)"></el-table-column>
-                    <el-table-column prop="currentPrice" width="120" label="当前单价(元)"></el-table-column>
-                    <el-table-column prop="totalPrice" width="120" label="总价(元)"></el-table-column>
+                    <el-table-column prop="purchasePrice" width="120" label="采购单价(元)">
+                        <template scope="scope">
+                            <div v-if="!scope.row.purchasePrice">
+                                <span>暂无</span>
+                            </div>
+                            <div v-else>
+                                {{scope.row.purchasePrice}}
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="currentPrice" width="120" label="当前单价(元)">
+                        <template scope="scope">
+                            <div v-if="!scope.row.currentPrice">
+                                <span>暂无</span>
+                            </div>
+                            <div v-else>
+                                {{scope.row.currentPrice}}
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="totalPrice" width="120" label="总价(元)">
+                        <template scope="scope">
+                            <div v-if="!scope.row.totalPrice">
+                                <span>暂无</span>
+                            </div>
+                            <div v-else>
+                                {{scope.row.totalPrice}}
+                            </div>
+                        </template>
+                    </el-table-column>
                     <!-- <el-table-column prop="expenseRemarks" label="附件">
                     <!-- <el-table-column prop="expenseRemarks" label="附件">
                                 <template slot-scope="scope">
                                 <template slot-scope="scope">
                                   <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
                                   <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
@@ -98,7 +125,16 @@
                             </div>
                             </div>
                         </template>
                         </template>
                     </el-table-column>
                     </el-table-column>
-                    <el-table-column prop="purchaseDate" label="采购日期" width="150"></el-table-column>
+                    <el-table-column prop="purchaseDate" label="采购日期" width="150">
+                        <template scope="scope">
+                            <div v-if="scope.row.purchaseDate == '1991-12-01'">
+                                <span>暂无</span>
+                            </div>
+                            <div v-else>
+                                {{scope.row.purchaseDate}}
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column prop="remark" width="120" label="备注">
                     <el-table-column prop="remark" width="120" label="备注">
                         <template scope="scope">
                         <template scope="scope">
                             <div v-if="!scope.row.select" @click.stop="lookRemark(scope.row)">
                             <div v-if="!scope.row.select" @click.stop="lookRemark(scope.row)">
@@ -425,7 +461,9 @@ export default {
                         obj.status = v.状态
                         obj.status = v.状态
                         obj.businessType = v.经营方式
                         obj.businessType = v.经营方式
                         obj.remark = v.备注
                         obj.remark = v.备注
-                        obj.purchaseDate = _this.formatDate(v.采购日期, '-')
+                        if(obj.purchaseDate){
+                            obj.purchaseDate = _this.formatDate(v.采购日期, '-')
+                        }
                         _this.excelFreightspace.push(obj)
                         _this.excelFreightspace.push(obj)
                     })
                     })
                     if (_this.excelFreightspace) {
                     if (_this.excelFreightspace) {