|
@@ -233,6 +233,32 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="运费" prop="freight">
|
|
|
+ <el-input-number
|
|
|
+ v-model="formData.data.freight"
|
|
|
+ :precision="4"
|
|
|
+ :min="0"
|
|
|
+ :controls="false"
|
|
|
+ @change="handleChangeAmount"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="优惠" prop="preferential">
|
|
|
+ <el-input-number
|
|
|
+ v-model="formData.data.preferential"
|
|
|
+ :precision="4"
|
|
|
+ :controls="false"
|
|
|
+ @change="handleChangeAmount"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<div class="_t" style="margin-bottom: 15px">采购总金额</div>
|
|
|
<el-row>
|
|
|
<el-col :span="4">
|
|
@@ -245,6 +271,21 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-form-item label="上传附件">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-upload
|
|
|
+ v-model:fileList="fileList"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadData"
|
|
|
+ multiple
|
|
|
+ :before-upload="handleBeforeUpload"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ :on-preview="onPreviewFile"
|
|
|
+ >
|
|
|
+ <el-button>选择</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<el-dialog
|
|
|
v-model="openProduct"
|
|
@@ -295,13 +336,33 @@ let rules = ref({
|
|
|
contractCode: [
|
|
|
{ required: true, message: "请输入采购单号", trigger: "blur" },
|
|
|
],
|
|
|
+ freight: [{ required: true, message: "请输入运费", trigger: "blur" }],
|
|
|
+ preferential: [{ required: true, message: "请输入优惠", trigger: "blur" }],
|
|
|
});
|
|
|
let rulesOne = ref({
|
|
|
name: [{ required: true, message: "请输入费用名称", trigger: "blur" }],
|
|
|
price: [{ required: true, message: "请输入金额", trigger: "blur" }],
|
|
|
});
|
|
|
+const openProduct = ref(false);
|
|
|
+// 上传附件
|
|
|
+const uploadData = ref({});
|
|
|
+const fileList = ref([]);
|
|
|
+const handleBeforeUpload = async (file) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ uploadData.value = res.uploadBody;
|
|
|
+ file.id = res.id;
|
|
|
+ file.fileName = res.fileName;
|
|
|
+ file.fileUrl = res.fileUrl;
|
|
|
+ file.uploadState = true;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+const handleSuccess = (any, UploadFile) => {
|
|
|
+ UploadFile.raw.uploadState = false;
|
|
|
+};
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
+};
|
|
|
|
|
|
-let openProduct = ref(false);
|
|
|
const handleAdd = () => {
|
|
|
formData.data.otherFeeList.push({
|
|
|
name: "",
|
|
@@ -379,6 +440,24 @@ const handleSubmit = async () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (fileList.value && fileList.value.length > 0) {
|
|
|
+ for (let i = 0; i < fileList.value.length; i++) {
|
|
|
+ if (fileList.value[i].raw.uploadState) {
|
|
|
+ ElMessage("文件上传中,请稍后提交");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.data.fileList = fileList.value.map((item) => {
|
|
|
+ return {
|
|
|
+ id: item.raw.id,
|
|
|
+ fileName: item.raw.fileName,
|
|
|
+ fileUrl: item.raw.fileUrl,
|
|
|
+ uploadState: item.raw.uploadState,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.fileList = [];
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
ElMessage({
|
|
@@ -398,12 +477,15 @@ onMounted(() => {
|
|
|
formData.data.purchaseName = userInfo.nickName;
|
|
|
getSupplierList();
|
|
|
if (!route.query.processType) {
|
|
|
+ formData.data.freight = 0;
|
|
|
+ formData.data.preferential = 0;
|
|
|
ids.value = props.queryData.ids.split(",") || [];
|
|
|
getDetails();
|
|
|
} else {
|
|
|
+ let val = route.query.businessId;
|
|
|
proxy
|
|
|
.post("/purchase/detail", {
|
|
|
- id: route.query.businessId,
|
|
|
+ id: val,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
let jsonData = {};
|
|
@@ -419,45 +501,22 @@ onMounted(() => {
|
|
|
})
|
|
|
);
|
|
|
});
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", { businessIdList: [val] })
|
|
|
+ .then((fileObj) => {
|
|
|
+ formData.data.fileList = fileObj[val] || [];
|
|
|
+ if (formData.data.fileList && formData.data.fileList.length > 0) {
|
|
|
+ fileList.value = formData.data.fileList.map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- if (!props.queryData.purchaseDetailList) return;
|
|
|
- // formData.data = props.queryData;
|
|
|
- // proxy
|
|
|
- // .post("/subscribeDetail/detail", {
|
|
|
- // ids: props.queryData.purchaseDetailList.map((item) => {
|
|
|
- // return item.subscribeDetailId;
|
|
|
- // }),
|
|
|
- // })
|
|
|
- // .then((res) => {
|
|
|
- // formData.data.purchaseDetailList =
|
|
|
- // props.queryData.purchaseDetailList.map((x, index) => ({
|
|
|
- // ...res[index],
|
|
|
- // subscribeCount: x.count,
|
|
|
- // count: x.count,
|
|
|
- // price: x.price,
|
|
|
- // amount: x.amount,
|
|
|
- // }));
|
|
|
- // });
|
|
|
- // proxy
|
|
|
- // .post("/purchase/detail", {
|
|
|
- // id: route.query.businessId,
|
|
|
- // })
|
|
|
- // .then((res) => {
|
|
|
- // let jsonData = {};
|
|
|
- // if (res.victoriatouristJson) {
|
|
|
- // jsonData = JSON.parse(res.victoriatouristJson);
|
|
|
- // }
|
|
|
- // formData.data = { ...res, ...jsonData };
|
|
|
- // formData.data.purchaseDetailList = formData.data.purchaseDetailList.map(
|
|
|
- // (x) => ({
|
|
|
- // ...x,
|
|
|
- // subscribeCount: x.subscribeQuantity,
|
|
|
- // purchaseCount: x.purchaseQuantity,
|
|
|
- // })
|
|
|
- // );
|
|
|
- // });
|
|
|
- }, 2000);
|
|
|
});
|
|
|
|
|
|
// 接收父组件的传值
|
|
@@ -540,6 +599,8 @@ const handleChangeAmount = () => {
|
|
|
const e = formData.data.otherFeeList[i];
|
|
|
sum += Number(e.price);
|
|
|
}
|
|
|
+ sum += formData.data.freight;
|
|
|
+ sum += formData.data.preferential;
|
|
|
formData.data.amount = parseFloat(sum).toFixed(4);
|
|
|
};
|
|
|
|