|
@@ -22,8 +22,9 @@
|
|
|
<div style="width: 50%; margin: 0 auto">
|
|
|
<div class="title">基本信息</div>
|
|
|
<ws-info-table>
|
|
|
- <ws-form-item label="编号" span="1" prop="waterContent">
|
|
|
+ <ws-form-item label="编号" span="1" prop="qualityNo">
|
|
|
<ws-input
|
|
|
+ v-model="inspect.qualityNo"
|
|
|
placeholder="请输入编号"
|
|
|
maxlength="100"
|
|
|
disabled
|
|
@@ -82,18 +83,19 @@
|
|
|
</ws-form-item>
|
|
|
<ws-form-item label="货名" span="1" prop="goodsName">
|
|
|
<ws-select
|
|
|
- v-model="inspect.goodsName"
|
|
|
- placeholder=""
|
|
|
- class="typeselect"
|
|
|
- @change="selectpackingMethod"
|
|
|
- >
|
|
|
- <ws-option
|
|
|
- v-for="item in goodnameList"
|
|
|
- :key="item.constKey"
|
|
|
- :label="item.constValue"
|
|
|
- :value="item.constValue"
|
|
|
- />
|
|
|
- </ws-select>
|
|
|
+ v-model="inspect.goodsName"
|
|
|
+ placeholder=""
|
|
|
+ class="typeselect"
|
|
|
+ :disabled="disabled"
|
|
|
+ @change="waterContentChange"
|
|
|
+ >
|
|
|
+ <ws-option
|
|
|
+ v-for="item in goodnameList"
|
|
|
+ :key="item.goodsNameKey"
|
|
|
+ :label="item.goodsName"
|
|
|
+ :value="item.goodsName"
|
|
|
+ />
|
|
|
+ </ws-select>
|
|
|
</ws-form-item>
|
|
|
<ws-form-item label="扣重比" span="1" prop="buckleWeightRatio">
|
|
|
<ws-input
|
|
@@ -113,7 +115,7 @@
|
|
|
v-model="inspect.grade"
|
|
|
placeholder="请输入等级"
|
|
|
class="typeselect"
|
|
|
- @change="selectpackingMethod"
|
|
|
+ @change="waterContentChange"
|
|
|
:disabled="disabled"
|
|
|
>
|
|
|
<ws-option
|
|
@@ -139,6 +141,7 @@
|
|
|
placeholder="请输入水分占比"
|
|
|
maxlength="100"
|
|
|
size="small"
|
|
|
+ @change = "waterContentChange"
|
|
|
:disabled="disabled"
|
|
|
/>
|
|
|
</ws-form-item>
|
|
@@ -180,7 +183,7 @@
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
<div style="text-align: right; color: #323233">
|
|
|
- 潮粮单价(元/公斤):000000000{{ inspect.tidalGrainPrice }}
|
|
|
+ 潮粮单价(元/公斤):{{ inspect.tidalGrainPrice ==null?"0": inspect.tidalGrainPrice}}
|
|
|
</div>
|
|
|
<div class="but">
|
|
|
<el-button @click="cancel" v-if="this.types != 2" type="primary"
|
|
@@ -200,10 +203,16 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { inspectAdd,getCustomerManage,getbinNumber,getcustomer } from '@/model/houseSelfCollect/index'
|
|
|
import {
|
|
|
- packList,
|
|
|
-} from '@/model/contarct/index'
|
|
|
+ inspectAdd,
|
|
|
+ getbinNumber,
|
|
|
+ getcustomer,
|
|
|
+ getinspectLook,
|
|
|
+ getinspectLookUnitPrice,
|
|
|
+ getinspectLookGoods,
|
|
|
+ getinspectEdit
|
|
|
+} from '@/model/houseSelfCollect/index'
|
|
|
+import { packList } from '@/model/contarct/index'
|
|
|
import houseSelfCollectPrint from './houseSelfCollectPrint.vue'
|
|
|
export default {
|
|
|
components: {
|
|
@@ -217,16 +226,18 @@ export default {
|
|
|
disabled: false,
|
|
|
types: '',
|
|
|
information: '添加',
|
|
|
- goodnameList:[],
|
|
|
- gradeList:[],
|
|
|
- customerList:[],
|
|
|
- getbinNumberList:[],
|
|
|
- id:"",
|
|
|
+ goodnameList: [],
|
|
|
+ gradeList: [],
|
|
|
+ customerList: [],
|
|
|
+ getbinNumberList: [],
|
|
|
+ cangid: '', //仓库id
|
|
|
+ // calculation:''
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
|
this.types = this.$route.query.type
|
|
|
- this.id = this.$route.query.id
|
|
|
+ this.cangid = this.$route.query.cangid
|
|
|
+ let id = this.$route.query.id
|
|
|
if (this.types == 2) {
|
|
|
this.disabled = true
|
|
|
this.information = '查看'
|
|
@@ -234,52 +245,104 @@ export default {
|
|
|
this.disabled = false
|
|
|
this.information = '编辑'
|
|
|
}
|
|
|
- this.getList()
|
|
|
+ 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() {
|
|
|
+ this.inspect.qualityNo = 'SGRK' + this.getdate()
|
|
|
+ // + this.verifyinit()
|
|
|
+ },
|
|
|
print() {
|
|
|
- this.$confirm('确定保存质检信息?', '提示', {
|
|
|
+ if(this.types == 1){
|
|
|
+ this.$confirm('确定保存质检信息?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
|
+ // return
|
|
|
inspectAdd(this.inspect)
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
- // this.customerList.id = response
|
|
|
- // customerIdentity(this.customerList)
|
|
|
- // .toPromise()
|
|
|
- // .then((response) => {
|
|
|
- // console.log(response.code)
|
|
|
- this.$message.success('保存成功')
|
|
|
- // this.$router.push({ path: 'customerManagement' })
|
|
|
+ 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
|
|
|
+ })
|
|
|
|
|
|
- // 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' })
|
|
|
- // })
|
|
|
+ }else if(this.types == 3){
|
|
|
+ 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: 'inspectionManagement' })
|
|
|
},
|
|
|
- //货名改变事件
|
|
|
- selectpackingMethod(){
|
|
|
-
|
|
|
+ waterContentChange() {
|
|
|
+ //潮粮单价改变事件
|
|
|
+ getinspectLookUnitPrice({
|
|
|
+ warehouseId: this.cangid,
|
|
|
+ goodsName: this.inspect.goodsName,
|
|
|
+ waterContent: this.inspect.waterContent,
|
|
|
+ grade:this.inspect.grade
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.inspect.tidalGrainPrice = response
|
|
|
+ })
|
|
|
},
|
|
|
- getList(){
|
|
|
- // 货名
|
|
|
- packList({ constId: 'CON2' })
|
|
|
+ //货名改变事件
|
|
|
+ selectpackingMethod() {},
|
|
|
+ getList(ids) {
|
|
|
+ // 货名
|
|
|
+ getinspectLookGoods({ warehouseId: this.cangid })
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.goodnameList = response
|
|
@@ -290,37 +353,43 @@ export default {
|
|
|
.then((response) => {
|
|
|
this.gradeList = response
|
|
|
})
|
|
|
- //客户
|
|
|
- getcustomer({ compId: sessionStorage.getItem('ws-pf_compId') })
|
|
|
+ //客户
|
|
|
+ getcustomer({ compId: sessionStorage.getItem('ws-pf_compId') })
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
// this.gradeList = response
|
|
|
- let customer = response
|
|
|
- for(let i = 0 ; i < response.length ; i++ ){
|
|
|
- customer = response[i].customerName +"(" + response[i].customerPhone + ")"
|
|
|
+ this.customerList = []
|
|
|
+ let customer = response
|
|
|
+ for (let i = 0; i < response.length; i++) {
|
|
|
+ customer =
|
|
|
+ response[i].customerName + '(' + response[i].customerPhone + ')'
|
|
|
this.customerList.push({
|
|
|
- valueKey:i,
|
|
|
- value:customer
|
|
|
+ valueKey: i,
|
|
|
+ value: customer,
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
- console.log( this.customerList)
|
|
|
})
|
|
|
- // 仓位
|
|
|
- getbinNumber({ id:this.id })
|
|
|
+ // 仓位
|
|
|
+ getbinNumber({ id: this.cangid })
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
- for(let i = 0 ; i < response.warehousePositionInfoList.length;i++ ){
|
|
|
- this.getbinNumberList.push({
|
|
|
- value:response.warehousePositionInfoList[i].binNumber
|
|
|
- })
|
|
|
+ this.getbinNumberList=[]
|
|
|
+ for (let i = 0; i < response.warehousePositionInfoList.length; i++) {
|
|
|
+ this.getbinNumberList.push({
|
|
|
+ value: response.warehousePositionInfoList[i].binNumber,
|
|
|
+ })
|
|
|
}
|
|
|
// this.getbinNumberList = response.warehousePositionInfoList
|
|
|
})
|
|
|
-
|
|
|
- }
|
|
|
+ if (this.types == 2 || this.types == 3) {
|
|
|
+ //查看
|
|
|
+ getinspectLook({ id: ids })
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.inspect = response
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|