| | |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="308px" |
| | | label-width="30%" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="订单编号" prop="number"> |
| | | <WordInput |
| | | v-if="codenumer && (explain != '' || isIdDisabled) && method == 0" |
| | | :codenumer="codenumer" |
| | | :sum="sum" |
| | | :disabled="editConfig.title !== '新建' || isIdDisabled" |
| | | :inputValue="inputValue" |
| | | @codeList="codeList" |
| | | /> |
| | | <span v-else-if="method == 0" style="color: #f56c6c" |
| | | >请优先配置编码规范 <el-button type="text" @click="numberClick"> 配置规范 </el-button></span |
| | | > |
| | | <span v-else>{{ editConfig.title === "新建" ? "自动生成" : editConfig.infomation.number }}</span> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户名称" prop="client_name"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | style="width: 100%" |
| | | v-model="editConfig.infomation.client_name" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient('client', $event)" |
| | | :disabled="isNameChanceEdit" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('client')"> |
| | | <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('client')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0" |
| | | v-if=" |
| | | editConfig.infomation.client_name && |
| | | editConfig.infomation.client_name.length > 0 && |
| | | !isNameChanceEdit |
| | | " |
| | | class="common-select-btn" |
| | | @click="clearupClient('client')" |
| | | > |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="订单编号" prop="number"> |
| | | <el-input v-model="editConfig.infomation.number"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售机会" prop="saleChanceId"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | style="width: 100%" |
| | | v-model="editConfig.infomation.sale_chance_name" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient('chance', $event)" |
| | | :disabled="isNameChanceEdit" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('chance')"> |
| | | <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('chance')"> |
| | | <i class="el-icon-circle-plus-outline"></i> |
| | | </div> |
| | | <div |
| | | v-if="editConfig.infomation.sale_chance_name && editConfig.infomation.sale_chance_name.length > 0" |
| | | v-if=" |
| | | editConfig.infomation.sale_chance_name && |
| | | editConfig.infomation.sale_chance_name.length > 0 && |
| | | !isNameChanceEdit |
| | | " |
| | | class="common-select-btn" |
| | | @click="clearupClient('chance')" |
| | | > |
| | | <i class="el-icon-edit-outline"></i> |
| | | <i class="el-icon-remove-outline"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售子单" prop="subbill_name"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | style="width: 100%" |
| | | v-model="editConfig.infomation.subbill_name" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'subbill') |
| | | } |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient('subbill', $event)" |
| | | :disabled="isNameChanceEdit" |
| | | ></el-autocomplete> |
| | | <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('client')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if=" |
| | | editConfig.infomation.subbill_name && |
| | | editConfig.infomation.subbill_name.length > 0 && |
| | | !isNameChanceEdit |
| | | " |
| | | class="common-select-btn" |
| | | @click="clearupClient('subbill')" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | style="width: 100%" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | |
| | | v-model="editConfig.infomation.memberId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 63%" |
| | | style="width: 100%" |
| | | > |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | style="width: 100%" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | |
| | | <el-input v-model="editConfig.infomation.phone"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="收货地址" prop="address"> |
| | | <el-input |
| | | style="width: 100%" |
| | | type="textarea" |
| | | :autosize="{ minRows: 2 }" |
| | | v-model="editConfig.infomation.address" |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="条款与条件" prop="conditions"> |
| | | <el-form-item label="条款与条件" prop="conditions" label-width="15%"> |
| | | <el-input |
| | | style="width: 100%" |
| | | type="textarea" |
| | | :autosize="{ minRows: 4 }" |
| | | v-model="editConfig.infomation.conditions" |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-form-item label="备注" prop="remark" label-width="15%"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 2 }" |
| | |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog" |
| | | import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan" |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" |
| | | import { getSaleChanceList} from "@/api/sales/salesOpportunity" |
| | | import { getSubOrderList } from "@/api/sales/subOrder" |
| | | |
| | | import {mapActions} from "vuex" |
| | | |
| | | export default { |
| | | name: "AddSalesDetailsDialog", |
| | | mixins: [codeMixin], |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | |
| | | }, |
| | | saleChancelist() { |
| | | return this.$store.state.getClientName.saleChancelist |
| | | }, |
| | | subOrderList(){ |
| | | return this.$store.state.getClientName.subOrderList |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | dialogWidth: "50%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: "change" }], |
| | | // subbill_name: [{ required: true, message: "请选择销售子单", trigger: "change" }], |
| | | number: [{ required: true, message: "请输入订单编号", trigger: "blur" }], |
| | | signTime: [{ required: true, message: "请选择签约日期", trigger: "change" }], |
| | | memberId: [{ required: true, message: "请选择销售负责人", trigger: "change" }] |
| | |
| | | }, |
| | | clientId: this.editCommonConfig.infomation.client_id, |
| | | saleChanceId: this.editCommonConfig.infomation.saleChanceId, |
| | | subbillId:this.editCommonConfig.infomation.subbillId, |
| | | productId: 1, |
| | | isNoProduct: true, |
| | | addCollectionConfig: { |
| | |
| | | title: "新建", |
| | | infomation: {} |
| | | }, |
| | | amountTotal: 0 |
| | | amountTotal: 0, |
| | | isNameChanceEdit: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geChance") |
| | | this.$store.dispatch("getSubunit") |
| | | this.setTableForm() |
| | | this.getCommonData() |
| | | this.formInfo() |
| | | // if (this.editConfig.title === "新建" && this.editConfig.infomation.client_name.length > 0) { |
| | | // this.isNameChanceEdit = true |
| | | // } |
| | | // else { |
| | | |
| | | // } |
| | | }, |
| | | watch: { |
| | | "editClientManageConfig.visible"(val) { |
| | | if (val) { |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | "editClientManageConfig.infomation.codeStandID"() { |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | methods: { |
| | | ...mapActions(["getChanceFilter","getSubunitFliter"]), |
| | | formInfo() { |
| | | this.objCode.type = "销售明细编码" |
| | | this.objCode.codeStandID = "" |
| | | if (this.editConfig.infomation.codeStandID) { |
| | | this.objCode.codeStandID = this.editConfig.infomation.codeStandID |
| | | } |
| | | this.getRCodeStandardList() |
| | | }, |
| | | getCommonData() { |
| | | getAllData() |
| | | .then((res) => { |
| | |
| | | wechatOrderStatus: data.wechatOrderStatus || 0, |
| | | logisticCompany: data.logisticCompany || "", |
| | | logisticCost: data.logisticCost || 0, |
| | | logisticNumber: data.logisticNumber || "" |
| | | logisticNumber: data.logisticNumber || "", |
| | | codeRule: this.codeRule |
| | | } |
| | | let params = {} |
| | | if (this.editConfig.title === "新建") { |
| | |
| | | var restaurants = [] |
| | | if (value === "client") { |
| | | restaurants = this.clientList |
| | | console.log(restaurants,"客户单") |
| | | } else if (value === "chance") { |
| | | restaurants = this.saleChancelist |
| | | }else if(value==="subbill"){ |
| | | let arr=[] |
| | | this.subOrderList.map((item)=>{ |
| | | arr.push(item.client) |
| | | }) |
| | | restaurants=arr |
| | | console.log("子丹",restaurants,arr) |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants |
| | | cb(results) |
| | |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } |
| | | }, |
| | | handleSelectClient(value, item) { |
| | | async handleSelectClient(value, item) { |
| | | if (value === "client") { |
| | | this.clientId = item.id |
| | | this.editConfig.infomation.client_name = item.name |
| | | // 需要修改 |
| | | await getSaleChanceList({ |
| | | client_id:this.clientId |
| | | }).then((res)=>{ |
| | | }) |
| | | await getSubOrderList({ |
| | | page:1, |
| | | pageSize:15, |
| | | search_map:{ |
| | | client_id:item.id |
| | | } |
| | | }).then((res)=>{ |
| | | this.getSubunitFliter(res.data.list) |
| | | }) |
| | | } else if (value === "chance") { |
| | | this.saleChanceId = item.id |
| | | this.editConfig.infomation.client_name = item.name |
| | | }else if(value==="subbill"){ |
| | | console.log("下拉框点击",item) |
| | | this.subbillId = item.id |
| | | this.editConfig.infomation.subbill_name = item.name |
| | | } |
| | | }, |
| | | selClientClick(value) { |
| | | if (value === "client") { |
| | | this.editSelectClientConfig.editVisible = true |
| | | } else if (value === "chance") { |
| | | this.editSelectChanceConfig.editVisible = true |
| | | }else if(value==="subbill"){ |
| | | this.editSelectChanceConfig.editVisible = true |
| | | } |
| | | }, |
| | |
| | | } else if (value === "chance") { |
| | | this.editConfig.infomation.sale_chance_name = row.name |
| | | this.saleChanceId = row.id |
| | | }else if(value==="subbill"){ |
| | | this.editConfig.infomation.subbill_name = row.name |
| | | this.subbillId=row.id |
| | | } |
| | | }, |
| | | // 清除已选择用户 |
| | |
| | | } else if (value === "chance") { |
| | | this.editConfig.infomation.sale_chance_name = "" |
| | | this.saleChanceId = 0 |
| | | }else if(value==="subbill"){ |
| | | this.editConfig.infomation.subbill_name = "" |
| | | this.subbillId=0 |
| | | } |
| | | }, |
| | | // 添加附件 |
| | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .iframe-dialog .el-dialog__body { |
| | | .el-form { |
| | | .el-form-item { |
| | | width: 100%; |
| | | } |
| | | } |
| | | .basic-info { |
| | | .basic-info-title { |
| | | background-color: #f4f8fe; |