lsun 协议管理

This commit is contained in:
lSun 2024-11-13 13:56:53 +08:00
parent 9d5bcd5b4f
commit 3bce0ae649
1 changed files with 93 additions and 28 deletions

View File

@ -11,6 +11,19 @@
/>
</el-form-item>
<el-form-item label="开始日期">
<el-date-picker v-model="queryParams.time" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option label="删除" value="0"></el-option>
<el-option label="启用" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -60,11 +73,9 @@
<el-table-column label="授权人" align="center" prop="authPerson" sortable/>
<el-table-column label="授权人电话" align="center" prop="phone" sortable/>
<el-table-column label="租赁单位类型" align="center">
<template v-if="houseList.protocol ==1">
<dict-tag>内部单位</dict-tag>
</template>
<template v-if="houseList.protocol ==2">
<dict-tag>外部单位</dict-tag>
<template slot-scope="scope">
<span v-if="scope.row.protocol == '1'">内部单位</span>
<span v-if="scope.row.protocol == '2'">外部单位</span>
</template>
</el-table-column>
@ -89,7 +100,7 @@
size="mini"
type="text"
icon="el-icon-zoom-in"
@click="handleUpdate(scope.row)"
@click="handleView(scope.row)"
>
查看
</el-button>
@ -236,6 +247,17 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="租赁单位类型">
<el-select v-model="form.protocol" placeholder="请选择租赁单位类型" clearable>
<el-option label="内部单位" value="1"></el-option>
<el-option label="外部单位" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="营业执照">
<el-upload
class = "upload-demo"
@ -278,7 +300,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm" v-if="showConfirmButton"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -297,6 +319,7 @@ import { downloadFile,downloadFileData } from '@/utils/download'
import { getToken } from '@/utils/auth'
import {Base64} from 'js-base64'
import { forEach } from 'jszip';
import {listUser} from "@/api/system/user";
export default {
name: "supplier",
data() {
@ -320,6 +343,8 @@ export default {
//
multiple: true,
//
dateRange: [],
//
showSearch: true,
@ -343,21 +368,15 @@ export default {
title: "",
//
open: false,
showConfirmButton:true,
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:undefined
keyWord:undefined,
status:undefined,
time: null, //
},
//
queryTeam: {
pageNum: 1,
pageSize: 10,
name: undefined,
sex: undefined,
teamId: undefined,
},
fileList:[],
businessLicenseFileList:[],
businessLicenseListTemp:[],
@ -570,7 +589,15 @@ export default {
async getList() {
this.loading = true;
getListAgreement(this.queryParams).then(response => {
const params = {
keyWord: this.queryParams.keyWord,
startTime: this.queryParams.time && this.queryParams.time[0],
endTime: this.queryParams.time && this.queryParams.time[1],
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
status: this.queryParams.status
};
getListAgreement(this.addDateRange(params)).then(response => {
this.houseList = response.rows;
this.total = response.total;
this.loading = false;
@ -609,8 +636,11 @@ export default {
this.businessLicenseFileList=[];
const supplierId = row.supplierId;
this.modelIdTemp = row.supplierId;
getAgreementDetail(supplierId).then((response) => {
var id = row.agreementId;
getAgreementDetail(id).then((response) => {
this.form = response.data;
this.form.proId = response.data.projectId;
if(response.data.bmFileInfos!=null){
this.businessLicenseListTemp = response.data.bmFileInfos;
this.businessLicenseListTemp.forEach(item=>{
@ -629,6 +659,40 @@ export default {
this.title = '修改'
})
},
handleView(row){
this.reset()
this.uploadKey = Date.now();
this.delBusinessFileIdList=[];
this.businessLicenseListTemp=[];
this.businessLicenseFileList=[];
const supplierId = row.supplierId;
this.modelIdTemp = row.supplierId;
var id = row.agreementId;
getAgreementDetail(id).then((response) => {
this.form = response.data;
this.form.proId = response.data.projectId;
if(response.data.bmFileInfos!=null){
this.businessLicenseListTemp = response.data.bmFileInfos;
this.businessLicenseListTemp.forEach(item=>{
if(item.name.includes('/')){
const fileNameWithTimestamp = item.name.split('/').pop();
const parts = fileNameWithTimestamp.split('_');
const fileType = item.name.split('.').pop();
const mainFileName = parts.slice(0, parts.length - 1).join('_');
item.name = mainFileName + '.' +fileType;
}
})
}else{
this.businessLicenseListTemp = [];
}
this.showHouse = true
this.showConfirmButton = false
this.title = '查询'
})
},
//
reset() {
this.form = {};
@ -637,8 +701,10 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord=null;
this.queryParams.status=null;
this.queryParams.time = [];
this.resetForm("queryForm");
this.handleQuery();
},
@ -646,9 +712,8 @@ export default {
submitForm() {
this.$refs["form"].validate(async valid => {
this.form.projectId = this.form.proId;
await this.addAgreementTemp(this.form);
/*if (valid) {
if (this.form.supplierId != undefined) {
if (valid) {
if (this.form.agreementId != undefined) {
const reqData = new FormData();
if(this.businessLicenseListTemp.length!=0){
await this.getImaUploadEdit(),
@ -671,7 +736,7 @@ export default {
}
}
}*/
}
});
this.uploadKey = Date.now();
},
@ -784,11 +849,11 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const supplierId = row.supplierId
var id = row.agreementId
this.$modal
.confirm('是否确认删除数据项?')
.then(function () {
return delAgreement(supplierId)
return delAgreement(id)
})
.then(() => {
this.$modal.msgSuccess('删除成功')
@ -798,9 +863,9 @@ export default {
},
handleExport() {
this.download('/material/wh_house_info/export', {
this.download('/material/bm_agreement_info/export', {
...this.queryParams
}, `仓库管理_${new Date().getTime()}.xlsx`)
}, `协议管理 _${new Date().getTime()}.xlsx`)
},
/** 搜索按钮操作 */