新增一键确定
This commit is contained in:
@ -32,6 +32,15 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['bidding:biddingLimitList:export']">导出excel</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="versionObj.status != 'draft'"
|
||||
@click="handleSave(null, 'all')"
|
||||
v-hasPermi="['tender:billofquantitiesLimitList:edit']"
|
||||
>一键确定</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
@ -66,7 +75,12 @@
|
||||
<el-input-number
|
||||
:disabled="versionObj.status != 'draft'"
|
||||
:model-value="scope.row.unitPrice"
|
||||
@change="(val) => (scope.row.unitPrice = val)"
|
||||
@change="
|
||||
(val) => {
|
||||
scope.row.unitPrice = val;
|
||||
changePrice(scope.row);
|
||||
}
|
||||
"
|
||||
:precision="2"
|
||||
:step="0.1"
|
||||
:controls="false"
|
||||
@ -85,7 +99,7 @@
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="versionObj.status != 'draft'"
|
||||
@click="handleSave(scope.row)"
|
||||
@click="handleSave(scope.row, 'single')"
|
||||
v-if="scope.row.quantity && scope.row.quantity != 0"
|
||||
v-hasPermi="['bidding:biddingLimitList:edit']"
|
||||
>确定</el-button
|
||||
@ -187,31 +201,53 @@ const getTableData = async () => {
|
||||
}
|
||||
}
|
||||
};
|
||||
//修改单价
|
||||
const handleSave = (row: any) => {
|
||||
const modifyPrice = new Map();
|
||||
|
||||
const changePrice = (row: any) => {
|
||||
modifyPrice.set(row.id, row);
|
||||
// if (!row.unitPrice) {
|
||||
// modifyPrice.delete(row.id);
|
||||
// }
|
||||
};
|
||||
//修改单价 biddingLimitListUpdate
|
||||
const handleSave = (row?: any, type?: any) => {
|
||||
try {
|
||||
if (!row.unitPrice) {
|
||||
ElMessage({
|
||||
message: '请输入单价',
|
||||
type: 'warning'
|
||||
if (type == 'single') {
|
||||
loading.value = true;
|
||||
const list = [{ ...row }];
|
||||
biddingLimitListUpdate(list).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getTableData();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type == 'all') {
|
||||
loading.value = true;
|
||||
const list = [];
|
||||
modifyPrice.forEach((item) => {
|
||||
list.push({ ...item });
|
||||
});
|
||||
biddingLimitListUpdate(list).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getTableData();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
biddingLimitListUpdate(row).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getTableData();
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: '修改失败',
|
||||
type: 'error'
|
||||
});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const tableRef = ref<any>();
|
||||
|
@ -35,6 +35,15 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleExport()" v-hasPermi="['tender:billofquantitiesLimitList:export']">导出excel</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="reviewStatus != 'draft'"
|
||||
@click="handleSave(null, 'all')"
|
||||
v-hasPermi="['tender:billofquantitiesLimitList:edit']"
|
||||
>一键确定</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" v-if="reviewStatus == 'draft'" @click="clickApprovalSheet()">审核</el-button>
|
||||
</el-form-item>
|
||||
@ -65,6 +74,7 @@
|
||||
@change="
|
||||
(val) => {
|
||||
scope.row.unitPrice = val;
|
||||
changePrice(scope.row);
|
||||
}
|
||||
"
|
||||
:precision="2"
|
||||
@ -87,7 +97,7 @@
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="reviewStatus != 'draft'"
|
||||
@click="handleSave(scope.row)"
|
||||
@click="handleSave(scope.row, 'single')"
|
||||
v-if="scope.row.quantity && scope.row.quantity != 0"
|
||||
v-hasPermi="['tender:billofquantitiesLimitList:edit']"
|
||||
>确定</el-button
|
||||
@ -220,31 +230,50 @@ const getTableData = async () => {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const modifyPrice = new Map();
|
||||
|
||||
const changePrice = (row: any) => {
|
||||
modifyPrice.set(row.id, row);
|
||||
};
|
||||
//修改单价
|
||||
const handleSave = (row: any) => {
|
||||
const handleSave = (row?: any, type?: any) => {
|
||||
try {
|
||||
if (!row.unitPrice) {
|
||||
ElMessage({
|
||||
message: '请输入单价',
|
||||
type: 'warning'
|
||||
if (type == 'single') {
|
||||
loading.value = true;
|
||||
const list = [{ ...row, type: '1' }];
|
||||
updatePrice(list).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getTableData();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type == 'all') {
|
||||
loading.value = true;
|
||||
const list = [];
|
||||
modifyPrice.forEach((item) => {
|
||||
list.push({ ...item, type: '1' });
|
||||
});
|
||||
updatePrice(list).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getTableData();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
updatePrice({ ...row, type: '1' }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
getTableData();
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: '修改失败',
|
||||
type: 'error'
|
||||
});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const tableRef = ref<any>();
|
||||
|
Reference in New Issue
Block a user