|
@@ -48,13 +48,18 @@
|
|
:value="item.goodsName" />
|
|
:value="item.goodsName" />
|
|
</ws-select>
|
|
</ws-select>
|
|
</ws-form-item>
|
|
</ws-form-item>
|
|
- <ws-form-item v-if="inspect.paramType != '1'" label="扣重比" span="1" prop="buckleWeightRatio">
|
|
|
|
|
|
+
|
|
|
|
+ <ws-form-item v-if="inspect.paramType != '1'" label="扣重比" span="1" prop="buckleWeightRatio">
|
|
<ws-input type="number" @mousewheel.native.prevent v-model="inspect.buckleWeightRatio" placeholder="请输入扣重比" maxlength="100" size="small"
|
|
<ws-input type="number" @mousewheel.native.prevent v-model="inspect.buckleWeightRatio" placeholder="请输入扣重比" maxlength="100" size="small"
|
|
:disabled="disabled" />
|
|
:disabled="disabled" />
|
|
</ws-form-item>
|
|
</ws-form-item>
|
|
- <ws-form-item v-else label="扣杂" span="1" prop="buckleMiscellaneous">
|
|
|
|
- <ws-input type="number" @mousewheel.native.prevent v-model="inspect.buckleMiscellaneous" @input="waterContentChange" placeholder="请输入扣杂" maxlength="100" size="small"
|
|
|
|
|
|
+ <ws-form-item v-else label="扣杂" span="1" prop="buckleWeightRatio">
|
|
|
|
+ <ws-input type="number" @mousewheel.native.prevent v-model="inspect.buckleMiscellaneous" placeholder="请输入扣杂" maxlength="100" size="small"
|
|
|
|
+ :disabled="disabled" />
|
|
|
|
+ <ws-input v-if='types==4||inspect.reBuckleMiscellaneous!=null' type="number" @mousewheel.native.prevent v-model="inspect.reBuckleMiscellaneous" placeholder="请输入扣杂" maxlength="100" size="small"
|
|
:disabled="disabled" />
|
|
:disabled="disabled" />
|
|
|
|
+ <ws-input v-else type="number" @mousewheel.native.prevent v-model="inspect.reBuckleMiscellaneous" placeholder="未复检" maxlength="100" size="small"
|
|
|
|
+ disabled />
|
|
</ws-form-item>
|
|
</ws-form-item>
|
|
<ws-form-item label="类型" span="1" prop="type">
|
|
<ws-form-item label="类型" span="1" prop="type">
|
|
<ws-select v-model="inspect.type" :disabled="disabled" @change="typeChange">
|
|
<ws-select v-model="inspect.type" :disabled="disabled" @change="typeChange">
|
|
@@ -89,6 +94,10 @@
|
|
<ws-form-item label="水分(%)" span="1" prop="waterContent">
|
|
<ws-form-item label="水分(%)" span="1" prop="waterContent">
|
|
<ws-input type="number" @mousewheel.native.prevent v-model="inspect.waterContent" placeholder="请输入水分占比" maxlength="100" size="small"
|
|
<ws-input type="number" @mousewheel.native.prevent v-model="inspect.waterContent" placeholder="请输入水分占比" maxlength="100" size="small"
|
|
@change="waterContentChange('water')" :disabled="disabled" />
|
|
@change="waterContentChange('water')" :disabled="disabled" />
|
|
|
|
+ <ws-input v-if='types==4||inspect.reWaterContent!=null' type="number" @mousewheel.native.prevent v-model="inspect.reWaterContent" placeholder="请输入水分占比" maxlength="100" size="small"
|
|
|
|
+ :disabled="disabled" />
|
|
|
|
+ <ws-input v-else type="number" @mousewheel.native.prevent v-model="inspect.reWaterContent" placeholder="未复检" maxlength="100" size="small"
|
|
|
|
+ disabled />
|
|
</ws-form-item>
|
|
</ws-form-item>
|
|
<ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
|
|
<ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
|
|
<ws-input type="number" @mousewheel.native.prevent v-model="inspect.mildewGrain" placeholder="请输入霉变粒占比" maxlength="100" size="small"
|
|
<ws-input type="number" @mousewheel.native.prevent v-model="inspect.mildewGrain" placeholder="请输入霉变粒占比" maxlength="100" size="small"
|
|
@@ -109,7 +118,8 @@
|
|
</ws-info-table>
|
|
</ws-info-table>
|
|
<div class="but">
|
|
<div class="but">
|
|
<el-button @click="cancel" v-if="this.types != 2" type="primary">取消</el-button>
|
|
<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="print" v-if="this.types ==3 || this.types ==4 ||this.types ==1" type="primary">保存</el-button>
|
|
|
|
+ <el-button @click="print" v-if="this.types ==5 " type="primary">保存并打印</el-button>
|
|
<el-button @click="cancel" v-if="this.types == 2" type="primary">关闭</el-button>
|
|
<el-button @click="cancel" v-if="this.types == 2" type="primary">关闭</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -156,10 +166,10 @@
|
|
inspect: {
|
|
inspect: {
|
|
tidalGrainPrice: 0,
|
|
tidalGrainPrice: 0,
|
|
buckleWeightRatio: 0,
|
|
buckleWeightRatio: 0,
|
|
- buckleMiscellaneous:0,
|
|
|
|
natureOfGrainPurchase:'贸易粮',
|
|
natureOfGrainPurchase:'贸易粮',
|
|
- type:'潮粮',
|
|
|
|
- paramType:'1'
|
|
|
|
|
|
+ BuckleMiscellaneous:0,
|
|
|
|
+ paramType:1,
|
|
|
|
+ type:'潮粮'
|
|
},
|
|
},
|
|
disabled: false,
|
|
disabled: false,
|
|
disabled1: false,
|
|
disabled1: false,
|
|
@@ -193,7 +203,6 @@
|
|
tidalGrainPrice: 0,
|
|
tidalGrainPrice: 0,
|
|
buckleWeightRatio: 0,
|
|
buckleWeightRatio: 0,
|
|
natureOfGrainPurchase:'贸易粮',
|
|
natureOfGrainPurchase:'贸易粮',
|
|
- buckleMiscellaneous:0,
|
|
|
|
type:'潮粮'
|
|
type:'潮粮'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -201,7 +210,7 @@
|
|
this.warehouseName = this.$route.query.warehouseName
|
|
this.warehouseName = this.$route.query.warehouseName
|
|
this.cangNo = this.$route.query.warehouseNo
|
|
this.cangNo = this.$route.query.warehouseNo
|
|
this.count = Number(this.$route.query.count) + 1
|
|
this.count = Number(this.$route.query.count) + 1
|
|
- // this.purchasePriceList = this.$route.query.purchasePriceList
|
|
|
|
|
|
+ this.purchasePriceList = this.$route.query.purchasePriceList
|
|
this.id = this.$route.query.id
|
|
this.id = this.$route.query.id
|
|
if (this.types == 2) {
|
|
if (this.types == 2) {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
@@ -211,6 +220,14 @@
|
|
this.disabled = false
|
|
this.disabled = false
|
|
this.disabled1 = true
|
|
this.disabled1 = true
|
|
this.information = '编辑'
|
|
this.information = '编辑'
|
|
|
|
+ }else if (this.types == 4) {
|
|
|
|
+ this.disabled = false
|
|
|
|
+ this.disabled1 = true
|
|
|
|
+ this.information = '编辑'
|
|
|
|
+ }else if (this.types == 5) {
|
|
|
|
+ this.disabled = false
|
|
|
|
+ this.disabled1 = true
|
|
|
|
+ this.information = '编辑'
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
this.disabled1 = false
|
|
this.disabled1 = false
|
|
@@ -259,18 +276,25 @@
|
|
}).then((response) => {
|
|
}).then((response) => {
|
|
//编辑接口
|
|
//编辑接口
|
|
this.inspect.pictureAddress = response.data.url
|
|
this.inspect.pictureAddress = response.data.url
|
|
|
|
+ console.log(this.types)
|
|
|
|
+ if(this.types==3){
|
|
|
|
+ this.inspect.flag=0
|
|
|
|
+ }else if(this.types==4){
|
|
|
|
+ this.inspect.flag=1
|
|
|
|
+ }
|
|
getinspectEdit(this.inspect)
|
|
getinspectEdit(this.inspect)
|
|
.toPromise()
|
|
.toPromise()
|
|
- .then((response) => {
|
|
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.types = ''
|
|
|
|
+ // this.inspect = []
|
|
|
|
+ this.isShowPrint = false
|
|
|
|
+ this.$router.push({path:'inspectionManagement'})
|
|
})
|
|
})
|
|
})
|
|
})
|
|
this.dialogTableVisible = true;
|
|
this.dialogTableVisible = true;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- this.types = ''
|
|
|
|
- // this.inspect = []
|
|
|
|
- this.isShowPrint = false
|
|
|
|
- this.$router.push({path:'inspectionManagement'})
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
typeChange(){
|
|
typeChange(){
|
|
if(this.inspect.type == '干粮' && this.inspect.goodsName){
|
|
if(this.inspect.type == '干粮' && this.inspect.goodsName){
|
|
@@ -282,10 +306,8 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
closePrint(){
|
|
closePrint(){
|
|
- this.types = ''
|
|
|
|
// this.inspect = []
|
|
// this.inspect = []
|
|
this.isShowPrint = false
|
|
this.isShowPrint = false
|
|
- this.$router.push({path:'inspectionManagement'})
|
|
|
|
},
|
|
},
|
|
print() {
|
|
print() {
|
|
if (!this.inspect.qualityNo) {
|
|
if (!this.inspect.qualityNo) {
|
|
@@ -345,31 +367,28 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(this.inspect.paramType == '2'){
|
|
|
|
- if (
|
|
|
|
- this.inspect.buckleWeightRatio < 0 ||
|
|
|
|
- this.inspect.buckleWeightRatio > 2
|
|
|
|
- ) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '扣重比输入错误',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
|
|
|
|
- String(this.inspect.buckleWeightRatio).length -
|
|
|
|
- (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
|
|
|
|
- 2
|
|
|
|
- ) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '扣重比输入错误',
|
|
|
|
- type: 'warning',
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.inspect.buckleWeightRatio < 0 ||
|
|
|
|
+ this.inspect.buckleWeightRatio > 2
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '扣重比输入错误',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
|
|
|
|
+ String(this.inspect.buckleWeightRatio).length -
|
|
|
|
+ (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
|
|
|
|
+ 2
|
|
|
|
+ ) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '扣重比输入错误',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
}
|
|
}
|
|
-
|
|
|
|
if (!this.inspect.type) {
|
|
if (!this.inspect.type) {
|
|
this.$message({
|
|
this.$message({
|
|
message: '类型不能为空',
|
|
message: '类型不能为空',
|
|
@@ -573,6 +592,48 @@
|
|
return false
|
|
return false
|
|
})
|
|
})
|
|
} else if (this.types == 3) {
|
|
} else if (this.types == 3) {
|
|
|
|
+ this.inspect.flag=0
|
|
|
|
+ this.$confirm('确定保存质检信息?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ // return
|
|
|
|
+ getinspectEdit(this.inspect)
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.success('修改成功')
|
|
|
|
+ this.$router.push({path:'inspectionManagement'})
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ return false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ else if (this.types == 4) {
|
|
|
|
+ this.inspect.flag=1
|
|
|
|
+ this.inspect.reInspector=sessionStorage.getItem('ws-pf_roleName') + sessionStorage.getItem('ws-pf_staffName')
|
|
|
|
+ this.$confirm('确定保存质检信息?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ // return
|
|
|
|
+ getinspectEdit(this.inspect)
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.success('修改成功')
|
|
|
|
+ this.$router.push({path:'inspectionManagement'})
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ return false
|
|
|
|
+ })
|
|
|
|
+ }else if (this.types == 5) {
|
|
|
|
+ this.inspect.flag=2
|
|
|
|
+ this.inspect.reInspector=sessionStorage.getItem('ws-pf_roleName') + sessionStorage.getItem('ws-pf_staffName')
|
|
this.$confirm('确定保存质检信息?', '提示', {
|
|
this.$confirm('确定保存质检信息?', '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
@@ -598,6 +659,7 @@
|
|
return false
|
|
return false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
cancel() {
|
|
cancel() {
|
|
this.types = ''
|
|
this.types = ''
|
|
@@ -646,21 +708,20 @@
|
|
// debugger
|
|
// debugger
|
|
// if (this.inspect.goodsName) {
|
|
// if (this.inspect.goodsName) {
|
|
waterContentChange(type) {
|
|
waterContentChange(type) {
|
|
- var that = this
|
|
|
|
if (this.inspect.goodsName&&type!='water') {
|
|
if (this.inspect.goodsName&&type!='water') {
|
|
- getDryGrainPrice({warehouseId:this.cangid,goodsName:this.inspect.goodsName})
|
|
|
|
- .toPromise()
|
|
|
|
- .then((response) => {
|
|
|
|
- that.$set(that.inspect,'dryGrainPrice',response)
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
for (var i = 0; i < this.purchasePriceList.length; i++) {
|
|
for (var i = 0; i < this.purchasePriceList.length; i++) {
|
|
if (this.purchasePriceList[i].goodsName == this.inspect.goodsName) {
|
|
if (this.purchasePriceList[i].goodsName == this.inspect.goodsName) {
|
|
- this.$set(this.inspect,'buckleWeightRatio',this.purchasePriceList[i].deductWeight)
|
|
|
|
this.$set(this.inspect,'paramType',this.purchasePriceList[i].paramType)
|
|
this.$set(this.inspect,'paramType',this.purchasePriceList[i].paramType)
|
|
-
|
|
|
|
|
|
+ this.$set(this.inspect,'buckleWeightRatio',this.purchasePriceList[i].deductWeight)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(this.inspect.type == '干粮'){
|
|
|
|
+ getDryGrainPrice({warehouseId:this.cangid,goodsName:this.inspect.goodsName})
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$set(this.inspect,'dryGrainPrice',response)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
//潮粮单价改变事件
|
|
//潮粮单价改变事件
|
|
if (
|
|
if (
|
|
@@ -676,47 +737,43 @@
|
|
})
|
|
})
|
|
.toPromise()
|
|
.toPromise()
|
|
.then((response) => {
|
|
.then((response) => {
|
|
- if(that.inspect.paramType == '1'){
|
|
|
|
- that.inspect.tidalGrainPrice = parseFloat(parseFloat(response) - parseFloat(that.inspect.buckleMiscellaneous)/100*parseFloat(that.inspect.dryGrainPrice)).toFixed(4)
|
|
|
|
- }else{
|
|
|
|
- that.inspect.tidalGrainPrice = response
|
|
|
|
- }
|
|
|
|
- that.unitPrice = response
|
|
|
|
|
|
+ this.inspect.tidalGrainPrice = response
|
|
|
|
+ this.unitPrice = response
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if(this.inspect.goodsName && this.inspect.customerName ){
|
|
if(this.inspect.goodsName && this.inspect.customerName ){
|
|
// //查看当前用户对应货名有未结算状态的送货
|
|
// //查看当前用户对应货名有未结算状态的送货
|
|
- let count = 0
|
|
|
|
- if (
|
|
|
|
- this.inspect.goodsName &&
|
|
|
|
- this.inspect.customerName
|
|
|
|
- ) {
|
|
|
|
- getCount({
|
|
|
|
- compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
|
- customerName: this.inspect.customerName,
|
|
|
|
- goodsName: this.inspect.goodsName,
|
|
|
|
- }) .toPromise()
|
|
|
|
- .then((response) => {
|
|
|
|
- count = response
|
|
|
|
- })
|
|
|
|
- // 货名下拉校验
|
|
|
|
- getamount({
|
|
|
|
- compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
|
- customerName: this.inspect.customerName,
|
|
|
|
- goodsName: this.inspect.goodsName,
|
|
|
|
|
|
+ let count = 0
|
|
|
|
+ if (
|
|
|
|
+ this.inspect.goodsName &&
|
|
|
|
+ this.inspect.customerName
|
|
|
|
+ ) {
|
|
|
|
+ getCount({
|
|
|
|
+ compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
|
+ customerName: this.inspect.customerName,
|
|
|
|
+ goodsName: this.inspect.goodsName,
|
|
|
|
+ }) .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ count = response
|
|
})
|
|
})
|
|
- .toPromise()
|
|
|
|
- .then((response) => {
|
|
|
|
- for (let i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
|
- if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
|
|
|
|
- if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0 )&&this.tipFlag) {
|
|
|
|
- this.tipFlag = false
|
|
|
|
- this.$message('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。');
|
|
|
|
- }
|
|
|
|
|
|
+ // 货名下拉校验
|
|
|
|
+ getamount({
|
|
|
|
+ compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
|
+ customerName: this.inspect.customerName,
|
|
|
|
+ goodsName: this.inspect.goodsName,
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ for (let i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
|
+ if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
|
|
|
|
+ if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0 )&&this.tipFlag) {
|
|
|
|
+ this.tipFlag = false
|
|
|
|
+ this.$message('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -729,7 +786,6 @@
|
|
.then((response) => {
|
|
.then((response) => {
|
|
this.goodNameList = []
|
|
this.goodNameList = []
|
|
this.goodNameList = response
|
|
this.goodNameList = response
|
|
- this.purchasePriceList = response
|
|
|
|
})
|
|
})
|
|
// 品级
|
|
// 品级
|
|
packList({
|
|
packList({
|
|
@@ -770,7 +826,7 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- if (this.types == 2 || this.types == 3) {
|
|
|
|
|
|
+ if (this.types !=1) {
|
|
//查看
|
|
//查看
|
|
getinspectLook({
|
|
getinspectLook({
|
|
id: ids
|
|
id: ids
|