|
@@ -36,12 +36,12 @@
|
|
|
</template>
|
|
|
<template slot="quantity" slot-scope="text, record, index">
|
|
|
<a-form-model-item :prop="'dataSource.'+index+'.quantity'" class='sonItem' :rules="rules.quantity">
|
|
|
- <a-input placeholder="请输入" v-model="record.quantity" ></a-input>
|
|
|
+ <a-input placeholder="请输入" v-model="record.quantity" @change="changeQuantity(record)"></a-input>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<template slot="unQuantity" slot-scope="text, record, index">
|
|
|
<a-form-model-item :prop="'dataSource.'+index+'.unQuantity'" class='sonItem' :rules="rules.unQuantity">
|
|
|
- <a-input placeholder="请输入" v-model="record.unQuantity" ></a-input>
|
|
|
+ <a-input placeholder="请输入" v-model="record.unQuantity" @change="changeUnQuantity(record)"></a-input>
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
|
<template slot="model" slot-scope="text, record, index">
|
|
@@ -277,7 +277,7 @@
|
|
|
dataIndex: 'unQuantity',
|
|
|
ellipsis: true,
|
|
|
scopedSlots: { customRender: 'unQuantity' } ,
|
|
|
- slots:{title:'quantityTitle'},
|
|
|
+ slots:{title:'unQuantityTitle'},
|
|
|
},
|
|
|
{
|
|
|
title: '规格',
|
|
@@ -475,6 +475,7 @@
|
|
|
ellipsis: true
|
|
|
},
|
|
|
],
|
|
|
+ disableMixinCreated:'1',
|
|
|
rules:{
|
|
|
quantity:{required:true,message:"不可为空"},
|
|
|
unQuantity:{required:true,message:"不可为空"},
|
|
@@ -495,6 +496,24 @@
|
|
|
addList(projectCode,projectName){
|
|
|
this.form.dataSource.unshift({rowNo: this.form.dataSource.length+1,projectCode:projectCode,projectName:projectName})
|
|
|
},
|
|
|
+ //改变主数量计算辅数量
|
|
|
+ changeQuantity(record){
|
|
|
+ record.rate = 0.5
|
|
|
+ if(record.rate){
|
|
|
+ var num = (Number(record.quantity)*Number(record.rate)).toFixed(2)
|
|
|
+ this.$set(record,'unQuantity',num)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ //改变辅数量计算主数量
|
|
|
+ changeUnQuantity(record){
|
|
|
+ record.rate = 0.5
|
|
|
+ if(record.rate){
|
|
|
+ var numUn = (Number(record.unQuantity)/Number(record.rate)).toFixed(2)
|
|
|
+ this.$set(record,'quantity',numUn)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
validateList(){
|
|
|
let flag = null
|
|
|
this.$refs.formRef.validate(valid =>{
|
|
@@ -531,6 +550,9 @@
|
|
|
this.$set(recoerd,'unit',data.unit)
|
|
|
this.$set(recoerd,'auxiliaryUnit',data.auxiliaryUnit )
|
|
|
this.$set(recoerd,'inventory',data.ID )
|
|
|
+ this.$set(recoerd,'quantity','' )
|
|
|
+ this.$set(recoerd,'unQuantity','')
|
|
|
+ this.$set(recoerd,'rate',data.rate)
|
|
|
},
|
|
|
//杂发/杂收
|
|
|
sendOrReceive(data){
|