From b136c0a80500d929897a8e24f920efad47e2e307 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 01 十一月 2023 19:03:01 +0800
Subject: [PATCH] 变更公海 的接口传参修改
---
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue | 139 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 130 insertions(+), 9 deletions(-)
diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
index ac82902..db9ee6d 100644
--- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
+++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -314,6 +314,30 @@
</el-col>
</el-row>
</div>
+
+ <!-- 浜у搧绠$悊 -->
+ <div class="basic-info-title" style="display: flex">
+ 浜у搧绠$悊
+ <div style="margin-left: 400px">
+ 甯佺
+ <el-select v-model="editConfig.infomation.currency" placeholder="璇烽�夋嫨" size="mini" style="width: 63%">
+ <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <div class="product-view">
+ <CommonFormTableView
+ :show-summary="showSummary"
+ :product-table-list="productTableList"
+ @inputContent="inputContent"
+ @addProductClick="addProductClick"
+ @emptyProductClick="emptyProductClick"
+ @recalculateProductClick="recalculateProductClick"
+ @clearupProduct="clearupProduct"
+ />
+ </div>
+
<!-- 鍟嗘満涓冭绱� -->
<div class="basic-info-title">鍟嗘満涓冭绱�(5W2P)</div>
<div class="basic-info-view">
@@ -593,6 +617,7 @@
import { getCityList } from "@/api/common/address"
import codeMixin from "@/components/makepager/mixin/codeMixin"
import { getContactList } from "@/api/client/contacts"
+import CommonFormTableView from "@/components/makepager/CommonFormTableView.vue";
export default {
name: "AddSalesOpportunityDialog",
mixins: [codeMixin],
@@ -608,7 +633,7 @@
}
}
},
- components: { SelectClientDialog, SelectContactDialog },
+ components: {CommonFormTableView, SelectClientDialog, SelectContactDialog },
computed: {
searchCommonHeight() {
return this.$refs.searchCommonView.offsetHeight
@@ -623,7 +648,7 @@
dialogWidth: "50%",
editConfig: this.editCommonConfig,
rules: {
- number: [{ required: true, validator: this.validateCheckCode, trigger: "blur" }],
+ number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur",'change'] }],
name: [{ required: true, message: "璇疯緭鍏ユ満浼氬悕绉�", trigger: "blur" }],
member_id: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }],
@@ -660,7 +685,16 @@
contactId: this.editCommonConfig.infomation.contact_id,
objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞満浼氱紪鐮�", codeStandID: "" },
isContact: true,
- contactNamelist: []
+ contactNamelist: [],
+ tableData: [],
+ productTableList: {},
+ showSummary: {
+ show: true,
+ total: true,
+ sumProp: ["Amount", "total"],
+ mergeNumber: 2
+ },
+ productId:1,
}
},
created() {
@@ -668,6 +702,7 @@
if (this.editConfig.title !== "鏂板缓" && this.editConfig.infomation.province_id !== 0) {
this.getCityList(this.editConfig.infomation.province_id, "edit")
}
+ this.setTableForm()
this.getCommonData()
this.formInfo()
if (this.editConfig.title === "缂栬緫") {
@@ -681,9 +716,6 @@
this.formInfo()
}
},
- "editConfig.infomation.codeStandID"() {
- this.formInfo()
- }
},
methods: {
formInfo() {
@@ -727,7 +759,12 @@
saveClick(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
- console.log(this.editConfig.infomation)
+ const hasProduct = this.tableData.every(ele=>!!ele.name)
+ if (!hasProduct){
+ this.$message.error("浜у搧鍚嶇О涓嶈兘涓虹┖")
+ return
+ }
+
const params = this.saveParams()
console.log(params)
if (this.editConfig.title === "鏂板缓") {
@@ -735,9 +772,11 @@
console.log(res)
this.editConfig.visible = false
if (res.code === 200) {
- this.$message.success("娣诲姞鎴愬姛")
+ this.$message.success("娣诲姞鎴愬姛锛�")
this.$parent.getData()
// }
+ }else{
+ this.$message.error(res.msg?res.msg:"娣诲姞澶辫触锛�")
}
})
} else {
@@ -745,8 +784,10 @@
console.log(res)
this.editConfig.visible = false
if (res.code === 200) {
- this.$message.success("缂栬緫鎴愬姛")
+ this.$message.success("缂栬緫鎴愬姛锛�")
this.$parent.getData()
+ }else{
+ this.$message.error(res.msg?res.msg:"缂栬緫澶辫触锛�")
}
})
}
@@ -795,6 +836,7 @@
detail_address: data.detail_address || "",
codeStandID: data.ID,
+ products: this.tableData,
}
return params
},
@@ -905,6 +947,85 @@
}
}
})
+ },
+ setTableForm() {
+ if (this.editConfig.title === "鏂板缓" || this.editConfig.infomation.products.length === 0) {
+ this.tableData = [
+ {
+ productId: this.productId,
+ id: 0,
+ amount: 0,
+ desc: "",
+ name: "",
+ number: "",
+ price: 0,
+ total: 0
+ }
+ ]
+ } else {
+ this.tableData = this.editConfig.infomation.products
+ this.tableData.map((item, index) => {
+ item.productId = index + 1
+ })
+ }
+ this.productTableList = {
+ tableData: this.tableData,
+ tableColumn: [
+ { label: "#", prop: "productId", width: 40 },
+ { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
+ { label: "浜у搧缂栧彿", prop: "number" },
+ { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
+ { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
+ { label: "浠风◣鍚堣", prop: "total", inputFloat: true }
+ ]
+ }
+ },
+ // 浜у搧鍒楄〃杈撳叆
+ inputContent(val, prop, row) {
+ this.productId = row.productId
+ this.tableData.map((item) => {
+ if (item.productId === row.productId) {
+ item[prop] = val
+ }
+ })
+ },
+ // 浜у搧鏂板
+ addProductClick() {
+ this.productId++
+ this.tableData.push({
+ productId: this.productId,
+ id: 0,
+ amount: 0,
+ desc: "",
+ name: "",
+ number: "",
+ price: 0,
+ total: 0
+ })
+ this.showSummary.show = true
+ },
+ // 浜у搧娓呯┖
+ emptyProductClick() {
+ this.productId = 1
+ this.tableData = [
+ {
+ productId: this.productId,
+ id: 0,
+ amount: 0,
+ desc: "",
+ name: "",
+ number: "",
+ price: 0,
+ total: 0
+ }
+ ]
+ this.productTableList.tableData = this.tableData
+ },
+ // 浜у搧閲嶇畻
+ recalculateProductClick() {},
+ clearupProduct(data) {
+ this.tableData = data
+ this.productTableList.tableData = this.tableData
}
}
}
--
Gitblit v1.8.0