Просмотр исходного кода

企业台账管理:企业自主核算加工增值率字段改为自动计算

CzRger месяцев назад: 9
Родитель
Сommit
f456f1c82f
1 измененных файлов с 19 добавлено и 4 удалено
  1. 19 4
      snowy-admin-web/src/views/yqyc/zero/enterprise-ledger/detail.vue

+ 19 - 4
snowy-admin-web/src/views/yqyc/zero/enterprise-ledger/detail.vue

@@ -403,17 +403,17 @@
 						</a-col>
 						<a-col :span="8">
 							<a-form-item label="成品内销人民币价格:" name="domesticSalePrice">
-								<a-input v-model:value="productData.domesticSalePrice" :disabled="isView"  :min="0" style="width: 100%;" placeholder="请输入成品内销人民币价格" />
+								<a-input v-model:value="productData.domesticSalePrice" :disabled="isView"  :min="0" style="width: 100%;" placeholder="请输入成品内销人民币价格"  @change="onChangeSelfRate"/>
 							</a-form-item>
 						</a-col>
 						<a-col :span="8">
 							<a-form-item label="境外进口料件总价(RMB):" name="importTotal">
-								<a-input v-model:value="productData.importTotal" :disabled="isView" :min="0" style="width: 100%;" placeholder="请输入境外进口料件总价(RMB)" />
+								<a-input v-model:value="productData.importTotal" :disabled="isView" :min="0" style="width: 100%;" placeholder="请输入境外进口料件总价(RMB)"  @change="onChangeSelfRate"/>
 							</a-form-item>
 						</a-col>
 						<a-col :span="8">
 							<a-form-item label="国内采购料件总价(RMB):" name="domesticTotal">
-								<a-input v-model:value="productData.domesticTotal" :disabled="isView" :min="0" style="width: 100%;" placeholder="请输入国内采购料件总价(RMB)" />
+								<a-input v-model:value="productData.domesticTotal" :disabled="isView" :min="0" style="width: 100%;" placeholder="请输入国内采购料件总价(RMB)"  @change="onChangeSelfRate"/>
 							</a-form-item>
 						</a-col>
 						<a-col :span="8">
@@ -423,7 +423,13 @@
 						</a-col>
 						<a-col :span="8">
 							<a-form-item label="企业自主核算加工增值率:" name="selfRate">
-								<a-input v-model:value="productData.selfRate" :disabled="isView" placeholder="请输入企业自主核算加工增值率" allow-clear />
+								<a-input v-model:value="productData.selfRate" :disabled="true" placeholder="请输入企业自主核算加工增值率" allow-clear>
+									<template #suffix>
+										<a-tooltip title="(成品内销人民币价格 - 境外进口料件总价(RMB) - 国内采购料件总价(RMB))/ (境外进口料件总价(RMB) + 国内采购料件总价(RMB))">
+											<info-circle-outlined style="color: rgba(0, 0, 0, 0.45)" />
+										</a-tooltip>
+									</template>
+								</a-input>
 							</a-form-item>
 						</a-col>
 						<a-col :span="8">
@@ -1310,6 +1316,15 @@ const onChangeSp = (val, obj) => {
 	productData.value.hsCode = val
 	productData.value.measurementUnit = obj.firstUnitCode + '-' + obj.firstUnitName
 }
+const onChangeSelfRate = () => {
+	setTimeout(() => {
+		if (proxy.$util.isValue(productData.value.domesticSalePrice) && proxy.$util.isValue(productData.value.importTotal) && proxy.$util.isValue(productData.value.domesticTotal) && (Number(productData.value.importTotal) + Number(productData.value.domesticTotal) > 0)) {
+			productData.value.selfRate = (Number(productData.value.domesticSalePrice) - Number(productData.value.importTotal) - Number(productData.value.domesticTotal)) / (Number(productData.value.importTotal) + Number(productData.value.domesticTotal))
+		} else {
+			productData.value.selfRate = ''
+		}
+	}, 100)
+}
 // 抛出函数
 defineExpose({
 	onOpen