|
@@ -73,7 +73,11 @@
|
|
|
@click="handleForeign(item)">转对外</el-button>
|
|
|
<el-button type="danger" text v-debounce v-if="item.status !=0 && item.status !=88"
|
|
|
@click="handleRepeal(item,'/saleQuotation/cancellation')">作废</el-button>
|
|
|
+ <el-button type="primary" text v-debounce @click="getConfirmDtl(item, false)">价格确认</el-button>
|
|
|
</span>
|
|
|
+ <!-- <span v-if="item.status !=88">
|
|
|
+ v-if="item.confirmStatus==0"
|
|
|
+ </span> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -168,7 +172,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="数量" width="110">
|
|
|
+ <!-- <el-table-column label="数量" width="110">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.quantity'"
|
|
@@ -196,7 +200,7 @@
|
|
|
<span v-else>一</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="备注" width="180">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
@@ -310,7 +314,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="数量" width="80" prop="quantity">
|
|
|
+ <!-- <el-table-column label="数量" width="80" prop="quantity">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="总数量" width="80" prop="allQuantity">
|
|
|
</el-table-column>
|
|
@@ -345,7 +349,7 @@
|
|
|
¥ {{row.amount}}
|
|
|
</div>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="备注" width="180" prop="remark">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -397,6 +401,90 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog v-if="confirmDialog" v-model="confirmDialog" title="价格确认" width="90%" append-to-body>
|
|
|
+ <byForm :formConfig="formConfigTwo" :formOption="formOptionTwo" v-model="formData.dataTwo" :rules="rulesTwo" ref="formDomTwo"
|
|
|
+ v-loading="submitLoading">
|
|
|
+ <template #commodity>
|
|
|
+ <div style="width: 100%;padding-left:25px">
|
|
|
+ <el-table :data="formData.dataTwo.quotationProductList" style="width: 100%;" default-expand-all>
|
|
|
+ <el-table-column type="expand" width="50" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <div style="padding-left:50px">
|
|
|
+ <div style="margin-bottom:10px;">
|
|
|
+ <TitleInfo content='BOM单:'></TitleInfo>
|
|
|
+ </div>
|
|
|
+ <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
|
|
|
+ <el-table-column label="图片" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-if="row.fileUrl">
|
|
|
+ <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
|
+ </div>
|
|
|
+ <div v-else></div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productCode" label="物料编码" width="190" />
|
|
|
+ <el-table-column prop="productName" label="物料名称" min-width="200" />
|
|
|
+ <el-table-column label="尺寸 (cm)" width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注" width="180" prop="remark">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="图片" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-if="row.fileUrl">
|
|
|
+ <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
|
+ </div>
|
|
|
+ <div v-else></div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productCode" label="商品编码" width="190" />
|
|
|
+ <el-table-column prop="productName" label="商品名称" min-width="200" />
|
|
|
+ <el-table-column label="尺寸 (cm)" width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="productColor" label="颜色" width="100" />
|
|
|
+ <el-table-column label="数量" width="110" prop="quantity">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="单价" width="110" prop="price">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'quotationProductList.' + $index + '.price'" :rules="rulesTwo.price" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="changeQuantityOne" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amount" label="小计" width="110">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ ¥ {{row.amount}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="confirmDialog = false" size="default" v-debounce>关 闭</el-button>
|
|
|
+ <el-button type="primary" size="default" v-debounce @click="confirmSubmit()">提 交</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
|
|
|
<SelectProduct @selectProduct="selectProduct" :companyId="companyId" :isRawMaterial="'1'" :disablePerm="'1'"></SelectProduct>
|
|
|
<template #footer>
|
|
@@ -881,6 +969,7 @@ const formData = reactive({
|
|
|
quotationProductList: [],
|
|
|
},
|
|
|
backData: {},
|
|
|
+ dataTwo: {},
|
|
|
});
|
|
|
const formDom = ref(null);
|
|
|
const formOption = reactive({
|
|
@@ -1083,9 +1172,9 @@ const selectProduct = (goods) => {
|
|
|
materialId: x.materialId,
|
|
|
productName: x.materialName,
|
|
|
productCode: x.materialCode,
|
|
|
- productLength: x["length"],
|
|
|
- productWidth: x.width,
|
|
|
- productHeight: x.height,
|
|
|
+ productLength: x["materialLength"],
|
|
|
+ productWidth: x.materialWidth,
|
|
|
+ productHeight: x.materialHeight,
|
|
|
quantity: x.quantity || null,
|
|
|
allQuantity: "",
|
|
|
price: null,
|
|
@@ -1617,6 +1706,140 @@ const handleSubmitBack = () => {
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const getFileDataOne = () => {
|
|
|
+ let ids = [];
|
|
|
+ formData.dataTwo.quotationProductList.map((x) => {
|
|
|
+ // ids.push(x.productId);
|
|
|
+ x.quotationProductBomList.map((y) => {
|
|
|
+ ids.push(y.materialId);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ ids = Array.from(new Set(ids));
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: ids,
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ formData.dataTwo.quotationProductList.map((x) => {
|
|
|
+ // x.fileList = fileObj[x.productId] || [];
|
|
|
+ // if (x.fileList && x.fileList.length > 0) {
|
|
|
+ // x.fileUrl = x.fileList[0].fileUrl;
|
|
|
+ // }
|
|
|
+ x.quotationProductBomList.map((y) => {
|
|
|
+ y.fileList = fileObj[y.materialId] || [];
|
|
|
+ if (y.fileList && y.fileList.length > 0) {
|
|
|
+ y.fileUrl = y.fileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const changeQuantityOne = () => {
|
|
|
+ let money = 0;
|
|
|
+ if (
|
|
|
+ formData.dataTwo.quotationProductList &&
|
|
|
+ formData.dataTwo.quotationProductList.length > 0
|
|
|
+ ) {
|
|
|
+ // 单个产品的价格
|
|
|
+ for (let i = 0; i < formData.dataTwo.quotationProductList.length; i++) {
|
|
|
+ let iele = formData.dataTwo.quotationProductList[i];
|
|
|
+ iele.amount = Number(
|
|
|
+ parseFloat(Number(iele.quantity) * Number(iele.price)).toFixed(2)
|
|
|
+ );
|
|
|
+ money += iele.amount;
|
|
|
+ }
|
|
|
+ formData.dataTwo.amount = parseFloat(money).toFixed(2);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const getConfirmDtl = (row, flag) => {
|
|
|
+ formConfigTwo.disabled = flag;
|
|
|
+ modalType.value = "edit";
|
|
|
+ confirmDialog.value = true;
|
|
|
+ proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
|
|
|
+ formData.dataTwo = res;
|
|
|
+ formData.dataTwo.quotationProductList =
|
|
|
+ formData.dataTwo.quotationProductList.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ price: x.prodPrice,
|
|
|
+ }));
|
|
|
+ // 文件数据回显
|
|
|
+ getFileDataOne();
|
|
|
+ let productIds = formData.dataTwo.quotationProductList.map(
|
|
|
+ (x) => x.productId
|
|
|
+ );
|
|
|
+ proxy.getFileData({
|
|
|
+ businessIdList: productIds,
|
|
|
+ data: formData.dataTwo.quotationProductList,
|
|
|
+ att: "productId",
|
|
|
+ businessType: "0",
|
|
|
+ fileAtt: "productFile",
|
|
|
+ filePathAtt: "fileUrl",
|
|
|
+ });
|
|
|
+ // 价格计算
|
|
|
+ changeQuantityOne();
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const formDomTwo = ref(null);
|
|
|
+const confirmDialog = ref(false);
|
|
|
+const formConfigTwo = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "商品信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "commodity",
|
|
|
+ label: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "报价总金额",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "amount",
|
|
|
+ label: "报价总金额",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+
|
|
|
+const formOptionTwo = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+});
|
|
|
+const rulesTwo = ref({
|
|
|
+ price: [{ required: true, message: "请输入单价", trigger: "blur" }],
|
|
|
+ // coefficient: [{ required: true, message: "请输入系数", trigger: "blur" }],
|
|
|
+});
|
|
|
+
|
|
|
+const confirmSubmit = () => {
|
|
|
+ formDomTwo.value.handleSubmit(() => {
|
|
|
+ proxy
|
|
|
+ .msgConfirm()
|
|
|
+ .then((res) => {
|
|
|
+ submitLoading.value = true;
|
|
|
+ proxy.post("/saleQuotation/edit", formData.dataTwo).then((res) => {
|
|
|
+ proxy.msgTip("操作成功", 1);
|
|
|
+ submitLoading.value = false;
|
|
|
+ confirmDialog.value = false;
|
|
|
+ getList();
|
|
|
+ detailDialog.value = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ submitLoading.value = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|