New file |
| | |
| | | import request from "@/common/untils/request.js" |
| | | import axios from "axios" |
| | | |
| | | // 获取收款计划 |
| | | export const getCollectionPlanList = async (data) => { |
| | | return await axios.get(`/api/serviceCollectionPlan/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | | // 添加收款计划 |
| | | export function addCollectionPlan(data) { |
| | | return request({ |
| | | url: "/api/serviceCollectionPlan/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 更新收款计划 |
| | | export function updateCollectionPlan(data) { |
| | | return request({ |
| | | url: "/api/serviceCollectionPlan/update", |
| | | method: "put", |
| | | data |
| | | }) |
| | | } |
| | | // 删除收款计划 |
| | | export function deleteCollectionPlan(data) { |
| | | return request({ |
| | | url: "/api/serviceCollectionPlan/delete/" + data.id, |
| | | method: "delete" |
| | | }) |
| | | } |
| | | |
| | | // 获取收款单 |
| | | export const getReceiptList = async (data) => { |
| | | return await axios.get(`/api/receipt/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | | // 添加收款单 |
| | | export function addReceipt(data) { |
| | | return request({ |
| | | url: "/api/receipt/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 更新收款单 |
| | | export function updateReceipt(data) { |
| | | return request({ |
| | | url: "/api/receipt/update", |
| | | method: "put", |
| | | data |
| | | }) |
| | | } |
| | | // 删除收款单 |
| | | export function deleteReceipt(data) { |
| | | return request({ |
| | | url: "/api/receipt/delete/" + data.id, |
| | | method: "delete" |
| | | }) |
| | | } |
| | | |
| | | // 获取销售发票 |
| | | export const getInvoiceList = async (data) => { |
| | | return await axios.get(`/api/invoice/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | | // 添加销售发票 |
| | | export function addInvoice(data) { |
| | | return request({ |
| | | url: "/api/invoice/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 更新销售发票 |
| | | export function updateInvoice(data) { |
| | | return request({ |
| | | url: "/api/invoice/update", |
| | | method: "put", |
| | | data |
| | | }) |
| | | } |
| | | // 删除销售发票 |
| | | export function deleteInvoice(data) { |
| | | return request({ |
| | | url: "/api/invoice/delete/" + data.id, |
| | | method: "delete" |
| | | }) |
| | | } |
| | | |
| | | // 获取银行账户列表 |
| | | export const getBankAccountList = async (data) => { |
| | | return await axios.get(`/api/bankAccount/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 获取支付方式列表 |
| | | export const getPaymentTypeList = async (data) => { |
| | | return await axios.get(`/api/paymentType/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 获取发票类别列表 |
| | | export const getInvoiceTypeList = async (data) => { |
| | | return await axios.get(`/api/invoiceType/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 票据状态列表 |
| | | export const getInvoiceStatusList = async (data) => { |
| | | return await axios.get(`/api/invoiceStatus/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 物理公司列表 |
| | | export const getCourierCompanyList = async (data) => { |
| | | return await axios.get(`/api/courierCompany/list`, { |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | <div v-if="!detailEnter" style="margin: 10px"> |
| | | <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> |
| | | <el-button size="small" type="primary" @click="empty">清空</el-button> |
| | | <el-button size="small" type="primary" @click="recalculate">重算</el-button> |
| | | </div> |
| | | <div v-if="showSummary.total || showSummary.refundable" style="height: 42px; line-height: 42px"> |
| | | <el-row :gutter="10"> |
| | | <el-col v-if="showSummary.total" :span="2" :offset="22"> |
| | | <span style="font-weight: bold">合计</span> |
| | | <span style="margin-left: 10px">0.00</span> |
| | | <span style="margin-left: 10px">{{ total }}</span> |
| | | </el-col> |
| | | <el-col v-if="showSummary.refundable" :span="2" :offset="22"> |
| | | <span style="font-weight: bold">应退款</span> |
| | |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | return { |
| | | total: 0 |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | |
| | | return this.number_format(prev, 2, ".", ",") |
| | | } |
| | | }, 0) |
| | | if (column.property === "total") { |
| | | this.total = sums[index] |
| | | } |
| | | sums[index] |
| | | } |
| | | }) |
| | |
| | | } |
| | | return s.join(dec) |
| | | }, |
| | | // 新增 |
| | | add() { |
| | | this.$emit("addProductClick") |
| | | }, |
| | |
| | | console.log(val, prop) |
| | | console.log(row) |
| | | this.$emit("inputContent", val, prop, row) |
| | | }, |
| | | // 清空 |
| | | empty() { |
| | | this.$emit("emptyProductClick") |
| | | }, |
| | | // 重算 |
| | | recalculate() { |
| | | this.$confirm("确定要重算明细所有行?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.$emit("recalculateProductClick") |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | } |
| | | } |
| | |
| | | .content { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | height: calc(100vh - 60px); |
| | | height: calc(100vh - 70px); |
| | | } |
| | | </style> |
| | |
| | | provinceOptions: [], // 省份 |
| | | cityOptions: [], // 城市 |
| | | regionOptions: [], // 区域 |
| | | approvalWorkflowOptions: [] // 审批流程 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | clientName: this.editClientManageConfig.infomation.name |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | // 查重 |
| | | async checkNameClient(rule, value, callback) { |
| | | if (this.editConfig.title === "新建") { |
| | | if (this.editConfig.title === "新建" || this.clientName !== this.editConfig.infomation.name) { |
| | | await checkNameClient({ name: value }).then((res) => { |
| | | if (res.data.code === 700001) { |
| | | return callback(new Error("客户名称重复")) |
| | |
| | | <el-tab-pane label="公海客户" name="first"></el-tab-pane> |
| | | <el-tab-pane label="我的客户" name="second"></el-tab-pane> |
| | | </el-tabs> |
| | | <div class="sel-gonghai"> |
| | | <!-- <div class="sel-gonghai"> |
| | | <el-select v-model="gonghaiValue" placeholder="请选择" class="query-class-sel" size="mini" disabled> |
| | | <el-option v-for="item in gonghaiOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | |
| | | <div class="query-class-btn"> |
| | | <i class="el-icon-setting"></i> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <div class="top"> |
| | | <SearchCommonView |
| | |
| | | .content { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | height: calc(100vh - 60px); |
| | | height: calc(100vh - 70px); |
| | | } |
| | | </style> |
| | |
| | | { label: "服务单编号", prop: "serviceNumber", isClick: true }, // 服务单编号 |
| | | { label: "主题", prop: "subject" }, // 主题 |
| | | { label: "服务方式", prop: "serviceType_name" }, // 服务方式 |
| | | { label: "服务人员", prop: "serviceManId" }, // 服务人员 |
| | | { label: "优先级别", prop: "priorityLevelId" }, // 优先级别 |
| | | { label: "处理状态", prop: "status" }, // 处理状态 |
| | | { label: "服务人员", prop: "serviceMan_name" }, // 服务人员 |
| | | { label: "优先级别", prop: "priorityLevel_name" }, // 优先级别 |
| | | { label: "处理状态", prop: "serviceOrderStatus_name" }, // 处理状态 |
| | | { label: "客户签名", prop: "qianming" } // 客户签名 |
| | | ] |
| | | } |
| | |
| | | pageSize: 0 |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | if (res.data.data && res.data.data.length > 0) { |
| | | const list = res.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 |
| | | serviceContract_Number: item.ServiceContract.number, |
| | | serviceMan_name: item.serviceMan.username, |
| | | priorityLevel_name: item.PriorityLevel.name, |
| | | serviceOrderStatus_name: item.ServiceOrderStatus_name |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list.slice(0, 5) || [] |
New file |
| | |
| | | <template> |
| | | <div class="add-collectionPlan"> |
| | | <el-dialog |
| | | :title="editCommonConfig.title + '收款计划'" |
| | | :visible.sync="editConfig.visible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | | append-to-body |
| | | custom-class="iframe-dialog" |
| | | > |
| | | <!-- 信息 --> |
| | | <div class="basic-info"> |
| | | <div class="collection-view"> |
| | | <div class="label">收款计划类型</div> |
| | | <el-select v-model="editConfig.infomation.collectionType" size="mini"> |
| | | <el-option label="计划收款日期" value="1"></el-option> |
| | | <el-option label="项目状态" value="2"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="collection-view"> |
| | | <div class="label">币种</div> |
| | | <el-select v-model="editConfig.infomation.moneyType" size="mini"> |
| | | <el-option label="人民币" value="人民币"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="collection-view"> |
| | | <div class="label">金额</div> |
| | | <div>{{ editConfig.infomation.amount }}</div> |
| | | </div> |
| | | <div class="collection-view"> |
| | | <div class="label">未计划金额</div> |
| | | <div>{{ editConfig.infomation.amount }}</div> |
| | | </div> |
| | | <div class="collection-view"> |
| | | <div class="label">收款计划负责人</div> |
| | | <el-select |
| | | v-model="editConfig.infomation.principalId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | @change="principalClick" |
| | | > |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <!-- 产品管理 --> |
| | | <div class="product-view"> |
| | | <el-table |
| | | ref="table" |
| | | border |
| | | :data="tableData.tableInfomation" |
| | | tooltip-effect="dark" |
| | | style="width: 100%" |
| | | :header-cell-style="{ background: '#ECF4FF', color: '#666' }" |
| | | > |
| | | <el-table-column |
| | | v-for="(item, i) in tableData.tableColumn" |
| | | :key="i" |
| | | :prop="item.prop" |
| | | :label="item.label" |
| | | :width="item.width" |
| | | :min-width="item.min" |
| | | align="center" |
| | | > |
| | | <!-- column样式 --> |
| | | <template slot-scope="scope"> |
| | | <div v-if="item.inputNumber"> |
| | | <el-input-number |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="" |
| | | :min="0" |
| | | :controls="false" |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | } |
| | | " |
| | | ></el-input-number> |
| | | </div> |
| | | <div v-else-if="item.inputFloat"> |
| | | <el-input-number |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | style="width: 100%; margin-right: 5px" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | } |
| | | " |
| | | ></el-input-number> |
| | | </div> |
| | | |
| | | <el-input |
| | | v-else-if="item.input" |
| | | v-model.trim="scope.row[item.prop]" |
| | | maxlength="50" |
| | | size="mini" |
| | | @change=" |
| | | (val) => { |
| | | commonInputChange(val, item.prop, scope.row) |
| | | } |
| | | " |
| | | ></el-input> |
| | | <div v-else-if="item.date"> |
| | | <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 130px"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div v-else @click="delClick(scope.row)"><i class="el-icon-delete"></i></div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <!-- </el-form> --> |
| | | <div class="dialog-footer"> |
| | | <div class="bottom-fixed"> |
| | | <div class="all"> |
| | | <span>总期数: </span> |
| | | <el-select v-model="allTerms" size="mini" placeholder="" style="width: 60px"> |
| | | <el-option label="1" :value="1"></el-option> |
| | | <el-option label="2" :value="2"></el-option> |
| | | <el-option label="3" :value="3"></el-option> |
| | | </el-select> |
| | | <span> 期, </span> |
| | | </div> |
| | | <div class="first"> |
| | | <span>首次收款日期: </span> |
| | | <el-date-picker |
| | | v-model="firstDate" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | size="mini" |
| | | style="width: 130px; margin-right: 10px" |
| | | > |
| | | </el-date-picker> |
| | | <el-button type="text" size="mini" @click="recalculateClick" style="margin-right: 10px">重算</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="btn-view"> |
| | | <el-button type="primary" size="small" @click="saveClick">保存</el-button> |
| | | <el-button size="small" @click="editConfig.visible = false">取消</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAllData } from "@/api/client/client" |
| | | import { addCollectionPlan } from "@/api/common/payment" |
| | | |
| | | export default { |
| | | name: "AddCollectionPlanDialog", |
| | | components: {}, |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | sourceType: 1, |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | dialogWidth: "45%", |
| | | editConfig: this.editCommonConfig, |
| | | productTableList: {}, |
| | | showSummary: { |
| | | show: true, |
| | | total: false, |
| | | sumProp: ["other1", "other7"], |
| | | mergeNumber: 7 |
| | | }, |
| | | tableData: [], |
| | | productId: 1, |
| | | addProductArr: [], |
| | | memberOptions: [], |
| | | allTerms: 3, |
| | | amount: 130, |
| | | sourceType: this.editCommonConfig.sourceType, // 源单类型 1销售明细2服务合同3销售发票 |
| | | sourceId: this.editCommonConfig.infomation.id, |
| | | principalId: 0, |
| | | planAmount: 0, // 计划金额 |
| | | firstDate: this.getCurrentDate(1) |
| | | } |
| | | }, |
| | | created() { |
| | | console.log(this.editCommonConfig.sourceType) |
| | | this.setData() |
| | | this.setTableForm() |
| | | this.getCommonData() |
| | | }, |
| | | methods: { |
| | | // 设置初始值 |
| | | setData() { |
| | | this.editConfig.infomation = { |
| | | collectionType: "1", |
| | | moneyType: "人民币", |
| | | amount: this.amount.toFixed(2) |
| | | } |
| | | }, |
| | | getCommonData() { |
| | | getAllData() |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | this.memberOptions = res.data.member |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | // 保存 |
| | | saveClick() { |
| | | this.sumTotalAmount() |
| | | if (this.editConfig.title === "新建") { |
| | | if (this.principalId === 0) { |
| | | this.$message.error("请选择收款计划负责人") |
| | | } else if (this.amount !== this.planAmount) { |
| | | this.$message.error("收款计划和未计划金额不一致,请重算") |
| | | } else { |
| | | const params = this.saveParams() |
| | | addCollectionPlan(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | // 计算计划总额 |
| | | sumTotalAmount() { |
| | | this.planAmount = 0 |
| | | if (this.tableData.tableInfomation && this.tableData.tableInfomation.length > 0) { |
| | | this.tableData.tableInfomation.map((item) => { |
| | | this.planAmount += item.amountReceivable |
| | | }) |
| | | } |
| | | }, |
| | | saveParams() { |
| | | let params = { |
| | | list: this.tableData.tableInfomation |
| | | } |
| | | return params |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | setTableForm() { |
| | | this.tableData = { |
| | | tableInfomation: [ |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.3, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.getCurrentDate(1), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 30, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 1 |
| | | }, |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.5, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.getCurrentDate(2), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 50, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 2 |
| | | }, |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.2, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.getCurrentDate(3), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 20, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 3 |
| | | } |
| | | ], |
| | | tableColumn: [ |
| | | { label: "操作", prop: "operate", width: 60 }, |
| | | { label: "期次", prop: "term", inputNumber: true, width: 90 }, |
| | | { label: "比例(%)", prop: "percent", inputNumber: true, width: 90 }, |
| | | { label: "金额", prop: "amountReceivable", inputFloat: true, width: 120 }, |
| | | { label: "计划收款日期", prop: "collectionDate", date: true, width: 150 }, |
| | | { label: "备注", prop: "remark", input: true } |
| | | ] |
| | | } |
| | | }, |
| | | // 重算 |
| | | recalculateClick() { |
| | | console.log(this.allTerms) |
| | | this.tableData.tableInfomation = [] |
| | | if (this.allTerms === 1) { |
| | | console.log("aaa") |
| | | this.tableData.tableInfomation = [ |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.setDate(this.firstDate, 0), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 100, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 1 |
| | | } |
| | | ] |
| | | } else if (this.allTerms === 2) { |
| | | this.tableData.tableInfomation = [ |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.5, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.setDate(this.firstDate, 0), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 50, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 1 |
| | | }, |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.5, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.setDate(this.firstDate, 1), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 50, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 2 |
| | | } |
| | | ] |
| | | } else if (this.allTerms === 3) { |
| | | this.tableData.tableInfomation = [ |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.3, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.setDate(this.firstDate, 0), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 30, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 1 |
| | | }, |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.5, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.setDate(this.firstDate, 1), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 50, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 2 |
| | | }, |
| | | { |
| | | amount: this.amount, |
| | | amountReceivable: this.amount * 0.2, |
| | | amountReceived: 0, |
| | | amountTotal: 0, |
| | | collectionDate: this.setDate(this.firstDate, 2), |
| | | collectionType: 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | percent: 20, |
| | | principalId: this.principalId, |
| | | remark: "", |
| | | sourceId: this.sourceId, |
| | | sourceType: this.sourceType, |
| | | status: 1, |
| | | term: 3 |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | delClick(row) { |
| | | console.log(row) |
| | | this.tableData.tableInfomation = this.tableData.tableInfomation.filter((item) => { |
| | | return item.term != row.term |
| | | }) |
| | | this.allTerms = this.tableData.tableInfomation.length === 0 ? 3 : this.tableData.tableInfomation.length |
| | | }, |
| | | commonInputChange(val, prop, row) { |
| | | console.log(val, prop) |
| | | console.log(row) |
| | | }, |
| | | // 获取当前日期 |
| | | getCurrentDate(monthNumber) { |
| | | let now = new Date() |
| | | let year = now.getFullYear() |
| | | let month = now.getMonth() + monthNumber |
| | | let day = now.getDate() |
| | | return year + "-" + month + "-" + day |
| | | }, |
| | | // 日期处理 |
| | | setDate(str, monthNumber) { |
| | | console.log(str.split("-")) |
| | | let dateArr = str.split("-") |
| | | let year = parseInt(dateArr[0]) |
| | | let month = parseInt(dateArr[1]) + monthNumber |
| | | let day = parseInt(dateArr[2]) |
| | | return year + "-" + month + "-" + day |
| | | }, |
| | | principalClick(val) { |
| | | this.principalId = val |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .iframe-dialog .el-dialog__body { |
| | | .basic-info { |
| | | .collection-view { |
| | | height: 42px; |
| | | line-height: 42px; |
| | | display: flex; |
| | | border-bottom: 1px solid #ebeef5; |
| | | color: #666; |
| | | .label { |
| | | width: 230px; |
| | | text-align: right; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .dialog-footer { |
| | | position: sticky; |
| | | .bottom-fixed { |
| | | height: 42px; |
| | | line-height: 42px; |
| | | display: flex; |
| | | align-items: center; |
| | | background: #fff; |
| | | |
| | | .all { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | .btn-view { |
| | | height: 55px; |
| | | line-height: 55px; |
| | | text-align: center; |
| | | background-color: #f5f5f5; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="collectionPlan"> |
| | | <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" |
| | | @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> |
| | | <!-- 新建/编辑 --> |
| | | <AddCollectionPlan v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getCollectionPlanList } from "@/api/common/payment" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan" |
| | | |
| | | export default { |
| | | name: "CollectionPlan", |
| | | props: { |
| | | isDetail: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | addConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | }, |
| | | sourceType: { |
| | | type: Number, |
| | | default: 1 |
| | | } |
| | | }, |
| | | mixins: [pageMixin], |
| | | components: { AddCollectionPlan }, |
| | | 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: {}, |
| | | serviceContractId: 0 |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | if (!this.isDetail) { |
| | | this.serviceContractId = 0 |
| | | } else { |
| | | this.serviceContractId = this.addConfig.id |
| | | } |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "收款计划编号", prop: "number" }, |
| | | { label: "客户名称", prop: "client_name" }, |
| | | { label: "期次", prop: "term" }, |
| | | { label: "计划收款日期", prop: "collectionDate" }, |
| | | { label: "金额", prop: "amount" }, |
| | | { label: "已收金额", prop: "amountReceived" }, |
| | | { label: "应收金额", prop: "amountReceivable" }, |
| | | { label: "负责人", prop: "member_name" } |
| | | ] |
| | | } |
| | | 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 getCollectionPlanList({ |
| | | serviceContractId: this.serviceContractId |
| | | }) |
| | | .then((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) { |
| | | this.serviceContractId = content |
| | | // this.keywordType = val.label |
| | | this.getData() |
| | | }, |
| | | resetClick() { |
| | | this.serviceContractId = "" |
| | | // this.keywordType = "" |
| | | this.getData() |
| | | }, |
| | | getSelectArray(val) { |
| | | console.log(val) |
| | | this.selValueList = [] |
| | | const list = val.map((item) => { |
| | | return item.id |
| | | }) |
| | | this.selValueList = list |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | if (this.tableList.tableInfomation && this.tableList.tableInfomation.length > 0) { |
| | | this.$message.success("该订单已创建收款计划") |
| | | this.$confirm("该订单已创建收款计划", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => {}) |
| | | .catch(() => {}) |
| | | } else { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.sourceType = this.sourceType |
| | | this.editConfig.infomation = { ...this.addConfig } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .collectionPlan { |
| | | .top { |
| | | margin-bottom: 20px; |
| | | .btn-pager { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | .detail-top { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="add-receipt"> |
| | | <el-dialog |
| | | :title="editCommonConfig.title + '收款单'" |
| | | :visible.sync="editConfig.visible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | | append-to-body |
| | | custom-class="iframe-dialog" |
| | | > |
| | | <el-form |
| | | ref="form" |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="308px" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | | <!-- 信息 --> |
| | | <div class="basic-info"> |
| | | <!-- 基本信息 --> |
| | | <div class="basic-info-title">基本信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户名称" prop="client_name"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.client_name" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'client') |
| | | } |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient('client', $event)" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('client')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('client')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="editConfig.title === '编辑'" :span="12"> |
| | | <el-form-item label="收款单编号" prop="number"> |
| | | <!-- <el-input v-model="editConfig.infomation.number"></el-input> --> |
| | | <div>{{ editConfig.infomation.id }}</div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="editConfig.sourceType === 2" :span="12"> |
| | | <el-form-item label="服务合同"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.serviceContract_Number" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'serviceContract') |
| | | } |
| | | " |
| | | value-key="number" |
| | | @select="handleSelectClient('serviceContract', $event)" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('serviceContract')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('serviceContract')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-else :span="12"> |
| | | <el-form-item label="合同订单"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.number" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'contract') |
| | | } |
| | | " |
| | | value-key="number" |
| | | @select="handleSelectClient('contract', $event)" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('contract')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('contract')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人" prop="principalId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.principalId" |
| | | 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="receiptDate"> |
| | | <el-date-picker |
| | | v-model="editConfig.infomation.receiptDate" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="币种"> |
| | | <div style="font-size: 13px">{{ "人民币" }}</div> |
| | | <!-- <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> --> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="收款方式" prop="paymentTypeId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.paymentTypeId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 63%" |
| | | > |
| | | <el-option |
| | | v-for="item in paymentTypeListOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="账户" prop="bankAccountId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.bankAccountId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 63%" |
| | | > |
| | | <el-option v-for="item in bankAccountOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="收款类型" prop="deliveryDate"> |
| | | <div>{{ "收款" }}</div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 收款信息 --> |
| | | <div class="basic-info-title">收款信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="本次收款金额" prop="amount"> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.amount" |
| | | placeholder="请输入" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | style="width: 25%; margin-right: 5px" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 备注信息 --> |
| | | <div class="basic-info-title">备注信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 2 }" |
| | | v-model="editConfig.infomation.remark" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 附件信息 --> |
| | | <!-- <div class="basic-info-title">附件信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="附件" prop=""> |
| | | <template slot="label"> |
| | | <div style="display: flex; float: right"> |
| | | <div style="font-size: 16px"> |
| | | <i class="el-icon-warning-outline" title="最多上传20个附件,最大限制5MB"></i> |
| | | </div> |
| | | <span style="margin-left: 5px">附件</span> |
| | | </div> |
| | | </template> |
| | | <div class="annex-view"> |
| | | <div @click="addAnnexClick"> |
| | | <div style="display: flex; float: right"> |
| | | <div style="font-size: 16px"><i class="el-icon-paperclip"></i></div> |
| | | <span>添加</span> |
| | | </div> |
| | | </div> |
| | | <div class="setFormat" @click="setFormatClick">设置允许上传的文件格式</div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> --> |
| | | <!-- 选择审批流程 --> |
| | | <!-- <div v-if="editConfig.title === '新建'" class="basic-info-title">选择审批流程</div> |
| | | <div v-if="editConfig.title === '新建'" class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批流程" prop="approvalWorkflow"> |
| | | <el-select |
| | | v-model="editConfig.infomation.approvalWorkflow" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in approvalWorkflowOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批步骤" prop="approvalSteps"> |
| | | <el-input v-model="editConfig.infomation.approvalSteps"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批人" prop="approvalPerson"> |
| | | <el-input v-model="editConfig.infomation.approvalPerson"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-form-item label="需要加急审批" prop="approvalUrgent"> |
| | | <el-checkbox v-model="editConfig.infomation.approvalUrgent"></el-checkbox> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批意见" prop="approvalOpinion"> |
| | | <el-input v-model="editConfig.infomation.approvalOpinion" type="textarea" :rows="2"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </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="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" |
| | | /> |
| | | <!-- 选择服务合同 销售明细订单 --> |
| | | <SelectCommonDialog |
| | | v-if="editSelCommonConfig.editVisible" |
| | | :edit-common-config="editSelCommonConfig" |
| | | @selClient="selClient" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | // import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | import { getAllData } from "@/api/client/client" |
| | | // import { getAddSalesDetails, getUpdateSalesDetails } from "@/api/sales/salesDetails" |
| | | import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" |
| | | import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | import { getPaymentTypeList, getBankAccountList, addReceipt } from "@/api/common/payment" |
| | | export default { |
| | | name: "AddReceiptDialog", |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | sourceType: 1, |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | components: { SelectClientDialog, SelectCommonDialog }, |
| | | computed: { |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | }, |
| | | serviceContractList() { |
| | | return this.$store.state.getClientName.serviceContractList |
| | | }, |
| | | salesDetailsList() { |
| | | return this.$store.state.getClientName.salesDetailsList |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: "change" }], |
| | | signTime: [{ required: true, message: "请选择收款日期", trigger: "change" }], |
| | | memberId: [{ required: true, message: "请选择销售负责人", trigger: "change" }] |
| | | // approvalOpinion: [{ required: true, message: "请输入", trigger: "blur" }] |
| | | }, |
| | | memberOptions: [], |
| | | bankAccountOptions: [], // 账户 |
| | | paymentTypeListOptions: [], // 收款方式 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | productTableList: {}, |
| | | showSummary: { |
| | | show: true, |
| | | total: true, |
| | | sumProp: ["other1", "other7"], |
| | | mergeNumber: 2 |
| | | }, |
| | | editSelectClientConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | editSelCommonConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | clientId: this.editCommonConfig.infomation.client_id, |
| | | SalesDetailsId: this.editCommonConfig.infomation.SalesDetailsId, |
| | | serviceContractId: this.editCommonConfig.infomation.id |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geServiceContract") |
| | | this.$store.dispatch("geSalesDetails") |
| | | this.setTableForm() |
| | | this.getCommonData() |
| | | }, |
| | | methods: { |
| | | getCommonData() { |
| | | getAllData().then((res) => { |
| | | this.memberOptions = res.data.member |
| | | }) |
| | | this.getPaymentTypeList() |
| | | this.getBankAccountList() |
| | | }, |
| | | async getPaymentTypeList() { |
| | | await getPaymentTypeList().then((res) => { |
| | | console.log("支付方式") |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | this.paymentTypeListOptions = res.data.data.data |
| | | } |
| | | }) |
| | | }, |
| | | async getBankAccountList() { |
| | | await getBankAccountList().then((res) => { |
| | | console.log("账户") |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | this.bankAccountOptions = res.data.data.data |
| | | } |
| | | }) |
| | | }, |
| | | // 保存 |
| | | 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 === "新建") { |
| | | addReceipt(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } else { |
| | | // getUpdateSalesDetails(params).then((res) => { |
| | | // console.log(res) |
| | | // this.editConfig.visible = false |
| | | // if (res.code === 200) { |
| | | // this.$message.success("编辑成功") |
| | | // this.$parent.getData() |
| | | // } |
| | | // }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | | let params = { |
| | | amount: data.amount || 0, |
| | | bankAccountId: data.bankAccountId || 0, |
| | | clientId: this.clientId || 0, |
| | | fileId: 0, |
| | | id: 0, |
| | | moneyType: "人民币", |
| | | paymentTypeId: data.paymentTypeId || 0, |
| | | principalId: data.principalId || 0, |
| | | receiptDate: data.receiptDate || "", |
| | | remark: data.remark || "", |
| | | sourceId: this.editConfig.sourceType === 1 ? this.SalesDetailsId : this.serviceContractId, |
| | | sourceType: this.editConfig.sourceType |
| | | } |
| | | return params |
| | | }, |
| | | |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb, value) { |
| | | var restaurants = [] |
| | | if (value === "client") { |
| | | restaurants = this.clientList |
| | | } else if (value === "serviceContract") { |
| | | restaurants = this.serviceContractList |
| | | } else if (value === "contract") { |
| | | restaurants = this.salesDetailsList |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | cb(results) |
| | | }, |
| | | createStateFilter(queryString, value) { |
| | | return (state) => { |
| | | if (value === "serviceContract" || value === "contract") { |
| | | return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } else { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } |
| | | } |
| | | }, |
| | | handleSelectClient(value, item) { |
| | | if (value === "client") { |
| | | this.clientId = item.id |
| | | } else if (value === "serviceContract") { |
| | | this.serviceContractId = item.id |
| | | } else if (value === "contract") { |
| | | this.SalesDetailsId = item.id |
| | | } |
| | | }, |
| | | selClientClick(value) { |
| | | if (value === "client") { |
| | | this.editSelectClientConfig.editVisible = true |
| | | } else if (value === "serviceContract") { |
| | | this.editSelCommonConfig.title = "服务合同" |
| | | this.editSelCommonConfig.editVisible = true |
| | | } else if (value === "contract") { |
| | | this.editSelCommonConfig.title = "销售明细单" |
| | | this.editSelCommonConfig.editVisible = true |
| | | } |
| | | }, |
| | | selClient(row, value) { |
| | | if (value === "contact") { |
| | | this.editConfig.infomation.contact_name = row.name |
| | | this.contactId = row.id |
| | | } else if (value === "serviceContract") { |
| | | this.editConfig.infomation.serviceContract_Number = row.number |
| | | this.serviceContractId = row.id |
| | | } else if (value === "contract") { |
| | | this.editConfig.infomation.number = row.number |
| | | this.SalesDetailsId = row.id |
| | | } |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient(value) { |
| | | if (value === "client") { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.clientId = 0 |
| | | } else if (value === "serviceContract") { |
| | | this.editConfig.infomation.serviceContract_Number = "" |
| | | this.serviceContractId = 0 |
| | | } else if (value === "contract") { |
| | | this.editConfig.infomation.number = "" |
| | | this.SalesDetailsId = 0 |
| | | } |
| | | }, |
| | | // 添加附件 |
| | | addAnnexClick() {}, |
| | | // 设置允许上传文件格式 |
| | | setFormatClick() {}, |
| | | setTableForm() { |
| | | if (this.editConfig.title === "新建") { |
| | | this.tableData = [ |
| | | { |
| | | 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: "Name", input: true, isRequird: true }, |
| | | { label: "产品编号", prop: "Number" }, |
| | | { label: "数量", prop: "Amount", input: true, isRequird: true }, |
| | | { label: "销售单价", prop: "Unit", input: true }, |
| | | { label: "价税合计", prop: "total", input: true }, |
| | | { label: "描述", prop: "other8" } |
| | | ] |
| | | } |
| | | }, |
| | | // 产品新增 |
| | | addProductClick() { |
| | | this.productId++ |
| | | this.tableData.push({ |
| | | id: this.productId, |
| | | Amount: 0, |
| | | IsSale: true, |
| | | MaterialMode: "", |
| | | MinInventory: 0, |
| | | Name: "", |
| | | Number: "", |
| | | PurchaseType: "", |
| | | SalePrice: 0, |
| | | Unit: "" |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | ::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; |
| | | 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; |
| | | } |
| | | .el-input__inner { |
| | | text-align: left; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="receipt"> |
| | | <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" |
| | | @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> |
| | | <!-- 新建/编辑 --> |
| | | <AddReceipt v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getReceiptList } from "@/api/common/payment" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import AddReceipt from "@/views/other/payment/receipt/addReceipt.vue" |
| | | |
| | | export default { |
| | | name: "ReceiptView", |
| | | props: { |
| | | isDetail: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | addConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | }, |
| | | sourceType: { |
| | | type: Number, |
| | | default: 1 |
| | | } |
| | | }, |
| | | mixins: [pageMixin], |
| | | components: { AddReceipt }, |
| | | 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: {}, |
| | | keyword: "", |
| | | keywordType: "" |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | if (!this.isDetail) { |
| | | this.keyword = "" |
| | | this.keywordType = "" |
| | | } else { |
| | | this.keyword = this.addConfig.keyword |
| | | this.keywordType = this.addConfig.keywordType |
| | | } |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "收款单编号", prop: "number" }, |
| | | { label: "客户名称", prop: "client_name" }, |
| | | { label: "选择源单", prop: "sourceId" }, |
| | | { label: "实际收款金额", prop: "amount" }, |
| | | { label: "收款方式", prop: "paymentType_name" }, |
| | | { label: "销售负责人", prop: "principal_name" }, |
| | | { label: "收款日期", prop: "receiptDate" } |
| | | ] |
| | | } |
| | | 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 getReceiptList({ |
| | | keyword: this.keyword, |
| | | keywordType: this.keywordType, |
| | | 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, |
| | | paymentType_name: item.PaymentType.name, |
| | | principal_name: item.principal.username |
| | | } |
| | | }) |
| | | 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) { |
| | | this.keyword = content |
| | | this.keywordType = val.label |
| | | this.getData() |
| | | }, |
| | | resetClick() { |
| | | this.keyword = "" |
| | | this.keywordType = "" |
| | | this.getData() |
| | | }, |
| | | getSelectArray(val) { |
| | | console.log(val) |
| | | this.selValueList = [] |
| | | const list = val.map((item) => { |
| | | return item.id |
| | | }) |
| | | this.selValueList = list |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.sourceType = this.sourceType |
| | | this.editConfig.infomation = { ...this.addConfig } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .receipt { |
| | | .top { |
| | | margin-bottom: 20px; |
| | | .btn-pager { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | .detail-top { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="add-SaleInvoice"> |
| | | <el-dialog |
| | | :title="editCommonConfig.title + '销售发票'" |
| | | :visible.sync="editConfig.visible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | | append-to-body |
| | | custom-class="iframe-dialog" |
| | | > |
| | | <el-form |
| | | ref="form" |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="308px" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | | <!-- 信息 --> |
| | | <div class="basic-info"> |
| | | <!-- 基本信息 --> |
| | | <div class="basic-info-title">基本信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="主题" prop="subject"> |
| | | <el-input v-model="editConfig.infomation.subject"></el-input> |
| | | </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="client_name"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.client_name" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'client') |
| | | } |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient('client', $event)" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('client')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('client')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="票据类型" prop="invoiceTypeId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.invoiceTypeId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | > |
| | | <el-option v-for="item in invoiceTypeOptions" :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="invoiceStatusId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.invoiceStatusId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | > |
| | | <el-option |
| | | v-for="item in invoiceStatusOptions" |
| | | :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="principalId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.principalId" |
| | | 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 v-if="editConfig.sourceType === 2" :span="12"> |
| | | <el-form-item label="服务合同"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.serviceContract_Number" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'serviceContract') |
| | | } |
| | | " |
| | | value-key="number" |
| | | @select="handleSelectClient('serviceContract', $event)" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('serviceContract')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('serviceContract')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-else :span="12"> |
| | | <el-form-item label="合同订单"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.number" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'contract') |
| | | } |
| | | " |
| | | value-key="number" |
| | | @select="handleSelectClient('contract', $event)" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('contract')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div class="common-select-btn" @click="clearupClient('contract')"> |
| | | <i class="el-icon-edit-outline" title="清除"></i> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="纳税识别号" prop="taxpayerIdNumber"> |
| | | <el-input v-model="editConfig.infomation.taxpayerIdNumber"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 动态信息 --> |
| | | <div class="basic-info-title">动态信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="物流公司" prop="courierCompanyId"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.courierCompanyId" |
| | | placeholder="请选择" |
| | | class="common-select-sel" |
| | | size="mini" |
| | | > |
| | | <el-option |
| | | v-for="item in courierCompanyOptions" |
| | | :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="courierNumber"> |
| | | <el-input v-model="editConfig.infomation.courierNumber"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开票日期" prop="invoiceDate"> |
| | | <el-date-picker |
| | | v-model="editConfig.infomation.invoiceDate" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="发票号码" prop="invoiceNumber"> |
| | | <el-input v-model="editConfig.infomation.invoiceNumber"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <!-- 条款与条件 --> |
| | | <!-- <div class="basic-info-title">条款与条件</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="条款和条约" prop="terms"> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 4, maxRows: 6 }" |
| | | placeholder="请输入内容" |
| | | v-model="editConfig.infomation.terms" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> --> |
| | | <!-- 附件信息 --> |
| | | <!-- <div class="basic-info-title">附件信息</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="附件" prop=""> |
| | | <template slot="label"> |
| | | <div style="display: flex; float: right"> |
| | | <div style="font-size: 16px"> |
| | | <i class="el-icon-warning-outline" title="最多上传20个附件,最大限制5MB"></i> |
| | | </div> |
| | | <span style="margin-left: 5px">附件</span> |
| | | </div> |
| | | </template> |
| | | <div class="annex-view"> |
| | | <div @click="addAnnexClick"> |
| | | <div style="display: flex; float: right"> |
| | | <div style="font-size: 16px"><i class="el-icon-paperclip"></i></div> |
| | | <span>添加</span> |
| | | </div> |
| | | </div> |
| | | <div class="setFormat" @click="setFormatClick">设置允许上传的文件格式</div> |
| | | </div> |
| | | </el-form-item> |
| | | </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.value" :label="item.label" :value="item.value"> |
| | | </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" |
| | | /> |
| | | </div> |
| | | <!-- 选择审批流程 --> |
| | | <!-- <div class="basic-info-title">选择审批流程</div> |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批流程" prop="approvalWorkflow"> |
| | | <el-select |
| | | v-model="editConfig.infomation.approvalWorkflow" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in approvalWorkflowOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批步骤" prop="approvalSteps"> |
| | | <el-input v-model="editConfig.infomation.approvalSteps"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | \ |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批人" prop="approvalPerson"> |
| | | <el-input v-model="editConfig.infomation.approvalPerson"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <el-form-item label="审批意见" prop="approvalOpinion"> |
| | | <el-input v-model="editConfig.infomation.approvalOpinion" type="textarea" :rows="2"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </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="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" |
| | | /> |
| | | <!-- 合同订单 --> |
| | | <SelectCommonDialog |
| | | v-if="editSelCommonConfig.editVisible" |
| | | :edit-common-config="editSelCommonConfig" |
| | | @selClient="selClient" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | 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" |
| | | import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | import { addInvoice, getInvoiceTypeList, getInvoiceStatusList, getCourierCompanyList } from "@/api/common/payment" |
| | | export default { |
| | | name: "AddSaleInvoiceDialog", |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | sourceType: 1, |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | components: { CommonFormTableView, SelectClientDialog, SelectCommonDialog }, |
| | | computed: { |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | }, |
| | | salesDetailsList() { |
| | | return this.$store.state.getClientName.salesDetailsList |
| | | }, |
| | | serviceContractList() { |
| | | return this.$store.state.getClientName.serviceContractList |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | subject: [{ required: true, message: "请输入主题", trigger: "blur" }], |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: "change" }], |
| | | invoiceTypeId: [{ required: true, message: "请选择票据类型", trigger: "change" }], |
| | | principalId: [{ required: true, message: "请选择销售负责人", trigger: "change" }] |
| | | }, |
| | | memberOptions: [], |
| | | invoiceTypeOptions: [], // 票据类型 |
| | | invoiceStatusOptions: [], // 票据状态 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | courierCompanyOptions: [], //物流公司 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | productTableList: {}, |
| | | showSummary: { |
| | | show: true, |
| | | total: true, |
| | | sumProp: ["Amount", "Unit", "total"], |
| | | mergeNumber: 3 |
| | | }, |
| | | editSelectClientConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | editSelectContactConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | editSelectChanceConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | editSelCommonConfig: { |
| | | editVisible: false, |
| | | title: "", |
| | | infomation: {} |
| | | }, |
| | | clientId: this.editCommonConfig.infomation.client_id, |
| | | SalesDetailsId: this.editCommonConfig.infomation.SalesDetailsId, |
| | | serviceContractId: this.editCommonConfig.infomation.id, |
| | | tableData: [], |
| | | productId: 1 |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geServiceContract") |
| | | this.$store.dispatch("geSalesDetails") |
| | | this.setTableForm() |
| | | this.getCommonData() |
| | | }, |
| | | methods: { |
| | | getCommonData() { |
| | | getAllData().then((res) => { |
| | | if (res.code === 200) { |
| | | this.memberOptions = res.data.member |
| | | } |
| | | }) |
| | | this.getInvoiceTypeList() |
| | | this.getInvoiceStatusList() |
| | | this.getCourierCompanyList() |
| | | }, |
| | | async getInvoiceTypeList() { |
| | | await getInvoiceTypeList().then((res) => { |
| | | console.log("票据类型") |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | this.invoiceTypeOptions = res.data.data.data |
| | | } |
| | | }) |
| | | }, |
| | | async getInvoiceStatusList() { |
| | | await getInvoiceStatusList().then((res) => { |
| | | console.log("票据状态") |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | this.invoiceStatusOptions = res.data.data.data |
| | | } |
| | | }) |
| | | }, |
| | | async getCourierCompanyList() { |
| | | await getCourierCompanyList().then((res) => { |
| | | console.log("物流公司") |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | this.courierCompanyOptions = res.data.data.data |
| | | } |
| | | }) |
| | | }, |
| | | // 保存 |
| | | 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 === "新建") { |
| | | addInvoice(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } else { |
| | | // getUpdateServiceContract(params).then((res) => { |
| | | // console.log(res) |
| | | // this.editConfig.visible = false |
| | | // if (res.code === 200) { |
| | | // this.$message.success("编辑成功") |
| | | // this.$parent.getData() |
| | | // } |
| | | // }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | | let params = { |
| | | clientId: this.clientId || 0, |
| | | courierCompanyId: data.courierCompanyId || 0, |
| | | courierNumber: data.courierNumber || "", |
| | | invoiceDate: data.invoiceDate || "", |
| | | invoiceNumber: data.invoiceNumber || "", |
| | | invoiceStatusId: data.invoiceStatusId || 0, |
| | | invoiceTypeId: data.invoiceTypeId || 0, |
| | | principalId: data.principalId || 0, |
| | | products: this.tableData, |
| | | sourceId: this.editConfig.sourceType === 1 ? this.SalesDetailsId : this.serviceContractId, |
| | | sourceType: this.editConfig.sourceType, |
| | | subject: data.subject || "", |
| | | taxpayerIdNumber: data.taxpayerIdNumber || "" |
| | | } |
| | | return params |
| | | }, |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 选择客户相关方法 |
| | | querySearchAsync(queryString, cb, value) { |
| | | var restaurants = [] |
| | | if (value === "client") { |
| | | restaurants = this.clientList |
| | | } else if (value === "serviceContract") { |
| | | restaurants = this.serviceContractList |
| | | } else if (value === "contract") { |
| | | restaurants = this.salesDetailsList |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | cb(results) |
| | | }, |
| | | createStateFilter(queryString, value) { |
| | | return (state) => { |
| | | if (value === "serviceContract" || value === "contract") { |
| | | return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } else { |
| | | return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 |
| | | } |
| | | } |
| | | }, |
| | | handleSelectClient(value, item) { |
| | | if (value === "client") { |
| | | this.clientId = item.id |
| | | } else if (value === "serviceContract") { |
| | | this.serviceContractId = item.id |
| | | } else if (value === "contract") { |
| | | this.SalesDetailsId = item.id |
| | | } |
| | | }, |
| | | selClientClick(value) { |
| | | if (value === "client") { |
| | | this.editSelectClientConfig.editVisible = true |
| | | } else if (value === "serviceContract") { |
| | | this.editSelCommonConfig.title = "服务合同" |
| | | this.editSelCommonConfig.editVisible = true |
| | | } else if (value === "contract") { |
| | | this.editSelCommonConfig.title = "销售明细单" |
| | | this.editSelCommonConfig.editVisible = true |
| | | } |
| | | }, |
| | | selClient(row, value) { |
| | | if (value === "contact") { |
| | | this.editConfig.infomation.contact_name = row.name |
| | | this.contactId = row.id |
| | | } else if (value === "serviceContract") { |
| | | this.editConfig.infomation.serviceContract_Number = row.number |
| | | this.serviceContractId = row.id |
| | | } else if (value === "contract") { |
| | | this.editConfig.infomation.number = row.number |
| | | this.SalesDetailsId = row.id |
| | | } |
| | | }, |
| | | // 清除已选择用户 |
| | | clearupClient(value) { |
| | | if (value === "client") { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.clientId = 0 |
| | | } else if (value === "serviceContract") { |
| | | this.editConfig.infomation.serviceContract_Number = "" |
| | | this.serviceContractId = 0 |
| | | } else if (value === "contract") { |
| | | this.editConfig.infomation.number = "" |
| | | this.SalesDetailsId = 0 |
| | | } |
| | | }, |
| | | // 添加附件 |
| | | addAnnexClick() {}, |
| | | // 设置允许上传文件格式 |
| | | setFormatClick() {}, |
| | | setTableForm() { |
| | | if (this.editConfig.title === "新建") { |
| | | this.tableData = [ |
| | | { |
| | | 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: "Name", input: true, isRequird: true }, |
| | | { label: "产品编号", prop: "Number" }, |
| | | { label: "数量", prop: "Amount", input: true, isRequird: true }, |
| | | { label: "销售单价", prop: "Unit", input: true }, |
| | | { label: "价税合计", prop: "total", 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: "" |
| | | }) |
| | | }, |
| | | // 产品清空 |
| | | emptyProductClick() { |
| | | this.productId = 1 |
| | | this.tableData = [ |
| | | { |
| | | id: 1, |
| | | Amount: 0, |
| | | IsSale: true, |
| | | MaterialMode: "", |
| | | MinInventory: 0, |
| | | Name: "", |
| | | Number: "", |
| | | PurchaseType: "", |
| | | SalePrice: 0, |
| | | Unit: "" |
| | | } |
| | | ] |
| | | this.productTableList.tableData = this.tableData |
| | | }, |
| | | // 产品重算 |
| | | recalculateProductClick() {} |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | ::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; |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="saleInvoice"> |
| | | <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" |
| | | @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> |
| | | <!-- 新建/编辑 --> |
| | | <AddSaleInvoice v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getInvoiceList } from "@/api/common/payment" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import AddSaleInvoice from "@/views/other/payment/saleInvoice/addSaleInvoice.vue" |
| | | |
| | | export default { |
| | | name: "SaleInvoice", |
| | | props: { |
| | | isDetail: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | addConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | }, |
| | | sourceType: { |
| | | type: Number, |
| | | default: 1 |
| | | } |
| | | }, |
| | | mixins: [pageMixin], |
| | | components: { AddSaleInvoice }, |
| | | 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: {}, |
| | | keyword: "", |
| | | keywordType: "" |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | if (!this.isDetail) { |
| | | this.keyword = "" |
| | | this.keywordType = "" |
| | | } else { |
| | | this.keyword = this.addConfig.keyword |
| | | this.keywordType = this.addConfig.keywordType |
| | | } |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "发票编号", prop: "invoiceNumber" }, |
| | | { label: "主题", prop: "subject" }, |
| | | { label: "客户名称", prop: "client_name" }, |
| | | { label: "票据类型", prop: "invoiceType_name" }, |
| | | { label: "开票日期", prop: "invoiceDate" }, |
| | | { label: "销售负责人", prop: "principalId" }, |
| | | { label: "产品名称", prop: "name", isProductName: true }, |
| | | { label: "数量", prop: "amount", isProductAmount: true }, |
| | | { label: "含税单价", prop: "price", isProductCommon: true }, |
| | | { label: "价税合计", prop: "total", isProductCommon: true } |
| | | ] |
| | | } |
| | | 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 getInvoiceList({ |
| | | keyword: this.keyword, |
| | | keywordType: this.keywordType, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | 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, |
| | | invoiceType_name: item.InvoiceType.name |
| | | // principalId: item.member.name |
| | | } |
| | | }) |
| | | 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) { |
| | | this.keyword = content |
| | | this.keywordType = val.label |
| | | this.getData() |
| | | }, |
| | | resetClick() { |
| | | this.keyword = "" |
| | | this.keywordType = "" |
| | | this.getData() |
| | | }, |
| | | getSelectArray(val) { |
| | | console.log(val) |
| | | this.selValueList = [] |
| | | const list = val.map((item) => { |
| | | return item.id |
| | | }) |
| | | this.selValueList = list |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.sourceType = this.sourceType |
| | | this.editConfig.infomation = { ...this.addConfig } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .saleInvoice { |
| | | .top { |
| | | margin-bottom: 20px; |
| | | .btn-pager { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | .detail-top { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | v-loading="loading" |
| | | :table-list="tableList" |
| | | :select-box="!isDetail" |
| | | @selContactsClick="selContactsClick" |
| | | @selClientClick="selClientClick" |
| | | @getSelectArray="getSelectArray" |
| | | > |
| | | <!-- <template slot="tableButton"> |
| | |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | |
| | | export default { |
| | | name: "FollowupRecords", |
| | | name: "ProductView", |
| | | props: { |
| | | isDetail: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | addConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | }, |
| | | addIdConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | |
| | | .content { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | height: calc(100vh - 60px); |
| | | height: calc(100vh - 70px); |
| | | } |
| | | </style> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="合同金额" prop="money"> |
| | | <el-input v-model="editConfig.infomation.money"></el-input> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.money" |
| | | placeholder="请输入" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | style="width: 25%; margin-right: 5px" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | refundMethodOptions: [], // 付款方式 |
| | | accountOptions: [], // 账户 |
| | | isInvoiceOptions: ["是", "否"], // 是否开票 |
| | | currencyOptions: [], // 币种 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | productTableList: {}, |
| | | showSummary: { |
| | |
| | | this.refundMethodOptions = res.data.refundMethod |
| | | this.accountOptions = res.data.accountId |
| | | // this.isInvoiceOptions = res.data.isInvoice |
| | | this.currencyOptions = res.data.currency |
| | | // this.currencyOptions = res.data.currency |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | |
| | | </div> |
| | | </div> |
| | | <div class="product-view"> |
| | | <CommonFormTableView :show-summary="showSummary" :product-table-list="productTableList" /> |
| | | <CommonFormTableView |
| | | :show-summary="showSummary" |
| | | :product-table-list="productTableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | @emptyProductClick="emptyProductClick" |
| | | @recalculateProductClick="recalculateProductClick" |
| | | /> |
| | | </div> |
| | | <!-- 选择审批流程 --> |
| | | <!-- <div v-if="editConfig.title === '新建'" class="basic-info-title">选择审批流程</div> |
| | |
| | | memberOptions: [], |
| | | selSourceOrderOptions: [], |
| | | wechatOrderStatusOptions: [], // 微信订单状态 |
| | | currencyOptions: [ |
| | | { value: "1", label: "人民币(¥)" }, |
| | | { value: "2", label: "英镑(£)" }, |
| | | { value: "3", label: "欧元(€)" } |
| | | ], // 币种 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | productTableList: {}, |
| | | showSummary: { |
| | |
| | | // 设置允许上传文件格式 |
| | | setFormatClick() {}, |
| | | setTableForm() { |
| | | if (this.editConfig.title === "新建") { |
| | | this.tableData = [ |
| | | { |
| | | 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: [], |
| | | tableData: this.tableData, |
| | | tableColumn: [ |
| | | { label: "#", prop: "id", width: 40 }, |
| | | { 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: "other8" }, |
| | | { label: "源单类型", prop: "other2" }, |
| | | { label: "源单", prop: "other3" } |
| | | { label: "产品名称", prop: "Name", input: true, isRequird: true }, |
| | | { label: "产品编号", prop: "Number" }, |
| | | { label: "数量", prop: "Amount", input: true, isRequird: true }, |
| | | { label: "销售单价", prop: "Unit", input: true }, |
| | | { label: "价税合计", prop: "total", 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: "" |
| | | }) |
| | | }, |
| | | // 产品清空 |
| | | emptyProductClick() { |
| | | this.productId = 1 |
| | | this.tableData = [ |
| | | { |
| | | id: 1, |
| | | Amount: 0, |
| | | IsSale: true, |
| | | MaterialMode: "", |
| | | MinInventory: 0, |
| | | Name: "", |
| | | Number: "", |
| | | PurchaseType: "", |
| | | SalePrice: 0, |
| | | Unit: "" |
| | | } |
| | | ] |
| | | this.productTableList.tableData = this.tableData |
| | | }, |
| | | // 产品重算 |
| | | recalculateProductClick() {} |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | </div> |
| | | <div v-if="activeName === 'collection'" class="second"> |
| | | <!-- <FollowupRecords :isDetail="true" /> --> |
| | | <CollectionPlan :isDetail="true" :add-config="addConfig" :source-type="1" /> |
| | | </div> |
| | | <div v-if="activeName === 'receipt'" class="second"> |
| | | <!-- <FollowupRecords :isDetail="true" /> --> |
| | | <Receipt :isDetail="true" :add-config="addConfig" :source-type="1" /> |
| | | </div> |
| | | <div v-if="activeName === 'invoice'" class="second"> |
| | | <!-- <FollowupRecords :isDetail="true" /> --> |
| | | <SaleInvoice :isDetail="true" :add-config="addConfig" :source-type="1" /> |
| | | </div> |
| | | <div v-if="activeName === 'return'" class="second"> |
| | | <SalesReturn :isDetail="true" :add-config="addConfig" /> |
| | |
| | | import RefundForm from "@/views/sales/refundForm" |
| | | import Status from "@/common/const/salesFixedStatus" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | import CollectionPlan from "@/views/other/payment/collectionPlan" |
| | | import Receipt from "@/views/other/payment/receipt" |
| | | import SaleInvoice from "@/views/other/payment/saleInvoice" |
| | | export default { |
| | | name: "DetailSpecification", |
| | | props: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: { SalesReturn, ServiceContract, RefundForm, CommonFormTableView }, |
| | | components: { SalesReturn, ServiceContract, RefundForm, CommonFormTableView, CollectionPlan, Receipt, SaleInvoice }, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | |
| | | selSourceOrderOptions: [], // 选择源单 |
| | | repositoryOptions: [], // 退入仓库 |
| | | statusOptions: [], // 状态 |
| | | currencyOptions: [], // 币种 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | productTableList: {}, |
| | | showSummary: { |
| | | show: true, |
| | |
| | | .then((res) => { |
| | | this.memberOptions = res.data.member |
| | | this.repositoryOptions = res.data.repository |
| | | this.currencyOptions = res.data.currency |
| | | // this.currencyOptions = res.data.currency |
| | | this.statusOptions = res.data.salesReturnStatus |
| | | }) |
| | | .catch((err) => { |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="实际处理时间" prop="realTime"> |
| | | <el-date-picker |
| | | v-model="editConfig.infomation.startTime" |
| | | v-model="editConfig.infomation.realTime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | type="realTime" |
| | | type="datetime" |
| | | placeholder="选择时间" |
| | | > |
| | | </el-date-picker> |
| | |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.clientId = row.id |
| | | } else if (value === "serviceContract") { |
| | | this.editConfig.infomation.service_number = row.number |
| | | this.editConfig.infomation.serviceContract_Number = row.number |
| | | this.serviceContractId = row.id |
| | | } else if (value === "contract") { |
| | | this.editConfig.infomation.number = row.number |
| | |
| | | { label: "主题", prop: "subject" }, // 主题 |
| | | { label: "客户名称", prop: "client_name", min: 130, isClientClick: true }, // 客户名称 |
| | | { label: "实际处理时间", prop: "realTime" }, // 实际处理时间 |
| | | { label: "服务人员", prop: "serviceManId" }, // 服务人员 |
| | | { label: "服务人员", prop: "serviceMan_name" }, // 服务人员 |
| | | { label: "服务方式", prop: "serviceType_name" }, // 服务方式 |
| | | // { label: "产品类别", prop: "reportSourceId" }, // 产品类别 |
| | | { label: "故障类别", prop: "faultType_name" } // 故障类别 |
| | |
| | | client_name: item.Client.name, |
| | | serviceType_name: item.ServiceType.name, |
| | | faultType_name: item.FaultType.name, |
| | | serviceContract_Number: item.ServiceContract.number |
| | | serviceContract_Number: item.ServiceContract.number, |
| | | serviceMan_name: item.serviceMan.username |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | |
| | | .content { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | height: calc(100vh - 60px); |
| | | height: calc(100vh - 70px); |
| | | } |
| | | </style> |
| | |
| | | <CommonFormTableView |
| | | :show-summary="showSummary" |
| | | :product-table-list="productTableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | @emptyProductClick="emptyProductClick" |
| | | @recalculateProductClick="recalculateProductClick" |
| | | /> |
| | | </div> |
| | | <!-- 选择审批流程 --> |
| | |
| | | memberOptions: [], |
| | | contractTypeOptions: [], // 合同类型 |
| | | contractStatusOptions: [], // 合同状态 |
| | | currencyOptions: [ |
| | | { value: "1", label: "人民币(¥)" }, |
| | | { value: "2", label: "英镑(£)" }, |
| | | { value: "3", label: "欧元(€)" } |
| | | ], // 币种 |
| | | currencyOptions: [{ id: 1, name: "人民币" }], // 币种 |
| | | approvalWorkflowOptions: [], // 审批流程 |
| | | productTableList: {}, |
| | | showSummary: { |
| | | show: true, |
| | | total: true, |
| | | sumProp: ["other1", "other2", "other3", "other4"], |
| | | sumProp: ["Amount", "Unit", "total"], |
| | | mergeNumber: 3 |
| | | }, |
| | | editSelectClientConfig: { |
| | |
| | | saleChanceId: this.editCommonConfig.infomation.saleChanceId, |
| | | contractId: this.editCommonConfig.infomation.salesDetailsId, |
| | | quotationId: this.editCommonConfig.infomation.quotationId, |
| | | tableData: [] |
| | | tableData: [], |
| | | productId: 1 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.memberOptions = res.data.member |
| | | this.contractTypeOptions = res.data.serviceContractType |
| | | this.contractStatusOptions = res.data.serviceContractStatus |
| | | this.currencyOptions = res.data.currency |
| | | // this.currencyOptions = res.data.currency |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | |
| | | if (this.editConfig.title === "新建") { |
| | | this.tableData = [ |
| | | { |
| | | id: 1, |
| | | Amount: 0, |
| | | IsSale: true, |
| | | MaterialMode: "", |
| | |
| | | { label: "产品编号", prop: "Number" }, |
| | | { label: "服务开始日", prop: "other5", date: true, isRequird: true, min: 100 }, |
| | | { label: "服务到期日", prop: "other6", date: true, isRequird: true, min: 100 }, |
| | | { label: "数量", prop: "amount", input: true, isRequird: true }, |
| | | { label: "数量", prop: "Amount", input: true, isRequird: true }, |
| | | { label: "销售单价", prop: "Unit", input: true }, |
| | | { label: "价税合计", prop: "other3", input: true }, |
| | | { label: "价税合计", prop: "total", 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: "", |
| | |
| | | SalePrice: 0, |
| | | Unit: "" |
| | | }) |
| | | } |
| | | }, |
| | | // 产品清空 |
| | | emptyProductClick() { |
| | | this.productId = 1 |
| | | this.tableData = [ |
| | | { |
| | | id: 1, |
| | | Amount: 0, |
| | | IsSale: true, |
| | | MaterialMode: "", |
| | | MinInventory: 0, |
| | | Name: "", |
| | | Number: "", |
| | | PurchaseType: "", |
| | | SalePrice: 0, |
| | | Unit: "" |
| | | } |
| | | ] |
| | | this.productTableList.tableData = this.tableData |
| | | }, |
| | | // 产品重算 |
| | | recalculateProductClick() {} |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | </div> |
| | | <div v-if="activeName === 'collection'" class="second"> |
| | | <!-- <FollowupRecords :isDetail="true" /> --> |
| | | <CollectionPlan :isDetail="true" :add-config="addConfig" :source-type="2" /> |
| | | </div> |
| | | <div v-if="activeName === 'receipt'" class="second"> |
| | | <!-- <FollowupRecords :isDetail="true" /> --> |
| | | <Receipt :isDetail="true" :add-config="addConfig" :source-type="2" /> |
| | | </div> |
| | | <div v-if="activeName === 'clientService'" class="second"> |
| | | <ClientServiceOrder :isDetail="true" :add-config="addConfig" /> |
| | | </div> |
| | | <div v-if="activeName === 'invoice'" class="second"> |
| | | <!-- <FollowupRecords :isDetail="true" /> --> |
| | | <SaleInvoice :isDetail="true" :add-config="addConfig" :source-type="2" /> |
| | | </div> |
| | | </div> |
| | | </el-drawer> |
| | |
| | | import ClientServiceOrder from "@/views/service/clientServiceOrder" |
| | | import Status from "@/common/const/salesFixedStatus" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | import CollectionPlan from "@/views/other/payment/collectionPlan" |
| | | import Receipt from "@/views/other/payment/receipt" |
| | | import SaleInvoice from "@/views/other/payment/saleInvoice" |
| | | export default { |
| | | name: "DetailSpecification", |
| | | props: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: { ClientServiceOrder, CommonFormTableView }, |
| | | components: { ClientServiceOrder, CommonFormTableView, CollectionPlan, Receipt, SaleInvoice }, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | |
| | | if (value === "basic") { |
| | | this.isBasicExpand = !this.isBasicExpand |
| | | } else if (value === "dynamic") { |
| | | this.isDynamicExpand = !this.isLabelExpand |
| | | this.isDynamicExpand = !this.isDynamicExpand |
| | | } else if (value === "delivery") { |
| | | this.isDeliveryExpand = !this.isDeliveryExpand |
| | | } else if (value === "termsConditions") { |
| | |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "服务合同编号", prop: "number", min: 100, isCommonClick: true }, // 服务合同编号 |
| | | { label: "客户名称", prop: "client_name", min: 120, isClientClick: true }, // 客户名称 |
| | | { label: "服务合同编号", prop: "number", isCommonClick: true }, // 服务合同编号 |
| | | { label: "客户名称", prop: "client_name", isClientClick: true }, // 客户名称 |
| | | { label: "签约日期", prop: "signTime" }, // 签约日期 |
| | | { label: "合同类型", prop: "serviceContractType" }, // 合同类型 |
| | | { label: "合同状态", prop: "serviceContractStatus" }, // 合同状态 |