|
@@ -717,62 +717,63 @@
|
|
.then(() => {
|
|
.then(() => {
|
|
if (this.tpyeNo == 1) {
|
|
if (this.tpyeNo == 1) {
|
|
//毛检保存前进行校验
|
|
//毛检保存前进行校验
|
|
- getamount({
|
|
|
|
- compId: localStorage.getItem('ws-pf_compId'),
|
|
|
|
- customerName: this.weighingList.customer,
|
|
|
|
- goodsName: this.weighingList.goodsName,
|
|
|
|
- })
|
|
|
|
- .toPromise()
|
|
|
|
- .then((response) => {
|
|
|
|
- for (let i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
|
- if (
|
|
|
|
- this.weighingList.goodsName == this.purchasePriceList[i].goodsName
|
|
|
|
- ) {
|
|
|
|
- //累计售粮超上限不能完成毛检保存
|
|
|
|
- let count = (this.purchasePriceList[i].saleLimit - response / 1000).toFixed(2)
|
|
|
|
- // console.log(this.weighingList.grossWeight / 1000, '毛重转吨')
|
|
|
|
- // this.weighingList.grossWeight/=1000
|
|
|
|
- if (count - this.weighingList.grossWeight / 1000 < 0) {
|
|
|
|
- this.$alert(
|
|
|
|
- '该客户累计销售' +
|
|
|
|
- this.weighingList.goodsName +
|
|
|
|
- (response / 1000).toFixed(2) +
|
|
|
|
- '吨,还可售粮' +
|
|
|
|
- count +
|
|
|
|
- '吨',
|
|
|
|
- '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- callback: (action) => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: `累计售粮已超出上限`,
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
- } else {
|
|
|
|
- //累计售粮没有超上限完成毛检保存
|
|
|
|
- // this.weighingList.relationId = this.relationId;
|
|
|
|
- this.weighingList.secretaryWeigher = localStorage.getItem('ws-pf_staffName'),
|
|
|
|
- grossWeight(this.weighingList)
|
|
|
|
- .toPromise()
|
|
|
|
- .then((response) => {
|
|
|
|
- if(this.reader){
|
|
|
|
- this.reader.cancel()
|
|
|
|
- }
|
|
|
|
- this.$notify.success({
|
|
|
|
- title: '成功',
|
|
|
|
- message: '保存成功',
|
|
|
|
- })
|
|
|
|
- // this.$router.go(-1)
|
|
|
|
- })
|
|
|
|
- .catch((response) => {
|
|
|
|
- // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // getamount({
|
|
|
|
+ // compId: localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ // customerNumberCard:"210881198710041111",
|
|
|
|
+ // // customerNumberCard:this.weighingList.customerNumberCard,
|
|
|
|
+ // goodsName: this.weighingList.goodsName,
|
|
|
|
+ // })
|
|
|
|
+ // .toPromise()
|
|
|
|
+ // .then((response) => {
|
|
|
|
+ // for (let i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
|
+ // if (
|
|
|
|
+ // this.weighingList.goodsName == this.purchasePriceList[i].goodsName
|
|
|
|
+ // ) {
|
|
|
|
+ // //累计售粮超上限不能完成毛检保存
|
|
|
|
+ // let count = (this.purchasePriceList[i].saleLimit - response / 1000).toFixed(2)
|
|
|
|
+ // // console.log(this.weighingList.grossWeight / 1000, '毛重转吨')
|
|
|
|
+ // // this.weighingList.grossWeight/=1000
|
|
|
|
+ // if (count - this.weighingList.grossWeight / 1000 < 0) {
|
|
|
|
+ // this.$alert(
|
|
|
|
+ // '该客户累计销售' +
|
|
|
|
+ // this.weighingList.goodsName +
|
|
|
|
+ // (response / 1000).toFixed(2) +
|
|
|
|
+ // '吨,还可售粮' +
|
|
|
|
+ // count +
|
|
|
|
+ // '吨',
|
|
|
|
+ // '提示', {
|
|
|
|
+ // confirmButtonText: '确定',
|
|
|
|
+ // callback: (action) => {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // type: 'info',
|
|
|
|
+ // message: `累计售粮已超出上限`,
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
|
|
+ // }
|
|
|
|
+ // )
|
|
|
|
+ // } else {
|
|
|
|
+ // //累计售粮没有超上限完成毛检保存
|
|
|
|
+ // // this.weighingList.relationId = this.relationId;
|
|
|
|
+ // this.weighingList.secretaryWeigher = localStorage.getItem('ws-pf_staffName'),
|
|
|
|
+ // grossWeight(this.weighingList)
|
|
|
|
+ // .toPromise()
|
|
|
|
+ // .then((response) => {
|
|
|
|
+ // if(this.reader){
|
|
|
|
+ // this.reader.cancel()
|
|
|
|
+ // }
|
|
|
|
+ // this.$notify.success({
|
|
|
|
+ // title: '成功',
|
|
|
|
+ // message: '保存成功',
|
|
|
|
+ // })
|
|
|
|
+ // // this.$router.go(-1)
|
|
|
|
+ // })
|
|
|
|
+ // .catch((response) => {
|
|
|
|
+ // // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
} else if (this.tpyeNo == 2) {
|
|
} else if (this.tpyeNo == 2) {
|
|
// this.weighingList.grossWeight/=1000
|
|
// this.weighingList.grossWeight/=1000
|
|
// this.weighingList.tare/=1000
|
|
// this.weighingList.tare/=1000
|