| | |
| | | :visible.sync="editConfig.visible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | | append-to-body |
| | | custom-class="iframe-dialog" |
| | | > |
| | | <el-form |
| | | ref="form" |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :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 class="common-select-btn" @click="clearupClient"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="服务合同编号" prop="serviceContractNumber"> |
| | | <el-input v-model="editConfig.infomation.serviceContractNumber"></el-input> |
| | | <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="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="contactName"> |
| | | <el-form-item label="联系人姓名" prop="contactId"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.contactName"></el-input> |
| | | <el-input v-model="editConfig.infomation.contactId"></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="salesOpportunity"> |
| | | <el-form-item label="销售机会" prop="saleChanceId"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.salesOpportunity"></el-input> |
| | | <el-input v-model="editConfig.infomation.saleChanceId"></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="contractOrder"> |
| | | <el-form-item label="合同订单" prop="contractId"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.contractOrder"></el-input> |
| | | <el-input v-model="editConfig.infomation.contractId"></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="quotation"> |
| | | <el-form-item label="报价单" prop="quotationId"> |
| | | <div class="custom-name"> |
| | | <el-input v-model="editConfig.infomation.quotation"></el-input> |
| | | <el-input v-model="editConfig.infomation.quotationId"></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="contractType"> |
| | | <CommonSelectView |
| | | :common-value="editConfig.infomation.contractType" |
| | | :common-options="contractTypeOptions" |
| | | /> |
| | | <el-form-item label="合同类型" prop="typeId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.typeId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | > |
| | | <el-option v-for="item in contractTypeOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | <div class="common-select-btn"><i class="el-icon-setting"></i></div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="签约日期" prop="signDate"> |
| | | <el-date-picker v-model="editConfig.infomation.signDate" type="date" placeholder="选择日期"> |
| | | <el-form-item label="签约日期" prop="signTime"> |
| | | <el-date-picker v-model="editConfig.infomation.signTime" type="date" placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="服务开始日期" prop="startDate"> |
| | | <el-date-picker v-model="editConfig.infomation.startDate" type="date" placeholder="选择日期"> |
| | | <el-form-item label="服务开始日期" prop="startTime"> |
| | | <el-date-picker v-model="editConfig.infomation.startTime" type="date" placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="服务到期日" prop="endDate"> |
| | | <el-date-picker v-model="editConfig.infomation.endDate" type="date" placeholder="选择日期"> |
| | | <el-form-item label="服务到期日" prop="endTime"> |
| | | <el-date-picker v-model="editConfig.infomation.endTime" type="date" placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="合同状态" prop="contractStatus"> |
| | | <CommonSelectView |
| | | :common-value="editConfig.infomation.contractStatus" |
| | | :common-options="contractStatusOptions" |
| | | /> |
| | | <el-form-item label="合同状态" prop="statusId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.statusId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | > |
| | | <el-option |
| | | v-for="item in contractStatusOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <div class="common-select-btn"><i class="el-icon-setting"></i></div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="应服务次数" prop="serviceNumber"> |
| | | <el-input v-model="editConfig.infomation.serviceNumber"></el-input> |
| | | <el-form-item label="应服务次数" prop="serviceTimes"> |
| | | <el-input v-model="editConfig.infomation.serviceTimes"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 条款与条件 --> |
| | | <div class="basic-info-title">条款与条件</div> |
| | | <div class="address-view"> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="条款和条约" prop="termsTreaty"> |
| | | <el-form-item label="条款和条约" prop="terms"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 4, maxRows: 6 }" |
| | | placeholder="请输入内容" |
| | | v-model="editConfig.infomation.termsTreaty" |
| | | v-model="editConfig.infomation.terms" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="notes"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 2, maxRows: 4 }" |
| | | placeholder="请输入内容" |
| | | v-model="editConfig.infomation.notes" |
| | | v-model="editConfig.infomation.remark" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <CommonFormTableView :show-summary="showSummary" :product-table-list="productTableList" /> |
| | | </div> |
| | | <!-- 选择审批流程 --> |
| | | <div class="basic-info-title">选择审批流程</div> |
| | | <!-- <div class="basic-info-title">选择审批流程</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> --> |
| | | </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="editConfig.visible = false">保存</el-button> |
| | | <!-- <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 CommonSelectView from "@/components/makepager/CommonSelectView" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | import { getAllData } from "@/api/client/client" |
| | | import { getAddServiceContract, getUpdateServiceContract } from "@/api/serviceManage/serviceContract" |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | export default { |
| | | name: "AddServiceContractDialog", |
| | | props: { |
| | |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: { |
| | | customName: "", |
| | | serviceContractNumber: "AC6521", |
| | | owner: "5", |
| | | contactName: "", |
| | | salesOpportunity: "", |
| | | contractOrder: "", |
| | | quotation: "", |
| | | contractType: "", |
| | | signDate: "", |
| | | startDate: "", |
| | | endDate: "", |
| | | contractStatus: "", |
| | | serviceNumber: "", |
| | | termsTreaty: "", |
| | | notes: "", |
| | | approvalWorkflow: "", |
| | | approvalSteps: "", |
| | | approvalPerson: "", |
| | | approvalOpinion: "" |
| | | } |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | components: { CommonSelectView, CommonFormTableView }, |
| | | components: { CommonFormTableView, SelectClientDialog }, |
| | | computed: { |
| | | searchCommonHeight() { |
| | | return this.$refs.searchCommonView.offsetHeight |
| | | }, |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | dialogWidth: "80%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | serviceContractNumber: [{ required: true, message: "请输入服务合同编号", trigger: "blur" }], |
| | | signDate: [{ required: true, message: "请选择", trigger: "change" }], |
| | | owner: [{ required: true, message: "请选择负责人", trigger: "change" }] |
| | | number: [{ required: true, message: "请输入服务合同编号", trigger: "blur" }], |
| | | signTime: [{ required: true, message: "请选择", trigger: "change" }], |
| | | 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: [], |
| | | contractTypeOptions: [], // 合同类型 |
| | | contractStatusOptions: [], // 合同状态 |
| | | currencyOptions: [ |
| | |
| | | total: true, |
| | | sumProp: ["other1", "other2", "other3", "other4"], |
| | | mergeNumber: 3 |
| | | }, |
| | | editSelectClientConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.setTableForm() |
| | | this.getCommonData() |
| | | }, |
| | | methods: { |
| | | getCommonData() { |
| | | getAllData() |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.memberOptions = res.data.member |
| | | this.contractTypeOptions = res.data.serviceContractType |
| | | this.contractStatusOptions = res.data.serviceContractStatus |
| | | this.currencyOptions = res.data.currency |
| | | } |
| | | }) |
| | | .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 === "新建") { |
| | | getAddServiceContract(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 { |
| | | getUpdateServiceContract(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, |
| | | clientId: parseInt(data.clientId) || 0, |
| | | contactId: data.contactId || 0, |
| | | contractId: data.contractId || 0, |
| | | endTime: data.endTime || "", |
| | | memberId: data.memberId || 0, |
| | | number: data.number || "", |
| | | products: [ |
| | | { |
| | | amount: 0, |
| | | desc: "", |
| | | id: 0, |
| | | name: "", |
| | | number: "", |
| | | price: 0, |
| | | total: 0 |
| | | } |
| | | ], |
| | | quotationId: data.quotationId || 0, |
| | | remark: data.remark || "", |
| | | saleChanceId: data.saleChanceId || 0, |
| | | serviceTimes: data.serviceTimes || 0, |
| | | signTime: data.signTime || "", |
| | | startTime: data.startTime || "", |
| | | statusId: data.statusId || 0, |
| | | terms: data.terms || "", |
| | | typeId: data.typeId || 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() {}, |
| | | // 设置允许上传文件格式 |
| | | setFormatClick() {}, |
| | | setTableForm() { |
| | | this.productTableList = { |
| | | tableData: [ |
| | |
| | | { label: "描述", prop: "other8" } |
| | | ] |
| | | } |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 添加附件 |
| | | addAnnexClick() {}, |
| | | // 设置允许上传文件格式 |
| | | setFormatClick() {} |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .add-service-contract { |
| | | .basic-info { |
| | | .basic-info-title { |
| | | background-color: #f4f8fe; |
| | | padding-left: 10px; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | color: #666; |
| | | height: 42px; |
| | | line-height: 42px; |
| | | } |
| | | .basic-info-view { |
| | | margin-top: 10px; |
| | | padding-right: 40px; |
| | | .custom-name { |
| | | ::v-deep { |
| | | .iframe-dialog .el-dialog__body { |
| | | .basic-info { |
| | | .basic-info-title { |
| | | background-color: #f4f8fe; |
| | | padding-left: 10px; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | color: #666; |
| | | height: 42px; |
| | | line-height: 42px; |
| | | } |
| | | .basic-info-view { |
| | | margin-top: 10px; |
| | | padding-right: 40px; |
| | | .custom-name, |
| | | .common-select { |
| | | display: flex; |
| | | .common-select-sel { |
| | | width: 270px; |
| | | } |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | | font-size: 16px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | .annex-view { |
| | | display: flex; |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | | font-size: 18px; |
| | | color: #6166d3; |
| | | .setFormat { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | } |
| | | .address-view { |
| | | margin-top: 10px; |
| | | padding-right: 40px; |
| | | } |
| | | .annex-view { |
| | | .unflod-collapse { |
| | | display: flex; |
| | | height: 30px; |
| | | justify-content: center; |
| | | align-items: center; |
| | | color: #6166d3; |
| | | .setFormat { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | } |
| | | .unflod-collapse { |
| | | display: flex; |
| | | height: 30px; |
| | | justify-content: center; |
| | | align-items: center; |
| | | color: #6166d3; |
| | | } |
| | | .dialog-footer { |
| | | 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; |
| | | .dialog-footer { |
| | | background-color: #f5f5f5; |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | } |
| | | } |