|
|
@@ -283,7 +283,7 @@
|
|
|
<el-col :span="3"><el-input v-model="formDatas.name8"/></el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="10" style="margin-top: 1px;">
|
|
|
- <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage1"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" :readonly="!formDatas.name1" v-model="formDatas.percentage1"/></el-col>
|
|
|
<el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage2"/></el-col>
|
|
|
<el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage3"/></el-col>
|
|
|
<el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage4"/></el-col>
|
|
|
@@ -4763,7 +4763,7 @@ const addBz = async() => {
|
|
|
const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
console.log(fpsum.value)
|
|
|
const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7', 'percentage8'];
|
|
|
- const values = relevantKeys.reduce((acc, key) => {
|
|
|
+ const values = relevantKeys.reduce((acc, key) => {
|
|
|
const value = parseFloat(formDatas.value[key], 10);
|
|
|
if (!isNaN(value)) {
|
|
|
acc.push(value); // 只有当 value 不是 NaN 时才添加到数组中
|
|
|
@@ -4841,8 +4841,28 @@ const selectBz = async() => {
|
|
|
updateTotal()
|
|
|
const jt = selectedOption.value.split('|')[0]//获取车间数据
|
|
|
//判断车间分配比例【SY、PM、WY】
|
|
|
- const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM') && !jt.includes('WY');
|
|
|
-
|
|
|
+ const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
+ const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7', 'percentage8'];
|
|
|
+ const values = relevantKeys.reduce((acc, key) => {
|
|
|
+ const value = parseFloat(formDatas.value[key], 10);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ acc.push(value); // 只有当 value 不是 NaN 时才添加到数组中
|
|
|
+ }
|
|
|
+ return acc;
|
|
|
+ }, []); // 初始化为空数组
|
|
|
+
|
|
|
+ console.log("数值", values);
|
|
|
+
|
|
|
+ const hasInvalidValue = values.some(value => value <= 0 || value > 1);
|
|
|
+ console.log(hasInvalidValue);
|
|
|
+
|
|
|
+ if (hasInvalidValue) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "某人分配系数有误",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (fpsum.value > 1) {
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
@@ -5603,7 +5623,28 @@ const tablebllickHandlerlist = async (row, column, event) => {
|
|
|
updateTotal()
|
|
|
const jt = formdata3.value.sczl_jtbh
|
|
|
// 定义一个变量来决定是否应该检查 fpsum2.value < 1
|
|
|
-const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM') && !jt.includes('WY');
|
|
|
+const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
+const relevantKeys2 = ['组员1', '组员2','组员3','组员4','组员5','组员6','组员7','组员8','组员9',];
|
|
|
+ const values = relevantKeys2.reduce((acc, key) => {
|
|
|
+ const value = parseFloat(formDatas.value[key], 10);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ acc.push(value); // 只有当 value 不是 NaN 时才添加到数组中
|
|
|
+ }
|
|
|
+ return acc;
|
|
|
+ }, []); // 初始化为空数组
|
|
|
+
|
|
|
+ console.log("数值", values);
|
|
|
+
|
|
|
+ const hasInvalidValue = values.some(value => value <= 0 || value > 1);
|
|
|
+ console.log(hasInvalidValue);
|
|
|
+
|
|
|
+ if (hasInvalidValue) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "某人分配系数有误",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
if (fpsum2.value > 1) {
|
|
|
ElMessage({
|