| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col v-if="isUnflod" :span="12"> |
| | | <el-form-item label="客户名称" prop="customName"> |
| | | <el-form-item label="客户名称" prop="client_name"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.customName"></el-input> |
| | | <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="选择"></i></div> |
| | | <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.client_name" |
| | | :fetch-suggestions="querySearchAsync" |
| | | value-key="name" |
| | | @select="handleSelectClient" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0" |
| | | class="common-select-btn" |
| | | @click="clearupClient" |
| | | > |
| | | <i class="el-icon-remove-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="isUnflod" :span="12"> |
| | | <el-form-item label="单据编号" prop="documentNumber"> |
| | | <el-input v-model="editConfig.infomation.documentNumber"></el-input> |
| | | <el-form-item label="单据编号" prop="number"> |
| | | <el-input v-model="editConfig.infomation.number"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="isUnflod" :span="12"> |
| | | <el-form-item label="负责人" prop="owner"> |
| | | <el-select v-model="editConfig.infomation.owner" placeholder="请选择" size="mini" style="width: 63%"> |
| | | <el-option v-for="item in ownerOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | <el-form-item label="负责人" prop="memberId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.memberId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 63%" |
| | | > |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售子单" prop="subOrder"> |
| | | <el-form-item label="销售子单" prop="subOrderId"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.subOrder"></el-input> |
| | | <el-input v-model="editConfig.infomation.subOrderId"></el-input> |
| | | <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="选择"></i></div> |
| | | <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售明细单" prop="salesDetails"> |
| | | <el-form-item label="销售明细单" prop="salesDetailsId"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.salesDetails"></el-input> |
| | | <el-input v-model="editConfig.infomation.salesDetailsId"></el-input> |
| | | <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="选择"></i></div> |
| | | <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div> |
| | | </div> |
| | |
| | | <div class="address-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计划开始时间" prop="planStartTime"> |
| | | <el-date-picker v-model="editConfig.infomation.planStartTime" type="datetime" default-time="12:00:00"> |
| | | <el-form-item label="计划开始时间" prop="startTime"> |
| | | <el-date-picker v-model="editConfig.infomation.startTime" type="datetime" default-time="12:00:00"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="计划截止时间" prop="planDeadline"> |
| | | <el-date-picker v-model="editConfig.infomation.planDeadline" type="datetime" default-time="12:00:00"> |
| | | <el-form-item label="计划截止时间" prop="endTime"> |
| | | <el-date-picker v-model="editConfig.infomation.endTime" type="datetime" default-time="12:00:00"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="计划内容" prop="refundReason"> |
| | | <el-form-item label="计划内容" prop="content"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 2 }" |
| | | v-model="editConfig.infomation.refundReason" |
| | | v-model="editConfig.infomation.content" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" size="small" @click="editConfig.visible = false">保存</el-button> |
| | | <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button> |
| | | <el-button size="small" @click="editConfig.visible = false">取消</el-button> |
| | | </div> |
| | | <!-- 选择客户 --> |
| | | <SelectClientDialog |
| | | v-if="editSelectClientConfig.editVisible" |
| | | :edit-common-config="editSelectClientConfig" |
| | | @selClient="selClient" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAllData } from "@/api/client/client" |
| | | import { getAddPlan, getUpdatePlan } from "@/api/sales/generatePlan" |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | export default { |
| | | name: "AddGeneratePlanDialog", |
| | | props: { |
| | |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: { |
| | | customName: "", |
| | | documentNumber: "", |
| | | owner: "", |
| | | subOrder: "", |
| | | salesDetails: "", |
| | | planStartTime: "", |
| | | planDeadline: "" |
| | | } |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | components: {}, |
| | | computed: {}, |
| | | components: { SelectClientDialog }, |
| | | computed: { |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | documentNumber: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | owner: [{ required: true, message: "请选择", trigger: "change" }] |
| | | number: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | memberId: [{ required: true, message: "请选择", trigger: "change" }] |
| | | }, |
| | | ownerOptions: [ |
| | | // 负责人 |
| | | { value: "1", label: "BOSS" }, |
| | | { value: "2", label: "Mia" }, |
| | | { value: "3", label: "财务" }, |
| | | { value: "4", label: "市场" }, |
| | | { value: "5", label: "系统管理员" }, |
| | | { value: "6", label: "销售" }, |
| | | { value: "7", label: "销售总监" } |
| | | ], |
| | | memberOptions: [], |
| | | unflodCollapseStr: "收起", |
| | | isUnflod: true |
| | | isUnflod: true, |
| | | editSelectClientConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | } |
| | | } |
| | | }, |
| | | created() {}, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.getCommonData() |
| | | }, |
| | | methods: { |
| | | getCommonData() { |
| | | getAllData() |
| | | .then((res) => { |
| | | this.memberOptions = res.data.member |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | // 保存 |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.editConfig.infomation) |
| | | const params = this.saveParams() |
| | | console.log(params) |
| | | if (this.editConfig.title === "新建") { |
| | | getAddPlan(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) |
| | | }) |
| | | } else { |
| | | getUpdatePlan(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) |
| | | }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | | let params = { |
| | | id: this.editConfig.title === "新建" ? 0 : data.id, |
| | | plan: { |
| | | clientId: parseInt(data.clientId) || 0, |
| | | content: data.content || "", |
| | | endTime: data.endTime || "", |
| | | file: data.file || "", |
| | | memberId: data.memberId || 0, |
| | | number: data.number || "", |
| | | salesDetailsId: data.salesDetailsId || 0, |
| | | startTime: data.startTime || "", |
| | | subOrderId: data.subOrderId || 0 |
| | | } |
| | | } |
| | | return params |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb) { |
| | | var restaurants = this.clientList |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants |
| | | cb(results) |
| | | }, |
| | | createStateFilter(queryString) { |
| | | return (state) => { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } |
| | | }, |
| | | handleSelectClient(item) { |
| | | this.editConfig.infomation.client_id = item.id |
| | | }, |
| | | selClientClick() { |
| | | this.editSelectClientConfig.editVisible = true |
| | | }, |
| | | selClient(row) { |
| | | console.log(row) |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.editConfig.infomation.client_id = row.id |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient() { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.editConfig.infomation.client_id = 0 |
| | | }, |
| | | // 添加附件 |
| | | addAnnexClick() {}, |
| | |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | |
| | | background-color: #f5f5f5; |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | } |
| | | ::v-deep { |
| | | .el-dialog__header { |
| | | padding: 12.5px 10px; |
| | | border-bottom: 1px solid #e5e5e5; |
| | | .el-dialog__title { |
| | | font-size: 15px; |
| | | color: #323232; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | .el-dialog__body { |
| | | padding: 0px; |
| | | } |
| | | .el-dialog__footer { |
| | | padding: 0px; |
| | | text-align: center; |
| | | box-sizing: border-box; |
| | | border-top: 1px solid #dadee5; |
| | | } |
| | | .product-view { |
| | | .el-form-item__label { |
| | | padding: 0; |
| | | } |
| | | } |
| | | } |
| | | </style> |