|
|
@@ -1,20 +1,17 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="合同编号" prop="customerContractCode">
|
|
|
- <el-input v-model="queryParams.customerContractCode" placeholder="请输入合同编号" clearable style="width: 250px"
|
|
|
+ <el-form-item label="合同编号" prop="supplierContractCode">
|
|
|
+ <el-input v-model="queryParams.supplierContractCode" placeholder="请输入合同编号" clearable style="width: 250px"
|
|
|
@keyup.enter.native="handleQuery" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="合同名称" prop="customerContractName">
|
|
|
- <el-input v-model="queryParams.customerContractName" placeholder="请输入合同名称" clearable style="width: 250px"
|
|
|
+ <el-form-item label="合同名称" prop="supplierContractName">
|
|
|
+ <el-input v-model="queryParams.supplierContractName" placeholder="请输入合同名称" clearable style="width: 250px"
|
|
|
@keyup.enter.native="handleQuery" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="客户" prop="customerId">
|
|
|
- <el-select v-model="queryParams.customerId" placeholder="请选择客户" style="width: 250px">
|
|
|
- <el-option v-for="item in customerList" :key="item.id" :label="item.customerName"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="供应商" prop="supplierName">
|
|
|
+ <el-input v-model="queryParams.supplierName" placeholder="请输入供应商" clearable style="width: 250px"
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开始日期" prop="startDate">
|
|
|
<el-date-picker v-model="queryParams.startDate" style="width: 250px" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
@@ -58,31 +55,59 @@
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
|
|
- v-hasPermi="['customer:info:create']">新增</el-button>
|
|
|
+ v-hasPermi="['contract:supplier:create']">新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
|
|
- v-hasPermi="['customer:info:export']">导出</el-button>
|
|
|
+ v-hasPermi="['contract:supplier:export']">导出</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="success" size="mini" :disabled="single" @click="handleOpen()"
|
|
|
+ v-hasPermi="['contract:supplier:open']">开启</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="info" size="mini" :disabled="single" @click="handleReceive('关闭')"
|
|
|
+ v-hasPermi="['contract:supplier:close']">关闭</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="danger" size="mini" :disabled="single" @click="handleReceive('终止')"
|
|
|
+ v-hasPermi="['contract:supplier:terminate']">终止</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button icon="el-icon-plus" size="mini" :disabled="single" @click="handleReceive('修改')"
|
|
|
+ v-hasPermi="['contract:supplier:status']">修改合同状态</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button icon="el-icon-plus" size="mini" :disabled="single" @click="handleAlter()"
|
|
|
+ v-hasPermi="['contract:supplier:alter']">变更</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="dataList">
|
|
|
- <el-table-column label="合同编号" align="center" prop="customerContractCode" min-width="350" />
|
|
|
- <el-table-column label="合同名称" align="center" prop="customerContractName" min-width="150" />
|
|
|
- <el-table-column label="客户开始日期" align="center" prop="startDate" min-width="100" />
|
|
|
- <el-table-column label="注册资本金(万元)" align="center" prop="money" min-width="150" />
|
|
|
- <el-table-column label="法人代表" align="center" prop="legalPerson" min-width="100" />
|
|
|
- <el-table-column label="员工人数" align="center" prop="workforce" min-width="100" />
|
|
|
- <el-table-column label="联系人" align="center" prop="ownerEmployeeId" min-width="100" />
|
|
|
- <el-table-column label="联系人手机号" align="center" prop="deptName" min-width="150" />
|
|
|
- <el-table-column label="是否开启" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-switch v-model="scope.row.isOpen" :active-value="0" :inactive-value="1"
|
|
|
- @change="handleStatusChange(scope.row)" />
|
|
|
+ <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" align="center" width="55" />
|
|
|
+ <el-table-column label="合同编号" align="center" prop="supplierContractCode" min-width="350">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <router-link :to="'/finance/contract/supplier/historyData/' + scope.row.supplierContractCode" class="link-type">
|
|
|
+ <span>{{ scope.row.supplierContractCode }}</span>
|
|
|
+ </router-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="创建人" align="center" prop="creatorEmployeeName" min-width="100" />
|
|
|
+ <el-table-column label="合同名称" align="center" prop="supplierContractName" min-width="150" />
|
|
|
+ <el-table-column label="是否框架合同" align="center" prop="isFrameContractDesc" min-width="100" />
|
|
|
+ <el-table-column label="供应商" align="center" prop="supplierName" min-width="150" />
|
|
|
+ <el-table-column label="合同开始日期" align="center" prop="startDate" min-width="100" />
|
|
|
+ <el-table-column label="合同结束日期" align="center" prop="endDate" min-width="100" />
|
|
|
+ <el-table-column label="合同金额" align="center" prop="money" min-width="100" />
|
|
|
+ <el-table-column label="负责人" align="center" prop="ownerEmployeeName" min-width="100" />
|
|
|
+ <el-table-column label="所属部门" align="center" prop="deptName" min-width="100"/>
|
|
|
+
|
|
|
+ <el-table-column label="状态" align="center" prop="contractStatusDesc" min-width="100"/>
|
|
|
+ <el-table-column label="是否关闭" align="center" prop="closedDesc" min-width="100"/>
|
|
|
+ <el-table-column label="是否终止" align="center" prop="terminateDesc" min-width="100"/>
|
|
|
+
|
|
|
+ <el-table-column label="创建人" align="center" prop="creatorName" min-width="100" />
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" min-width="150">
|
|
|
<template v-slot="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
@@ -91,9 +116,9 @@
|
|
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" min-width="150">
|
|
|
<template v-slot="scope">
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['customer:info:update']">修改</el-button>
|
|
|
+ v-hasPermi="['contract:supplier:update']">修改</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['customer:info:delete']">删除</el-button>
|
|
|
+ v-hasPermi="['contract:supplier:delete']">删除</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-detail" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -107,29 +132,26 @@
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="合同编号" prop="customerContractCode">
|
|
|
- <el-input v-model="form.customerContractCode" placeholder='请输入合同名称' disabled></el-input>
|
|
|
+ <el-form-item label="合同编号" prop="supplierContractCode">
|
|
|
+ <el-input v-model="form.supplierContractCode" placeholder='请输入合同名称' disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="合同名称" prop="customerContractName">
|
|
|
- <el-input maxlength="30" v-model="form.customerContractName" placeholder='请输入合同名称'></el-input>
|
|
|
+ <el-form-item label="合同名称" prop="supplierContractName">
|
|
|
+ <el-input maxlength="30" v-model="form.supplierContractName" placeholder='请输入合同名称'></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="框架合同" prop="isFrameContract">
|
|
|
<el-select v-model="form.isFrameContract" placeholder="请选择是否框架合同" style="width: 100%">
|
|
|
- <el-option label="否" value="0"></el-option>
|
|
|
- <el-option label="是" value="1"></el-option>
|
|
|
+ <el-option label="否" :value="parseInt(0)"></el-option>
|
|
|
+ <el-option label="是" :value="parseInt(1)"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="客户" prop="customerId">
|
|
|
- <el-select v-model="form.customerId" placeholder="请选择客户" style="width: 100%">
|
|
|
- <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="供应商" prop="supplierName">
|
|
|
+ <el-input maxlength="30" v-model="form.supplierName" placeholder='请输入供应商'></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
@@ -199,7 +221,7 @@
|
|
|
<div class="field-name">合同编号</div>
|
|
|
</div>
|
|
|
<div class="field-component">
|
|
|
- <span :title="form.customerContractCode">{{ form.customerContractCode }}</span>
|
|
|
+ <span :title="form.supplierContractCode">{{ form.supplierContractCode }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="fx-field x-grid-col-12">
|
|
|
@@ -208,7 +230,7 @@
|
|
|
<div class="field-name">合同名称</div>
|
|
|
</div>
|
|
|
<div class="field-component">
|
|
|
- <span :title="form.customerContractName">{{ form.customerContractName }}</span>
|
|
|
+ <span :title="form.supplierContractName">{{ form.supplierContractName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="fx-field x-grid-col-12">
|
|
|
@@ -223,10 +245,10 @@
|
|
|
<div class="fx-field x-grid-col-12">
|
|
|
<div class="field-label">
|
|
|
<span class="field-required">*</span>
|
|
|
- <div class="field-name">客户</div>
|
|
|
+ <div class="field-name">供应商</div>
|
|
|
</div>
|
|
|
<div class="field-component">
|
|
|
- <span :title="form.customerName">{{ form.customerName }}</span>
|
|
|
+ <span :title="form.supplierName">{{ form.supplierName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -299,16 +321,59 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <!-- <PeopleSelect ref="peopleSelect" type="single" :isCheck="true" :open="singlePeopleOpen"
|
|
|
- @cancel="singlePeopleOpen = false" @submit="submitSingle"></PeopleSelect> -->
|
|
|
+ <!-- 领用,归还,报废对话框 -->
|
|
|
+ <el-dialog :title="receiveTitle+'合同'" :visible.sync="openReceive" width="600px" append-to-body>
|
|
|
+ <el-form ref="receiveform" :model="receiveform" :rules="receiveRules" label-width="80px">
|
|
|
+ <el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-col :span="24" v-if="receiveTitle=='修改'">
|
|
|
+ <el-form-item label="合同状态" prop="contractStatus">
|
|
|
+ <el-select v-model="receiveform.contractStatus" placeholder="请选择状态" style="width: 100%">
|
|
|
+ <el-option label="未归档" value="0"></el-option>
|
|
|
+ <el-option label="已归档" value="1"></el-option>
|
|
|
+ <el-option label="已完成" value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="receiveTitle=='关闭'">
|
|
|
+ <el-form-item label="关闭原因" prop="closeReason">
|
|
|
+ <el-input maxlength="200" rows="4" show-word-limit type="textarea" v-model="receiveform.closeReason"
|
|
|
+ placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="receiveTitle=='终止'">
|
|
|
+ <el-form-item label="终止日期" prop="terminateDate">
|
|
|
+ <el-date-picker value-format="yyyy-MM-dd" v-model="receiveform.terminateDate" type="date"
|
|
|
+ placeholder="选择报废日期" style="width: 100%;">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="receiveTitle=='终止'">
|
|
|
+ <el-form-item label="终止原因" prop="terminateReason">
|
|
|
+ <el-input maxlength="200" rows="4" show-word-limit type="textarea" v-model="receiveform.terminateReason"
|
|
|
+ placeholder="请输入" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitReceiveForm">确 定</el-button>
|
|
|
+ <el-button @click="cancelReceive">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <PeopleSelect ref="peopleSelect" type="single" :isCheck="true" :open="singlePeopleOpen"
|
|
|
+ @cancel="singlePeopleOpen = false" @submit="submitSingle"></PeopleSelect>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listSimpleCustomer } from "@/api/crm/customer";
|
|
|
-import { changeUserStatus, getCustomerCode, listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, exportCustomer } from "@/api/crm/customer";
|
|
|
+import { open,close,terminate,editSupplierStatus,alter, getSupplierContractCode, listSupplier, getSupplier, delSupplier, addSupplier, updateSupplier, exportSupplier } from "@/api/finance/contract/supplier";
|
|
|
import { getBaseHeader } from "@/utils/request";
|
|
|
-import { CommonStatusEnum } from "@/utils/constants";
|
|
|
import PeopleSelect from "@/components/PeopleSelect/index.vue";
|
|
|
import { getEmployeeInfo } from "@/api/system/user";
|
|
|
export default {
|
|
|
@@ -317,8 +382,12 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ receiveTitle:'',
|
|
|
+ openReceive: false,
|
|
|
+ dataInfo:undefined,
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
singlePeopleOpen:false,
|
|
|
- customerList: [],
|
|
|
files: [],
|
|
|
// 设置上传的请求头部
|
|
|
headers: getBaseHeader(),
|
|
|
@@ -343,10 +412,10 @@ export default {
|
|
|
queryParams: {
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
- customerContractCode: undefined,
|
|
|
- customerContractName: undefined,
|
|
|
+ supplierContractCode: undefined,
|
|
|
+ supplierContractName: undefined,
|
|
|
|
|
|
- customerId: undefined,
|
|
|
+ supplierName: undefined,
|
|
|
startDate: [],
|
|
|
endDate: [],
|
|
|
ownerEmployeeName: undefined,
|
|
|
@@ -358,17 +427,17 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- customerContractCode: [
|
|
|
+ supplierContractCode: [
|
|
|
{ required: true, message: '请输入合同编号', trigger: 'blur' },
|
|
|
],
|
|
|
- customerContractName: [
|
|
|
+ supplierContractName: [
|
|
|
{ required: true, message: '请输入合同名称', trigger: 'blur' },
|
|
|
],
|
|
|
isFrameContract: [
|
|
|
{ required: true, message: '请选择是否框架合同', trigger: 'blur' }
|
|
|
],
|
|
|
- customerId: [
|
|
|
- { required: true, message: '请选择客户', trigger: 'blur' }
|
|
|
+ supplierName: [
|
|
|
+ { required: true, message: '请选择供应商', trigger: 'blur' }
|
|
|
],
|
|
|
startDate: [
|
|
|
{ required: true, message: '请选择开始日期', trigger: 'blur' }
|
|
|
@@ -388,12 +457,90 @@ export default {
|
|
|
{ required: true, message: '请选择负责人', trigger: 'change' },
|
|
|
],
|
|
|
},
|
|
|
+ receiveform:{},
|
|
|
+ receiveRules: {
|
|
|
+ contractStatus: [
|
|
|
+ { required: true, message: "请选合同状态", trigger: 'change' }
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ closeReason: [
|
|
|
+ { required: true, message: '请输入原因', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ terminateDate: [
|
|
|
+ { required: true, message: '请选择日期', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ terminateReason: [
|
|
|
+ { required: true, message: '请输入原因', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ this.getListSimpleSupplier();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //打开关闭,终止,修改合同状态弹窗
|
|
|
+ handleReceive(val) {
|
|
|
+ this.reset();
|
|
|
+ if((val == '关闭' || val == '终止' || val == '变更') && this.dataInfo[0].closed == 0){
|
|
|
+ this.receiveTitle = val;
|
|
|
+ this.openReceive = true;
|
|
|
+ }
|
|
|
+ else if(val == '修改'){
|
|
|
+ this.receiveform.employeeName = this.dataInfo[0].receiveEmployeeName;
|
|
|
+ this.receiveTitle = val;
|
|
|
+ this.openReceive = true;
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.$message.warning("该合同已关闭不支持此操作,请重新选择!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ handleOpen(){
|
|
|
+ if(this.dataInfo[0].closed==1){
|
|
|
+ open({id:this.dataInfo[0].id}).then(response => {
|
|
|
+ this.$modal.msgSuccess("开启成功");
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$message.warning("该合同已开启不支持此操作,请重新选择!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ handleAlter(){
|
|
|
+ if(this.dataInfo[0].closed==0){
|
|
|
+ this.reset();
|
|
|
+ const id = this.dataInfo[0].id;
|
|
|
+ getSupplier(id).then(response => {
|
|
|
+ this.files = [];
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "变更";
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$message.warning("该合同已开启不支持此操作,请重新选择!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ console.log(selection);
|
|
|
+ this.dataInfo = selection.map(item => item)
|
|
|
+ console.log(this.dataInfo);
|
|
|
+ this.single = selection.length != 1
|
|
|
+ },
|
|
|
getUser() {
|
|
|
let userInfo = JSON.parse(this.$store.getters.userInfo);
|
|
|
this.form.ownerEmployeeName = userInfo.nickname;
|
|
|
@@ -401,7 +548,7 @@ export default {
|
|
|
this.form.deptName = userInfo.deptName;
|
|
|
},
|
|
|
getEmployee() {
|
|
|
- getEmployeeInfo(this.form.employeeId).then(response => {
|
|
|
+ getEmployeeInfo(this.form.ownerEmployeeId).then(response => {
|
|
|
let employeeInfo = response.data;
|
|
|
this.form.deptName = employeeInfo.deptName;
|
|
|
// this.form.position = employeeInfo.position;
|
|
|
@@ -421,15 +568,10 @@ export default {
|
|
|
this.getEmployee();
|
|
|
this.singlePeopleOpen = false;
|
|
|
},
|
|
|
- getListSimpleCustomer() {
|
|
|
- listSimpleCustomer({ isOpen: 0 }).then(response => {
|
|
|
- this.customerList = response.data;
|
|
|
- });
|
|
|
- },
|
|
|
|
|
|
- getCustomerCode() {
|
|
|
- getCustomerCode().then(response => {
|
|
|
- this.form.customerContractCode = response.data;
|
|
|
+ getSupplierContractCode() {
|
|
|
+ getSupplierContractCode().then(response => {
|
|
|
+ this.form.supplierContractCode = response.data;
|
|
|
});
|
|
|
},
|
|
|
handleRemove(file, fileList) {
|
|
|
@@ -473,37 +615,28 @@ export default {
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
// 执行查询
|
|
|
- listCustomer(this.queryParams).then(response => {
|
|
|
+ listSupplier(this.queryParams).then(response => {
|
|
|
this.dataList = response.data.list;
|
|
|
this.total = response.data.total;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
- // 用户状态修改
|
|
|
- handleStatusChange(row) {
|
|
|
- let text = row.isOpen === CommonStatusEnum.ENABLE ? "开启" : "关闭";
|
|
|
- this.$modal.confirm('确认要"' + text + '""' + row.customerContractName + '"客户吗?').then(function () {
|
|
|
- return changeUserStatus(row.id, row.isOpen);
|
|
|
- }).then(() => {
|
|
|
- this.$modal.msgSuccess(text + "成功");
|
|
|
- this.getList();
|
|
|
- }).catch(function () {
|
|
|
- row.isOpen = row.isOpen === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
|
|
|
- : CommonStatusEnum.ENABLE;
|
|
|
- });
|
|
|
- },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
+ cancelReceive() {
|
|
|
+ this.openReceive = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- customerContractCode: undefined,
|
|
|
- customerContractName: undefined,
|
|
|
+ supplierContractCode: undefined,
|
|
|
+ supplierContractName: undefined,
|
|
|
isFrameContract: undefined,
|
|
|
- customerId: undefined,
|
|
|
+ supplierName: undefined,
|
|
|
startDate: undefined,
|
|
|
endDate: undefined,
|
|
|
money: undefined,
|
|
|
@@ -515,7 +648,16 @@ export default {
|
|
|
fileIdList: undefined,
|
|
|
remarks: undefined,
|
|
|
};
|
|
|
+ this.receiveform = {
|
|
|
+ id: undefined,
|
|
|
+ contractStatus: undefined,
|
|
|
+ closeReason: undefined,
|
|
|
+ terminateDate: undefined,
|
|
|
+ terminateReason: undefined,
|
|
|
+
|
|
|
+ };
|
|
|
this.resetForm("form");
|
|
|
+ this.resetForm("receiveform");
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
@@ -530,7 +672,7 @@ export default {
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
- this.getCustomerCode();
|
|
|
+ this.getSupplierContractCode();
|
|
|
this.getUser();
|
|
|
this.open = true;
|
|
|
this.title = "添加";
|
|
|
@@ -540,7 +682,7 @@ export default {
|
|
|
handleDetail(row) {
|
|
|
this.reset();
|
|
|
const id = row.id;
|
|
|
- getCustomer(id).then(response => {
|
|
|
+ getSupplier(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.openDetail = true;
|
|
|
this.title = "详情";
|
|
|
@@ -550,7 +692,7 @@ export default {
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
const id = row.id;
|
|
|
- getCustomer(id).then(response => {
|
|
|
+ getSupplier(id).then(response => {
|
|
|
let files = response.data.fileList;
|
|
|
if (files) {
|
|
|
this.files = [];
|
|
|
@@ -575,14 +717,21 @@ export default {
|
|
|
submitForm: function () {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.id !== undefined) {
|
|
|
- updateCustomer(this.form).then(response => {
|
|
|
+ if(this.title == '变更'){
|
|
|
+ alter(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("变更成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if (this.form.id !== undefined) {
|
|
|
+ updateSupplier(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addCustomer(this.form).then(response => {
|
|
|
+ addSupplier(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
@@ -591,11 +740,37 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ submitReceiveForm: function () {
|
|
|
+ this.$refs["receiveform"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.receiveform.id = this.dataInfo[0].id;
|
|
|
+ if (this.receiveTitle== '关闭') {
|
|
|
+ close(this.receiveform).then(response => {
|
|
|
+ this.$modal.msgSuccess("关闭成功");
|
|
|
+ this.openReceive = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else if(this.receiveTitle== '终止') {
|
|
|
+ terminate(this.receiveform).then(response => {
|
|
|
+ this.$modal.msgSuccess("终止成功");
|
|
|
+ this.openReceive = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ editSupplierStatus(this.receiveform).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改合同状态成功");
|
|
|
+ this.openReceive = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$modal.confirm('是否确认删除数据项?').then(function () {
|
|
|
- return delCustomer(ids);
|
|
|
+ return delSupplier(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
@@ -610,9 +785,9 @@ export default {
|
|
|
// 执行导出
|
|
|
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
|
|
this.exportLoading = true;
|
|
|
- return exportCustomer(params);
|
|
|
+ return exportSupplier(params);
|
|
|
}).then(response => {
|
|
|
- this.$download.excel(response, '客户信息.xls');
|
|
|
+ this.$download.excel(response, '采购合同信息.xls');
|
|
|
this.exportLoading = false;
|
|
|
}).catch(() => { });
|
|
|
}
|