From 1f4bc9f584c07a0958747657b7353ccbd1d56b41 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 16 八月 2023 17:39:00 +0800 Subject: [PATCH] bug修复及销售子单产品管理相关 --- src/views/service/serviceContract/AddServiceContractDialog.vue | 63 +++- src/store/modules/getClientName.js | 17 + src/views/client/contacts/AddContactsDialog.vue | 8 src/views/sales/subOrder/index.vue | 9 src/views/service/serviceFeeManage/index.vue | 4 src/components/makepager/CommonFormTableView.vue | 40 ++- src/views/other/commonDialog/SelectCommonDialog.vue | 17 src/views/other/product/index.vue | 224 ++++++++++++++++++ src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue | 22 + src/components/makepager/TableCommonView.vue | 41 +++ src/views/client/contacts/index.vue | 3 src/views/sales/quotation/AddQuotationDialog.vue | 154 ++++++++---- src/views/client/followupRecords/index.vue | 4 src/views/sales/salesOpportunity/index.vue | 2 src/views/sales/subOrder/AddSubOrderDialog.vue | 93 +++++-- src/views/sales/quotation/index.vue | 6 16 files changed, 541 insertions(+), 166 deletions(-) diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue index 01f734a..dedaea4 100644 --- a/src/components/makepager/CommonFormTableView.vue +++ b/src/components/makepager/CommonFormTableView.vue @@ -15,7 +15,7 @@ :label="item.label" :width="item.width" :min-width="item.min" - align="right" + align="center" > <!-- 琛ㄥご鏍峰紡 --> <template slot="header"> @@ -31,7 +31,16 @@ :prop="'tableData.' + scope.$index + '.' + item.prop" :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]" > - <el-input v-model.trim="scope.row[item.prop]" maxlength="50" size="mini" disabled></el-input> + <el-input + v-model.trim="scope.row[item.prop]" + maxlength="50" + size="mini" + @change=" + (val) => { + commonInputChange(val, item.prop, scope.row) + } + " + ></el-input> </el-form-item> <el-form-item v-else-if="item.date" @@ -40,7 +49,7 @@ :rules="[{ required: item.isRequird ? true : false, message: '杈撳叆涓嶈兘涓虹┖' }]" > <!-- <el-input v-model.trim="scope.row[item.prop]" maxlength="50" size="mini"></el-input> --> - <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px" disabled> + <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px"> </el-date-picker> </el-form-item> <span v-else>{{ scope.row[item.prop] }}</span> @@ -51,10 +60,10 @@ </el-table> </el-form> <div v-if="!detailEnter" style="margin: 10px"> - <el-button size="small" type="primary" disabled>鏂板</el-button> - <el-button size="small" type="primary" disabled>瀵煎叆鏄庣粏</el-button> - <el-button size="small" type="primary" disabled>娓呯┖</el-button> - <el-button size="small" type="primary" disabled>閲嶇畻</el-button> + <el-button size="small" type="primary" @click="add">鏂板</el-button> + <!-- <el-button size="small" type="primary" disabled>瀵煎叆鏄庣粏</el-button> --> + <el-button size="small" type="primary">娓呯┖</el-button> + <el-button size="small" type="primary">閲嶇畻</el-button> </div> <div v-if="showSummary.total || showSummary.refundable" style="height: 42px; line-height: 42px"> <el-row :gutter="10"> @@ -107,14 +116,7 @@ data() { return {} }, - computed: { - maxHeight() { - if (this.productTableList.height) { - return `calc(100vh - ${this.productTableList.height})` - } - return undefined - } - }, + computed: {}, methods: { handleReserve(row) { return row._id ? row._id : row.id @@ -191,6 +193,14 @@ s[1] = s[1].substring(0, prec) //灏忔暟鐐逛綅鏁拌秴鍑洪暱搴︽椂鎴彇鍓嶉潰鐨勪綅鏁� } return s.join(dec) + }, + add() { + this.$emit("addProductClick") + }, + commonInputChange(val, prop, row) { + console.log(val, prop) + console.log(row) + this.$emit("inputContent", val, prop, row) } } } diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue index ae1083e..5abfbd8 100644 --- a/src/components/makepager/TableCommonView.vue +++ b/src/components/makepager/TableCommonView.vue @@ -35,6 +35,7 @@ <span v-else-if="item.isClick && scope.row[item.prop]" class="sel-name" @click="selNameClick(scope.row)">{{ scope.row[item.prop] }}</span> + <span v-else-if="item.isFirst">{{ scope.row[item.prop] ? "鏄�" : "鍚�" }}</span> <span v-else-if="item.isSalesLeadClick && scope.row[item.prop]" class="sel-name" @@ -71,6 +72,26 @@ @click="selCommonClick(scope.row)" >{{ scope.row[item.prop] }}</span > + <div v-else-if="item.isProductName" class="product-view"> + <ul v-if="scope.row.products && scope.row.products.length > 0"> + <li v-for="(item, index) in scope.row.products" :key="index"> + <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> + {{ item.name }} + </div> + </li> + </ul> + <div v-else class="no-product">{{ "--" }}</div> + </div> + <div v-else-if="item.isProductAmount" class="product-view"> + <ul v-if="scope.row.products && scope.row.products.length > 0"> + <li v-for="(item, index) in scope.row.products" :key="index"> + <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> + {{ item.amount }} + </div> + </li> + </ul> + <div v-else class="no-product">{{ "--" }}</div> + </div> <span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span> </template> </el-table-column> @@ -267,6 +288,26 @@ color: $color-primary; cursor: pointer; } + .product-view { + // background: #cc7d7d; + margin-left: -10px; + margin-right: -11px; + li { + height: 57px; + line-height: 57px; + .name-view { + padding-left: 10px; + border-bottom: 1px solid #ebeef5; + } + .no-bottom { + border-bottom: 0px; + } + } + .no-product { + height: 57px; + line-height: 57px; + } + } } ::v-deep { .el-table__footer-wrapper tbody td.el-table__cell { diff --git a/src/store/modules/getClientName.js b/src/store/modules/getClientName.js index 9a474ce..90f5a17 100644 --- a/src/store/modules/getClientName.js +++ b/src/store/modules/getClientName.js @@ -8,6 +8,7 @@ import { getSalesDetailsList } from "@/api/sales/salesDetails" import { getQuotationList } from "@/api/sales/quotation" import { getServiceOrderList } from "@/api/serviceManage/clientServiceOrder" +import { getProductList } from "@/api/common/other" import { Message } from "element-ui" export default { @@ -21,7 +22,8 @@ getContractList: [], // 鍚堝悓璁㈠崟 salesDetailsList: [], // 閿�鍞槑缁嗗崟 quotationList: [], // 鎶ヤ环鍗� - serviceOrderList: [] // 瀹㈡埛鏈嶅姟鍗� + serviceOrderList: [], // 瀹㈡埛鏈嶅姟鍗� + productList: [] // 浜у搧鍒楄〃 }, mutations: { clientNameList(state, payload) { @@ -53,6 +55,9 @@ }, serviceOrderList(state, payload) { state.serviceOrderList = payload + }, + productList(state, payload) { + state.productList = payload } }, actions: { @@ -145,6 +150,16 @@ Message.error(res.msg) } }) + }, + geProductList(context) { + getProductList({ productName: "", productNumber: "", page: 1, pageSize: 10 }).then((res) => { + if (res.data.code == 200) { + console.log(res.data.data.data) + context.commit("productList", res.data.data.data) + } else { + Message.error(res.msg) + } + }) } } } diff --git a/src/views/client/contacts/AddContactsDialog.vue b/src/views/client/contacts/AddContactsDialog.vue index d228881..80e8f08 100644 --- a/src/views/client/contacts/AddContactsDialog.vue +++ b/src/views/client/contacts/AddContactsDialog.vue @@ -76,13 +76,7 @@ </el-col> <el-col :span="12"> <el-form-item v-if="isUnflod" label="棣栬鑱旂郴浜�" prop="is_first"> - <el-switch - v-model="editConfig.infomation.is_first" - active-color="#2E68DB" - inactive-color="#AEB9CA" - active-value="鏄�" - inactive-value="鍚�" - > + <el-switch v-model="editConfig.infomation.is_first" active-color="#2E68DB" inactive-color="#AEB9CA"> </el-switch> </el-form-item> </el-col> diff --git a/src/views/client/contacts/index.vue b/src/views/client/contacts/index.vue index 4d2f0d0..d3c4b98 100644 --- a/src/views/client/contacts/index.vue +++ b/src/views/client/contacts/index.vue @@ -139,7 +139,7 @@ { label: "鑱屽姟", prop: "position", min: 120 }, // 鑱屽姟 { label: "鎵嬫満", prop: "phone", min: 100 }, // 鎵嬫満鍙风爜 { label: "閿�鍞礋璐d汉", prop: "member_name", min: 120 }, // 閿�鍞礋璐d汉 - { label: "棣栬鑱旂郴浜�", prop: "is_first", min: 90 } // 棣栬鑱旂郴浜� + { label: "棣栬鑱旂郴浜�", prop: "is_first", isFirst: true, min: 90 } // 棣栬鑱旂郴浜� ] } this.searchOptions = [] @@ -165,7 +165,6 @@ return { ...item, client_name: item.Client.name, - is_first: item.is_first ? "鏄�" : "鍚�", client_id: item.Client.id, member_name: item.member.username } diff --git a/src/views/client/followupRecords/index.vue b/src/views/client/followupRecords/index.vue index b08b3a2..17d4a0e 100644 --- a/src/views/client/followupRecords/index.vue +++ b/src/views/client/followupRecords/index.vue @@ -147,8 +147,8 @@ { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 100, isContactClick: true }, // 鑱旂郴浜哄鍚� { label: "瀹㈡埛鐘舵��", prop: "client_status", min: 100 }, // 瀹㈡埛鐘舵�� { label: "鑱旂郴鏂瑰紡", prop: "contact_information_name", min: 100 }, // 鑱旂郴鏂瑰紡 - { label: "鑱旂郴浜烘棩鏈�", prop: "follow_time", isTime: true, min: 130 }, // 鑱旂郴浜烘棩鏈� - { label: "涓嬫鍥炶鏃ユ湡", prop: "next_follow_time", isTime: true, min: 130 }, // 涓嬫鍥炶鏃ユ湡 + { label: "鑱旂郴浜烘棩鏈�", prop: "follow_time", min: 130 }, // 鑱旂郴浜烘棩鏈� + { label: "涓嬫鍥炶鏃ユ湡", prop: "next_follow_time", min: 130 }, // 涓嬫鍥炶鏃ユ湡 { label: "璐熻矗浜�", prop: "member_name", min: 110 }, // 璐熻矗浜� { label: "璺熻繘璁板綍", prop: "record", min: 130 } // 璺熻繘璁板綍 ] diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue index 6a8fc71..27111a5 100644 --- a/src/views/other/commonDialog/SelectCommonDialog.vue +++ b/src/views/other/commonDialog/SelectCommonDialog.vue @@ -305,18 +305,15 @@ await getProductList({ productName: "", productNumber: "", - page: 0, - pageSize: 0 + page: 1, + pageSize: 5 }).then((res) => { - if (res.code === 200) { - if (res.data.list && res.data.list.length > 0) { - const list = res.data.list.map((item) => { + console.log(res.data) + if (res.data.code === 200) { + if (res.data.data.data && res.data.data.data.length > 0) { + const list = res.data.data.data.map((item) => { return { - ...item, - client_name: item.Client.name, - serviceType_name: item.ServiceType.name, - faultType_name: item.FaultType.name, - serviceContract_Number: item.ServiceContract.number + ...item } }) this.tableList.tableInfomation = list.slice(0, 5) || [] diff --git a/src/views/other/product/index.vue b/src/views/other/product/index.vue new file mode 100644 index 0000000..8e778bd --- /dev/null +++ b/src/views/other/product/index.vue @@ -0,0 +1,224 @@ +<template> + <div class="product"> + <div v-if="isDetail" class="detail-top"> + <DetailListCommonBtn :query-class-options="queryClassOptions" /> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> + </div> + <div v-else class="top"> + <SearchCommonView + ref="searchCommonView" + :query-class-options="queryClassOptions" + :search-options="searchOptions" + :search-sel="searchSel" + @searchClick="searchClick" + @resetClick="resetClick" + /> + <div class="btn-pager"> + <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" @batchDelete="delClick" /> + <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> + </div> + </div> + <TableCommonView + ref="tableListRef" + v-loading="loading" + :table-list="tableList" + :select-box="!isDetail" + @selContactsClick="selContactsClick" + @selClientClick="selClientClick" + @getSelectArray="getSelectArray" + > + <!-- <template slot="tableButton"> + <el-table-column label="鎿嶄綔" width="60" fixed="right"> + <template slot-scope="scope"> + <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button> + </template> + </el-table-column> + </template> --> + </TableCommonView> + </div> +</template> + +<script> +import { getProductList } from "@/api/common/other" +import pageMixin from "@/components/makepager/pager/mixin/pageMixin" + +export default { + name: "FollowupRecords", + props: { + isDetail: { + type: Boolean, + default: false + }, + addConfig: { + type: Object, + default: () => { + return {} + } + }, + addIdConfig: { + type: Object, + default: () => { + return {} + } + } + }, + mixins: [pageMixin], + components: {}, + computed: {}, + data() { + return { + tableList: {}, + loading: false, + activeName: "second", + queryClassValue: "1", + queryClassOptions: [ + { value: "1", label: "鍏ㄩ儴" }, + { value: "2", label: "浠婃棩鑱旂郴" }, + { value: "3", label: "鏈懆鑱旂郴" }, + { value: "4", label: "鏈湀鑱旂郴" } + ], + searchOptions: [], + operatesList: [ + { id: "1", name: "鍏变韩" }, + { id: "2", name: "鎵归噺缂栬緫" }, + { id: "3", name: "瀵煎嚭" }, + { id: "4", name: "涓嬭浇鍏ㄩ儴闄勪欢" }, + { id: "5", name: "鏇存敼鍒涘缓浜�" }, + { id: "6", name: "鏍戠粨鏋勮缃�" }, + { id: "7", name: "瀹℃壒璁剧疆" }, + { id: "8", name: "鍥炶棰勮鍒楀" } + ], + editConfig: { + visible: false, + title: "鏂板缓", + infomation: {} + }, + saleChanceName: "", + contactsDeail: { + visible: false, + infomation: {} + }, + clientDeail: { + visible: false, + infomation: {} + }, + selValueList: [], + searchSel: { + value: "topic", + label: "" + }, + search_map: {} + } + }, + created() { + this.setTable() + if (!this.isDetail) { + this.search_map = {} + } else { + this.search_map = { + [this.addConfig.id_name]: this.addConfig.client_name + } + } + this.getData(this.search_map) + }, + methods: { + setTable() { + this.tableList = { + tableInfomation: [], + tableColumn: [ + { label: "浜у搧鍚嶇О", prop: "topic" }, + { label: "浜у搧缂栧彿", prop: "client_name" }, + { label: "浜у搧绫诲埆", prop: "contact_name" }, + { label: "瑙勬牸鍨嬪彿", prop: "client_status" }, + { label: "璁¢噺鍗曚綅", prop: "contact_information_name" }, + { label: "浜у搧鎶ヤ环", prop: "follow_time" }, + { label: "鍙傝�冩垚鏈环", prop: "next_follow_time" }, + { label: "鎬诲簱瀛樻暟閲�", prop: "member_name" }, + { label: "璐熻矗浜�", prop: "record" } + ] + } + this.searchOptions = [] + for (let i = 0; i < this.tableList.tableColumn.length; i++) { + const label = this.tableList.tableColumn[i].label + const value = this.tableList.tableColumn[i].prop + this.searchOptions.push({ value: value, label: label }) + } + }, + // 璇锋眰鏁版嵁 + async getData() { + this.loading = true + await getProductList({ + productName: "", + productNumber: "", + page: this.pagerOptions.currPage, + pageSize: this.pagerOptions.pageSize + }) + .then((res) => { + console.log(res) + if (res.code === 200) { + if (res.data.list && res.data.list.length > 0) { + const list = res.data.list.map((item) => { + return { + ...item + } + }) + this.tableList.tableInfomation = list || [] + this.pagerOptions.totalCount = res.data.count + } else { + this.tableList.tableInfomation = [] + } + } else { + this.tableList.tableInfomation = [] + } + this.loading = false + }) + .catch((err) => { + console.log(err) + this.tableList.tableInfomation = [] + this.loading = false + }) + }, + // 鎼滅储 + searchClick(val, content) { + console.log(val, content) + this.search_map = { + [val.value]: content + } + this.getData() + }, + resetClick() { + this.search_map = {} + this.getData() + }, + getSelectArray(val) { + console.log(val) + this.selValueList = [] + const list = val.map((item) => { + return item.id + }) + this.selValueList = list + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style lang="scss" scoped> +.product { + .top { + margin-bottom: 20px; + .btn-pager { + display: flex; + .page { + margin-left: auto; + } + } + } + .detail-top { + display: flex; + .page { + margin-left: auto; + } + } +} +</style> diff --git a/src/views/sales/quotation/AddQuotationDialog.vue b/src/views/sales/quotation/AddQuotationDialog.vue index fe4a0a6..da372c4 100644 --- a/src/views/sales/quotation/AddQuotationDialog.vue +++ b/src/views/sales/quotation/AddQuotationDialog.vue @@ -185,7 +185,7 @@ </el-row> </div> --> <!-- 浜у搧绠$悊 --> - <!-- <div class="basic-info-title" style="display: flex"> + <div class="basic-info-title" style="display: flex"> 浜у搧绠$悊 <div style="margin-left: 400px"> 甯佺 @@ -196,8 +196,13 @@ </div> </div> <div class="product-view"> - <CommonFormTableView :show-summary="showSummary" :product-table-list="productTableList" /> - </div> --> + <CommonFormTableView + :show-summary="showSummary" + :product-table-list="productTableList" + @inputContent="inputContent" + @addProductClick="addProductClick" + /> + </div> <!-- 閫夋嫨瀹℃壒娴佺▼ --> <!-- <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div> <div class="basic-info-view"> @@ -267,7 +272,7 @@ </template> <script> -// import CommonFormTableView from "@/components/makepager/CommonFormTableView" +import CommonFormTableView from "@/components/makepager/CommonFormTableView" import { getAllData } from "@/api/client/client" import { getAddQuotation, getUpdateQuotation } from "@/api/sales/quotation" import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" @@ -287,7 +292,7 @@ } } }, - components: { SelectClientDialog, SelectContactDialog, SelectChanceDialog }, + components: { SelectClientDialog, SelectContactDialog, SelectChanceDialog, CommonFormTableView }, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight @@ -320,7 +325,7 @@ showSummary: { show: true, total: true, - sumProp: ["other1", "other2", "other3", "other4"], + sumProp: ["Amount", "Unit", "other3"], mergeNumber: 3 }, editSelectClientConfig: { @@ -340,7 +345,11 @@ }, clientId: this.editCommonConfig.infomation.client_id, contactId: this.editCommonConfig.infomation.contact_id, - saleChanceId: this.editCommonConfig.infomation.sale_chance_id + saleChanceId: this.editCommonConfig.infomation.sale_chance_id, + tableData: [], + productId: 1, + addProductArr: [], + isProductName: false } }, created() { @@ -369,45 +378,45 @@ } }) }, + productNameValidate() { + for (let i = 0; i < this.tableData.length; i++) { + if (this.tableData[i].Name === "") { + this.isProductName = true + return + } else { + this.isProductName = false + } + } + }, // 淇濆瓨 saveClick(formName) { + this.productNameValidate() this.$refs[formName].validate((valid) => { if (valid) { - console.log(this.editConfig.infomation) - const params = this.saveParams() - console.log(params) - if (this.editConfig.title === "鏂板缓") { - getAddQuotation(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "娣诲姞鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + console.log(this.isProductName) + if (this.isProductName) { + this.$message.error("浜у搧鍚嶇О涓嶈兘涓虹┖") } else { - getUpdateQuotation(params) - .then((res) => { + const params = this.saveParams() + console.log(params) + if (this.editConfig.title === "鏂板缓") { + getAddQuotation(params).then((res) => { console.log(res) this.editConfig.visible = false if (res.code === 200) { - this.$message({ - message: "缂栬緫鎴愬姛", - type: "success" - }) + this.$message.success("娣诲姞鎴愬姛") this.$parent.getData() } }) - .catch((err) => { - console.log(err) + } else { + getUpdateQuotation(params).then((res) => { + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("缂栬緫鎴愬姛") + this.$parent.getData() + } }) + } } } else { console.log("error submit") @@ -427,7 +436,8 @@ number: data.number || "", quotation_status_id: data.quotation_status_id || 0, sale_chance_id: this.saleChanceId || 0, - validity_date: data.validity_date || "" + validity_date: data.validity_date || "", + products: this.tableData } return params }, @@ -502,36 +512,64 @@ // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡 setFormatClick() {}, setTableForm() { - this.productTableList = { - tableData: [ + if (this.editConfig.title === "鏂板缓") { + this.tableData = [ { - id: "1", - productName: "涓婃捣鏈夐檺鍏徃", - other0: "ZDYBD03-1", - other1: "12", - other2: "5.00", - other4: "3.00", - other3: "2.00" + id: 1, + Amount: 0, + IsSale: true, + MaterialMode: "", + MinInventory: 0, + Name: "", + Number: "", + PurchaseType: "", + SalePrice: 0, + Unit: "" } - ], + ] + } else { + this.tableData = this.editConfig.infomation.products + } + this.productTableList = { + tableData: this.tableData, tableColumn: [ { label: "#", prop: "id", width: 40 }, - { label: "鍚◣鍗曚环", prop: "other9", input: true }, - { label: "浜у搧鍚嶇О", prop: "productName", input: true, isRequird: true }, - { label: "浜у搧缂栧彿", prop: "other0" }, - { label: "鏁伴噺", prop: "other1", input: true, isRequird: true }, - { label: "鎶樻墸鐜�(%)", prop: "other6", input: true }, - { label: "涓嶅惈绋庡崟浠�", prop: "other7", input: true }, - { label: "鎶樻墸棰�", prop: "other2" }, - { label: "绋�(閿�鍞�)", prop: "other7", input: true }, - { label: "瀹為檯鍚◣鍗曚环", prop: "other3" }, - { label: "涓嶅惈绋庨噾棰�", prop: "other4" }, + { label: "浜у搧鍚嶇О", prop: "Name", input: true, isRequird: true }, + { label: "浜у搧缂栧彿", prop: "Number" }, + { label: "鏁伴噺", prop: "Amount", input: true, isRequird: true }, + { label: "閿�鍞崟浠�", prop: "Unit", input: true }, { label: "浠风◣鍚堣", prop: "other3", input: true }, - { label: "鎻忚堪", prop: "other8" }, - { label: "婧愬崟绫诲瀷", prop: "other5" }, - { label: "婧愬崟", prop: "other6" } + { label: "鎻忚堪", prop: "other8" } ] } + }, + // 浜у搧鍒楄〃杈撳叆 + inputContent(val, prop, row) { + console.log("aaaaaaaa") + console.log(val, prop) + this.productId = row.id + this.tableData.map((item) => { + if (item.id === row.id) { + item[prop] = val + } + }) + console.log(this.tableData) + }, + // 浜у搧鏂板 + addProductClick() { + this.productId++ + this.tableData.push({ + id: this.productId, + Amount: 0, + IsSale: true, + MaterialMode: "", + MinInventory: 0, + Name: "", + Number: "", + PurchaseType: "", + SalePrice: 0, + Unit: "" + }) } } } diff --git a/src/views/sales/quotation/index.vue b/src/views/sales/quotation/index.vue index 4eff953..54f7b5f 100644 --- a/src/views/sales/quotation/index.vue +++ b/src/views/sales/quotation/index.vue @@ -142,9 +142,9 @@ { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 90, isContactClick: true }, // 鑱旂郴浜哄鍚� { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉 { label: "鏈夋晥鏈�", prop: "validity_date", min: 100 }, // 淇敼鏃堕棿 - { label: "灏忚", prop: "subTotal" }, // 灏忚 - { label: "鍚堣", prop: "total" }, // 鍚堣 - { label: "浜у搧鍚嶇О", prop: "productName" }, // 浜у搧鍚嶇О + // { label: "灏忚", prop: "subTotal" }, // 灏忚 + // { label: "鍚堣", prop: "total" }, // 鍚堣 + { label: "浜у搧鍚嶇О", prop: "productName", isProduct: true }, // 浜у搧鍚嶇О { label: "鏁伴噺", prop: "number1" }, // 鏁伴噺 { label: "浠风◣鍚堣", prop: "priceTax" } // 浠风◣鍚堣 ] diff --git a/src/views/sales/salesOpportunity/index.vue b/src/views/sales/salesOpportunity/index.vue index ea1c62a..839f2a4 100644 --- a/src/views/sales/salesOpportunity/index.vue +++ b/src/views/sales/salesOpportunity/index.vue @@ -151,7 +151,7 @@ { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 100, isContactClick: true }, // 鑱旂郴浜哄鍚� { label: "閿�鍞樁娈�", prop: "sale_stage_name" }, // 閿�鍞樁娈� { label: "鍙兘鎬�(%)", prop: "possibilities" }, // 鍙兘鎬� - { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time", isTime: true, min: 130 }, // 棰勮鎴愪氦鏃ユ湡 + { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time", min: 130 }, // 棰勮鎴愪氦鏃ユ湡 { label: "棰勮鍚堝悓閲戦", prop: "projected_amount" }, // 棰勮鍚堝悓閲戦 { label: "棰勭畻缁濆鍊�", prop: "capital_budget" }, // 棰勭畻缁濆鍊� { label: "閿�鍞礋璐d汉", prop: "member_name" } // 閿�鍞礋璐d汉 diff --git a/src/views/sales/subOrder/AddSubOrderDialog.vue b/src/views/sales/subOrder/AddSubOrderDialog.vue index 9c5c59c..462727f 100644 --- a/src/views/sales/subOrder/AddSubOrderDialog.vue +++ b/src/views/sales/subOrder/AddSubOrderDialog.vue @@ -131,7 +131,11 @@ </div> </div> <div class="product-view"> - <CommonFormTableView :product-table-list="productTableList" /> + <CommonFormTableView + :product-table-list="productTableList" + @inputContent="inputContent" + @addProductClick="addProductClick" + /> </div> <!-- 鍚堣 --> <div class="basic-info-view"> @@ -281,7 +285,10 @@ infomation: {} }, clientId: this.editCommonConfig.infomation.client_id, - masterId: this.editCommonConfig.infomation.masterOrderId + masterId: this.editCommonConfig.infomation.masterOrderId, + tableData: [], + productId: 1, + addProductArr: [] } }, created() { @@ -351,17 +358,7 @@ masterOrderId: this.masterId || 0, memberId: data.memberId || 0, number: data.number || "", - product: [ - { - amount: 0, - desc: "", - id: 0, - name: "", - number: "", - price: 0, - total: 0 - } - ] + product: this.tableData } return params }, @@ -437,32 +434,64 @@ // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡 setFormatClick() {}, setTableForm() { - this.productTableList = { - tableData: [ + if (this.editConfig.title === "鏂板缓") { + this.tableData = [ { - id: "1", - productName: "涓婃捣鏈夐檺鍏徃", - other0: "ZDYBD03-1", - other1: "12", - other2: "", - other6: "3.00", - other7: "2.00" + id: 1, + Amount: 0, + IsSale: true, + MaterialMode: "", + MinInventory: 0, + Name: "", + Number: "", + PurchaseType: "", + SalePrice: 0, + Unit: "" } - ], + ] + } else { + this.tableData = this.editConfig.infomation.products + } + this.productTableList = { + tableData: this.tableData, tableColumn: [ { label: "#", prop: "id", width: 40 }, - { label: "浜у搧鍚嶇О", prop: "productName", input: true, isRequird: true }, - { label: "浜у搧缂栧彿", prop: "other0" }, - { label: "璁¢噺鍗曚綅", prop: "other2" }, - { label: "瑙勬牸缂栧彿", prop: "other3" }, - { label: "婧愬崟绫诲瀷", prop: "other4" }, - { label: "鍚堝悓淇℃伅", prop: "other5" }, - { label: "鏁伴噺", prop: "other1", input: true, isRequird: true }, - { label: "鍚◣鍗曚环", prop: "other6", input: true }, - { label: "浠风◣鍚堣", prop: "other7", input: true }, + { label: "浜у搧鍚嶇О", prop: "Name", input: true, isRequird: true }, + { label: "浜у搧缂栧彿", prop: "Number" }, + { label: "鏁伴噺", prop: "Amount", input: true, isRequird: true }, + { label: "閿�鍞崟浠�", prop: "Unit", input: true }, + { label: "浠风◣鍚堣", prop: "other3", input: true }, { label: "鎻忚堪", prop: "other8" } ] } + }, + // 浜у搧鍒楄〃杈撳叆 + inputContent(val, prop, row) { + console.log("aaaaaaaa") + console.log(val, prop) + this.productId = row.id + this.tableData.map((item) => { + if (item.id === row.id) { + item[prop] = val + } + }) + console.log(this.tableData) + }, + // 浜у搧鏂板 + addProductClick() { + this.productId++ + this.tableData.push({ + id: this.productId, + Amount: 0, + IsSale: true, + MaterialMode: "", + MinInventory: 0, + Name: "", + Number: "", + PurchaseType: "", + SalePrice: 0, + Unit: "" + }) } } } diff --git a/src/views/sales/subOrder/index.vue b/src/views/sales/subOrder/index.vue index b5369b2..bf615ca 100644 --- a/src/views/sales/subOrder/index.vue +++ b/src/views/sales/subOrder/index.vue @@ -153,8 +153,8 @@ { label: "閿�鍞�诲崟", prop: "master_order_number", min: 90, isMasterClick: true }, // 閿�鍞�诲崟 { label: "璐熻矗浜�", prop: "member_name" }, // 璐熻矗浜� // { label: "瀹℃壒鐘舵��", prop: "approvalStatus" }, // 瀹℃壒鐘舵�� - { label: "浜у搧鍚嶇О", prop: "productName" }, // 浜у搧鍚嶇О - { label: "鏁伴噺", prop: "number1", min: 100 } // 鏁伴噺 + { label: "浜у搧鍚嶇О", prop: "productName", isProductName: true }, // 浜у搧鍚嶇О + { label: "鏁伴噺", prop: "productAmount", isProductAmount: true } // 鏁伴噺 ] } this.searchOptions = [] @@ -297,4 +297,9 @@ } } } +::v-deep { + .el-table .el-table__cell { + padding: 0; + } +} </style> diff --git a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue index 0a56e12..5450cbc 100644 --- a/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue +++ b/src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue @@ -147,7 +147,7 @@ querySearchAsync(queryString, callback, 'productName') } " - value-key="name" + value-key="Name" @select="handleSelectClient('productName', $event)" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('productName')"> @@ -609,6 +609,9 @@ }, saleChancelist() { return this.$store.state.getClientName.saleChancelist + }, + productList() { + return this.$store.state.getClientName.productList } }, data() { @@ -617,7 +620,7 @@ editConfig: this.editCommonConfig, rules: { serviceNumber: [{ required: true, message: "璇疯緭鍏ユ湇鍔″崟缂栧彿", trigger: "blur" }], - faultTypeId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], + // faultTypeId: [{ required: true, message: "璇烽�夋嫨鏁呴殰绫诲埆", trigger: "change" }], subject: [{ required: true, message: "璇疯緭鍏ヤ富棰�", trigger: "blur" }], // productCategory: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], serviceManId: [{ required: true, message: "璇烽�夋嫨浜у搧绫诲埆", trigger: "change" }], @@ -688,6 +691,7 @@ this.$store.dispatch("geSalesDetails") this.$store.dispatch("geContact") this.$store.dispatch("geChance") + this.$store.dispatch("geProductList") this.getFaultTypeList() this.getSeverityList() this.getPriorityLevelList() @@ -794,7 +798,8 @@ } else if (value === "contract") { restaurants = this.salesDetailsList } else if (value === "productName") { - restaurants = this.productNameList + console.log(this.productList) + restaurants = this.productList } else if (value === "contact") { restaurants = this.contactNamelist } else if (value === "chance") { @@ -807,6 +812,8 @@ return (state) => { if (value === "serviceContract" || value === "contract") { return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + } else if (value === "productName") { + return state.Name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 } else { return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 } @@ -820,7 +827,7 @@ } else if (value === "contract") { this.SalesDetailsId = item.id } else if (value === "productName") { - this.productCategoryId = item.id + this.productNameId = item.Number } else if (value === "contact") { this.contactId = item.id } else if (value === "chance") { @@ -834,15 +841,12 @@ } else if (value === "serviceContract") { this.editSelCommonConfig.title = "鏈嶅姟鍚堝悓" this.editSelCommonConfig.editVisible = true - this.editSelCommonConfig.tableInfomation = [...this.serviceContractList] } else if (value === "contract") { this.editSelCommonConfig.title = "閿�鍞槑缁嗗崟" this.editSelCommonConfig.editVisible = true - this.editSelCommonConfig.tableInfomation = [...this.salesDetailsList] } else if (value === "productName") { this.editSelCommonConfig.title = "浜у搧鍚嶇О" this.editSelCommonConfig.editVisible = true - this.editSelCommonConfig.tableInfomation = [...this.productNameList] } else if (value === "contact") { this.editSelectContactConfig.editVisible = true } else if (value === "chance") { @@ -864,8 +868,8 @@ this.editConfig.infomation.number = row.number this.SalesDetailsId = row.id } else if (value === "productName") { - this.editConfig.infomation.product_name = row.name - this.productNameId = row.id + this.editConfig.infomation.product_name = row.Name + this.productNameId = row.Number } else if (value === "chance") { this.editConfig.infomation.sale_chance_name = row.name this.saleChanceId = row.id diff --git a/src/views/service/serviceContract/AddServiceContractDialog.vue b/src/views/service/serviceContract/AddServiceContractDialog.vue index 2cef39f..e6d5459 100644 --- a/src/views/service/serviceContract/AddServiceContractDialog.vue +++ b/src/views/service/serviceContract/AddServiceContractDialog.vue @@ -305,7 +305,11 @@ </div> </div> <div class="product-view"> - <CommonFormTableView :show-summary="showSummary" :product-table-list="productTableList" /> + <CommonFormTableView + :show-summary="showSummary" + :product-table-list="productTableList" + @addProductClick="addProductClick" + /> </div> <!-- 閫夋嫨瀹℃壒娴佺▼ --> <!-- <div class="basic-info-title">閫夋嫨瀹℃壒娴佺▼</div> @@ -475,7 +479,8 @@ contactId: this.editCommonConfig.infomation.contactId, saleChanceId: this.editCommonConfig.infomation.saleChanceId, contractId: this.editCommonConfig.infomation.salesDetailsId, - quotationId: this.editCommonConfig.infomation.quotationId + quotationId: this.editCommonConfig.infomation.quotationId, + tableData: [] } }, created() { @@ -668,36 +673,50 @@ // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡 setFormatClick() {}, setTableForm() { - this.productTableList = { - tableData: [ + if (this.editConfig.title === "鏂板缓") { + this.tableData = [ { - id: "1", - productName: "涓婃捣鏈夐檺鍏徃", - other0: "ZDYBD03-1", - other1: "12", - other2: "5.00", - other4: "3.00", - other3: "2.00" + Amount: 0, + IsSale: true, + MaterialMode: "", + MinInventory: 0, + Name: "", + Number: "", + PurchaseType: "", + SalePrice: 0, + Unit: "" } - ], + ] + } else { + this.tableData = this.editConfig.infomation.products + } + this.productTableList = { + tableData: this.tableData, tableColumn: [ { label: "#", prop: "id", width: 40 }, - { label: "浜у搧鍚嶇О", prop: "productName", input: true, isRequird: true }, - { label: "浜у搧缂栧彿", prop: "other0" }, + { label: "浜у搧鍚嶇О", prop: "Name", input: true, isRequird: true }, + { label: "浜у搧缂栧彿", prop: "Number" }, { label: "鏈嶅姟寮�濮嬫棩", prop: "other5", date: true, isRequird: true, min: 100 }, { label: "鏈嶅姟鍒版湡鏃�", prop: "other6", date: true, isRequird: true, min: 100 }, - { label: "鏁伴噺", prop: "other1", input: true, isRequird: true }, - { label: "鍚◣鍗曚环", prop: "other9", input: true }, - { label: "涓嶅惈绋庡崟浠�", prop: "other7", input: true }, - { label: "鎶樻墸鐜�(%)", prop: "other6", input: true }, - { label: "鎶樻墸棰�", prop: "other2" }, - { label: "绋�(閿�鍞�)", prop: "other7", input: true }, - { label: "瀹為檯鍚◣鍗曚环", prop: "other3" }, - { label: "涓嶅惈绋庨噾棰�", prop: "other4" }, + { label: "鏁伴噺", prop: "amount", input: true, isRequird: true }, + { label: "閿�鍞崟浠�", prop: "Unit", input: true }, { label: "浠风◣鍚堣", prop: "other3", input: true }, { label: "鎻忚堪", prop: "other8" } ] } + }, + addProductClick() { + this.tableData.push({ + Amount: 0, + IsSale: true, + MaterialMode: "", + MinInventory: 0, + Name: "", + Number: "", + PurchaseType: "", + SalePrice: 0, + Unit: "" + }) } } } diff --git a/src/views/service/serviceFeeManage/index.vue b/src/views/service/serviceFeeManage/index.vue index 30b8714..8777d37 100644 --- a/src/views/service/serviceFeeManage/index.vue +++ b/src/views/service/serviceFeeManage/index.vue @@ -92,8 +92,8 @@ { label: "瀹㈡埛缂栧彿", prop: "client_id" }, // 瀹㈡埛缂栧彿 { label: "瀹㈡埛鐘舵��", prop: "client_status_id" }, // 瀹㈡埛鐘舵�� { label: "浜у搧鍚嶇О", prop: "productName" }, // 浜у搧鍚嶇О - // { label: "鏈嶅姟寮�濮嬫棩鏈�", prop: "startDate", isTime: true, width: 150 }, // 鏈嶅姟寮�濮嬫棩鏈� - { label: "鏈嶅姟鍒版湡鏃�", prop: "latest_date", isTime: true, width: 160 } // 鏈嶅姟鍒版湡鏃� + // { label: "鏈嶅姟寮�濮嬫棩鏈�", prop: "startDate", width: 150 }, // 鏈嶅姟寮�濮嬫棩鏈� + { label: "鏈嶅姟鍒版湡鏃�", prop: "latest_date", width: 160 } // 鏈嶅姟鍒版湡鏃� ] } this.searchOptions = [] -- Gitblit v1.8.0