Jelajahi Sumber

添加计算粮款

wangchao 1 tahun lalu
induk
melakukan
041172c0bd
2 mengubah file dengan 15 tambahan dan 1 penghapusan
  1. 6 0
      src/views/boundManagement/outbound.vue
  2. 9 1
      src/views/warehousing/index.vue

+ 6 - 0
src/views/boundManagement/outbound.vue

@@ -424,10 +424,16 @@ export default {
     grossWeightInput(e) {
       if (this.form.tare && e) this.form.netWeight = e - this.form.tare
       else this.form.netWeight = ''
+      if (this.form.netWeight&&this.form.unitPrice) {
+        this.form.grainFund = Number(this.form.unitPrice * (this.form.netWeight  / 1000)).toFixed(3)
+      }
     },
     tareInput(e) {
       if (this.form.grossWeight && e) this.form.netWeight = this.form.grossWeight - e
       else this.form.netWeight = ''
+      if (this.form.netWeight&&this.form.unitPrice) {
+        this.form.grainFund = Number(this.form.unitPrice * (this.form.netWeight  / 1000)).toFixed(3)
+      }
     },
     changeDate() {
       if (this.value) {

+ 9 - 1
src/views/warehousing/index.vue

@@ -47,7 +47,7 @@
               <el-button @click="gain(1)" type="text">获取</el-button>
             </el-form-item>
             <el-form-item label="净重(公斤)">
-              <el-input disabled placeholder="自动计算" v-model="form.netWeight"></el-input>
+              <el-input placeholder="自动计算" v-model="form.netWeight" disabled></el-input>
             </el-form-item>
             <el-form-item class="form-title" label="基本信息">
             </el-form-item>
@@ -444,10 +444,18 @@ export default {
     grossWeightInput(e) {
       if (this.form.tare && e) this.form.netWeight = e - this.form.tare
       else this.form.netWeight = ''
+
+      if (this.form.netWeight&&this.form.unitPrice) {
+        this.form.grainFund = Number(this.form.unitPrice * (this.form.netWeight  / 1000)).toFixed(3)
+      }
+      
     },
     tareInput(e) {
       if (this.form.grossWeight && e) this.form.netWeight = this.form.grossWeight - e
       else this.form.netWeight = ''
+      if (this.form.netWeight&&this.form.unitPrice) {
+        this.form.grainFund = Number(this.form.unitPrice * (this.form.netWeight  / 1000)).toFixed(3)
+      }
     },
     changeDate() {
       if (this.value) {