Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -235,11 +235,13 @@ class Contract extends Common
|
|||||||
$insert_info['contract_category']= $param['contract_category'];
|
$insert_info['contract_category']= $param['contract_category'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($param['contract_url'] == ''){
|
// 先检查键是否存在,再判断值是否为空
|
||||||
|
if (!isset($param['contract_url']) || $param['contract_url'] == '') {
|
||||||
$insert_info['contract_url'] = '';
|
$insert_info['contract_url'] = '';
|
||||||
} else {
|
} else {
|
||||||
$insert_info['contract_url'] = $param['contract_url'];
|
$insert_info['contract_url'] = $param['contract_url'];
|
||||||
$insert_info['contract_file_name'] = $param['contract_file_name'];
|
// 同理,contract_file_name 也建议做存在性检查,避免同理报错
|
||||||
|
$insert_info['contract_file_name'] = isset($param['contract_file_name']) ? $param['contract_file_name'] : '';
|
||||||
}
|
}
|
||||||
db('contract_info')->insert($insert_info);
|
db('contract_info')->insert($insert_info);
|
||||||
return $this->sendSuccess('添加成功');
|
return $this->sendSuccess('添加成功');
|
||||||
@@ -320,4 +322,109 @@ class Contract extends Common
|
|||||||
return $this->sendError('删除失败');
|
return $this->sendError('删除失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 合同检索
|
||||||
|
public function searchContracts()
|
||||||
|
{
|
||||||
|
$param = request()->param();
|
||||||
|
|
||||||
|
$currPage = isset($param['currPage']) ? $param['currPage'] : 1;
|
||||||
|
$pageSize = isset($param['pageSize']) ? $param['pageSize'] : 20;
|
||||||
|
|
||||||
|
// 构建查询条件
|
||||||
|
$where = ['del_time' => null];
|
||||||
|
|
||||||
|
// 时间范围筛选
|
||||||
|
if (isset($param['start_date']) && !empty($param['start_date'])) {
|
||||||
|
$where['create_time'] = ['>=', $param['start_date']];
|
||||||
|
}
|
||||||
|
if (isset($param['end_date']) && !empty($param['end_date'])) {
|
||||||
|
if (isset($where['create_time'])) {
|
||||||
|
$where['create_time'] = [
|
||||||
|
['>=', $param['start_date']],
|
||||||
|
['<=', $param['end_date']]
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$where['create_time'] = ['<=', $param['end_date']];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同分类筛选
|
||||||
|
if (isset($param['contract_category']) && $param['contract_category'] !== '' && $param['contract_category'] !== '0') {
|
||||||
|
$where['contract_category'] = $param['contract_category'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询合同列表
|
||||||
|
$contractList = db('contract_info')
|
||||||
|
->where($where)
|
||||||
|
->order('contract_id', 'desc')
|
||||||
|
->page($currPage, $pageSize)
|
||||||
|
->select();
|
||||||
|
|
||||||
|
// 遍历合同列表,补充关联信息
|
||||||
|
foreach ($contractList as &$contract) {
|
||||||
|
// 获取合同类型名称
|
||||||
|
if ($contract['contract_type']) {
|
||||||
|
$contractType = db('contract_type')
|
||||||
|
->where('type_id', $contract['contract_type'])
|
||||||
|
->field('type_name')
|
||||||
|
->find();
|
||||||
|
$contract['contract_type_name'] = $contractType ? $contractType['type_name'] : '';
|
||||||
|
} else {
|
||||||
|
$contract['contract_type_name'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取合同分类名称
|
||||||
|
switch ($contract['contract_category']) {
|
||||||
|
case 1:
|
||||||
|
$contract['contract_category_name'] = '销售合同';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$contract['contract_category_name'] = '销售技术协议';
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$contract['contract_category_name'] = '采购合同';
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$contract['contract_category_name'] = '采购及技术协议';
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
$contract['contract_category_name'] = '其他';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$contract['contract_category_name'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取项目名称
|
||||||
|
if ($contract['project_id']) {
|
||||||
|
$project = db('project_info')
|
||||||
|
->where('project_id', $contract['project_id'])
|
||||||
|
->field('project_name')
|
||||||
|
->find();
|
||||||
|
$contract['project_name'] = $project ? $project['project_name'] : '';
|
||||||
|
} else {
|
||||||
|
$contract['project_name'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取合作伙伴名称
|
||||||
|
if ($contract['partner_id']) {
|
||||||
|
$partner = db('partner_company')
|
||||||
|
->where('company_id', $contract['partner_id'])
|
||||||
|
->field('company_name')
|
||||||
|
->find();
|
||||||
|
$contract['partner_name'] = $partner ? $partner['company_name'] : '';
|
||||||
|
} else {
|
||||||
|
$contract['partner_name'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($contract);
|
||||||
|
|
||||||
|
// 查询总记录数
|
||||||
|
$total = db('contract_info')->where($where)->count();
|
||||||
|
|
||||||
|
$res['list'] = $contractList;
|
||||||
|
$res['total'] = $total;
|
||||||
|
|
||||||
|
return $this->sendSuccess($res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -321,6 +321,7 @@ class User extends Common
|
|||||||
$ret['company'] = "苏州维达奇智能科技有限公司";
|
$ret['company'] = "苏州维达奇智能科技有限公司";
|
||||||
}
|
}
|
||||||
$ret['id'] = $login_id;
|
$ret['id'] = $login_id;
|
||||||
|
$ret['name'] = $res['user_name'];
|
||||||
}
|
}
|
||||||
//客户
|
//客户
|
||||||
if (2 == $res['user_type'])
|
if (2 == $res['user_type'])
|
||||||
@@ -332,6 +333,7 @@ class User extends Common
|
|||||||
->field('i.contacts_name as name, i.contacts_idcard as idcard, c.company_name as company')
|
->field('i.contacts_name as name, i.contacts_idcard as idcard, c.company_name as company')
|
||||||
->find();
|
->find();
|
||||||
$ret['id'] = $login_id;
|
$ret['id'] = $login_id;
|
||||||
|
$ret['name'] = $res['user_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ return [
|
|||||||
// 用户名
|
// 用户名
|
||||||
'username' => 'root',
|
'username' => 'root',
|
||||||
// 密码
|
// 密码
|
||||||
'password' => '123456',
|
'password' => '12356',
|
||||||
// 端口
|
// 端口
|
||||||
'hostport' => '',
|
'hostport' => '',
|
||||||
// 连接dsn
|
// 连接dsn
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
NODE_ENV: '"development"',
|
NODE_ENV: '"development"',
|
||||||
ENV_CONFIG: '"dev"',
|
ENV_CONFIG: '"dev"',
|
||||||
BASE_WMS_API: '"http://47.111.78.178:8011/api"',
|
BASE_WMS_API: '"http://127.0.0.1:8080/api"',
|
||||||
BASE_WMS_FILE: '"http://47.111.78.178:8011/"'
|
BASE_WMS_FILE: '"http://127.0.0.1:8080/"'
|
||||||
// 47.101.147.253
|
// 47.101.147.253
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
ENV_CONFIG: '"prod"',
|
ENV_CONFIG: '"prod"',
|
||||||
BASE_WMS_API: '"http://47.111.78.178:8011/api"',
|
BASE_WMS_API: '"http://127.0.0.1:8080/api"',
|
||||||
BASE_WMS_FILE: '"http://47.111.78.178:8011/"'
|
BASE_WMS_FILE: '"http://127.0.0.1:8080/"'
|
||||||
////BASE_AGV_API: '"http://192.168.3.223:55200/v1"',
|
////BASE_AGV_API: '"http://192.168.3.223:55200/v1"',
|
||||||
//BASE_WMS_API: '"http://169.254.71.103/api"',
|
//BASE_WMS_API: '"http://169.254.71.103/api"',
|
||||||
//BASE_AGV_API: '"http://127.0.0.1:55200/v1"',
|
//BASE_AGV_API: '"http://127.0.0.1:55200/v1"',
|
||||||
|
|||||||
@@ -90,5 +90,14 @@ export default {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: param
|
data: param
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 合同检索
|
||||||
|
searchContracts(param) {
|
||||||
|
return request({
|
||||||
|
url: `/Contract/searchContracts`,
|
||||||
|
method: 'post',
|
||||||
|
data: param
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,53 +8,321 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-form :inline="true" :model="queryParam" class="form-inline" style="margin-left: 10px;margin-top: 10px;">
|
<el-form :inline="true" :model="queryParam" class="form-inline" style="margin-left: 10px;margin-top: 10px;">
|
||||||
<el-form-item label="时间范围">
|
<el-form-item label="时间范围">
|
||||||
<el-date-picker style="width:100%" v-model="busTime" type="daterange" :editable="false"
|
<el-date-picker
|
||||||
range-separator="→" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" clearable
|
v-model="busTime"
|
||||||
:picker-options="executeTimeOptions">
|
:editable="false"
|
||||||
</el-date-picker>
|
:picker-options="executeTimeOptions"
|
||||||
|
style="width:100%"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="→"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同类型">
|
<el-form-item label="合同分类">
|
||||||
<el-select v-model="map_idx" filterable placeholder="合同类型">
|
<el-select v-model="queryParam.contract_category" filterable placeholder="合同分类">
|
||||||
<el-option label="全部合同" value="0"></el-option>
|
<el-option label="全部合同" value="0"/>
|
||||||
<el-option label="项目合同" value="1"></el-option>
|
<el-option label="销售合同" value="1"/>
|
||||||
<el-option label="运营合同" value="2"></el-option>
|
<el-option label="销售技术协议" value="2"/>
|
||||||
|
<el-option label="采购合同" value="3"/>
|
||||||
|
<el-option label="采购及技术协议" value="4"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||||
|
<el-button @click="onReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 合同列表表格 -->
|
||||||
|
<el-row style="margin-top: 20px;">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>合同列表</span>
|
||||||
|
<span style="float: right;">共 {{ total }} 条记录</span>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="contractList"
|
||||||
|
style="width: 100%"
|
||||||
|
stripe
|
||||||
|
border>
|
||||||
|
<el-table-column
|
||||||
|
prop="contract_number"
|
||||||
|
label="合同编号"
|
||||||
|
width="150"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="contract_name"
|
||||||
|
label="合同名称"
|
||||||
|
width="200"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="contract_type_name"
|
||||||
|
label="合同类型"
|
||||||
|
width="120"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="contract_category_name"
|
||||||
|
label="合同分类"
|
||||||
|
width="120"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="project_name"
|
||||||
|
label="所属项目"
|
||||||
|
width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.project_name || '-' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="partner_name"
|
||||||
|
label="合作伙伴"
|
||||||
|
width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.partner_name || '-' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="contract_price"
|
||||||
|
label="合同金额"
|
||||||
|
width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
¥{{ scope.row.contract_price | currency }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="create_time"
|
||||||
|
label="签署时间"
|
||||||
|
width="120"/>
|
||||||
|
<el-table-column
|
||||||
|
prop="contract_des"
|
||||||
|
label="合同描述"
|
||||||
|
min-width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.contract_des || '-' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="100"
|
||||||
|
fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.contract_url"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="viewContract(scope.row)">
|
||||||
|
查看
|
||||||
|
</el-button>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<template slot="empty">
|
||||||
|
<div style="padding: 20px;">
|
||||||
|
<i class="el-icon-document" style="font-size: 48px; color: #ddd;"/>
|
||||||
|
<p style="margin-top: 10px; color: #999;">暂无合同数据</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<div style="margin-top: 20px; text-align: right;">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="currentPage"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"/>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 显示文件对话框 -->
|
||||||
|
<el-dialog :visible.sync="dialogVisibleShowFile" title="文件信息" width="80%" append-to-body>
|
||||||
|
<img v-if="isImage" :src="previewUrl" alt="Preview" style="max-width: 40%; max-height: 30%;">
|
||||||
|
<iframe v-else-if="isPDF" :src="previewUrl" frameborder="0" style="width: 100%; height: 600px;"/>
|
||||||
|
<div v-else>
|
||||||
|
<p>该文件类型({{ fileExtension }})需要下载后查看</p>
|
||||||
|
<el-button type="primary" @click="downloadFile(previewUrl)">
|
||||||
|
立即下载 {{ fileExtension.toUpperCase() }} 文件
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import contractApi from '@/api/contract'
|
||||||
data() {
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
filters: {
|
||||||
|
currency(value) {
|
||||||
|
if (!value) return '0.00'
|
||||||
|
return Number(value).toLocaleString('zh-CN', {
|
||||||
|
minimumFractionDigits: 2,
|
||||||
|
maximumFractionDigits: 2
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParam:
|
queryParam: {
|
||||||
{
|
contract_category: '0'
|
||||||
|
},
|
||||||
busTime: [],
|
busTime: [],
|
||||||
map_idx: "16",
|
contractList: [],
|
||||||
lock: "2",
|
loading: false,
|
||||||
storage_type: "0",
|
// 分页相关
|
||||||
work_type: "0"
|
currentPage: 1,
|
||||||
}, //查询条件
|
pageSize: 10,
|
||||||
};
|
total: 0,
|
||||||
|
// 文件预览相关
|
||||||
|
dialogVisibleShowFile: false,
|
||||||
|
previewUrl: '',
|
||||||
|
currentFileName: '',
|
||||||
|
fileExtension: '',
|
||||||
|
isImage: false,
|
||||||
|
isPDF: false,
|
||||||
|
executeTimeOptions: {
|
||||||
|
shortcuts: [{
|
||||||
|
text: '最近一周',
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date()
|
||||||
|
const start = new Date()
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||||
|
picker.$emit('pick', [start, end])
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '最近一个月',
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date()
|
||||||
|
const start = new Date()
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||||
|
picker.$emit('pick', [start, end])
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '最近三个月',
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date()
|
||||||
|
const start = new Date()
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||||
|
picker.$emit('pick', [start, end])
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.loadContracts()
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
this.currentPage = 1
|
||||||
|
this.loadContracts()
|
||||||
|
},
|
||||||
|
onReset() {
|
||||||
|
this.queryParam.contract_category = '0'
|
||||||
|
this.busTime = []
|
||||||
|
this.currentPage = 1
|
||||||
|
this.loadContracts()
|
||||||
|
},
|
||||||
|
// 分页大小改变
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pageSize = val
|
||||||
|
this.currentPage = 1 // 重置到第一页
|
||||||
|
this.loadContracts()
|
||||||
|
},
|
||||||
|
// 当前页改变
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.currentPage = val
|
||||||
|
this.loadContracts()
|
||||||
|
},
|
||||||
|
async loadContracts() {
|
||||||
|
this.loading = true
|
||||||
|
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
contract_category: this.queryParam.contract_category,
|
||||||
|
page: this.currentPage,
|
||||||
|
pageSize: this.pageSize
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加时间范围参数
|
||||||
|
if (this.busTime && this.busTime.length === 2) {
|
||||||
|
params.start_date = this.busTime[0]
|
||||||
|
params.end_date = this.busTime[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await contractApi.searchContracts(params)
|
||||||
|
|
||||||
|
// 处理响应数据 - 兼容两种可能的响应结构
|
||||||
|
const apiResponse = response.data || response
|
||||||
|
|
||||||
|
if (apiResponse.code === 20000) {
|
||||||
|
const data = apiResponse.data
|
||||||
|
this.contractList = Array.isArray(data.list) ? data.list : []
|
||||||
|
this.total = parseInt(data.total) || 0
|
||||||
|
|
||||||
|
if (this.contractList.length === 0) {
|
||||||
|
this.$message.info('未找到符合条件的合同数据')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(apiResponse.msg || '查询失败')
|
||||||
|
this.contractList = []
|
||||||
|
this.total = 0
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('查询合同失败:', error)
|
||||||
|
this.$message.error('查询失败,请稍后重试')
|
||||||
|
this.contractList = []
|
||||||
|
this.total = 0
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
viewContract(row) {
|
||||||
|
if (!row.contract_url) {
|
||||||
|
this.$message.warning('该合同暂无文件')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = row.contract_url
|
||||||
|
const ext = url.split('.').pop().toLowerCase()
|
||||||
|
this.currentFileName = row.contract_file_name || row.contract_name
|
||||||
|
this.isImage = false
|
||||||
|
this.isPDF = false
|
||||||
|
this.fileExtension = ext
|
||||||
|
|
||||||
|
// 构建完整的文件URL
|
||||||
|
const baseUrl = process.env.BASE_WMS_FILE || (
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? 'http://localhost/oms/back/public'
|
||||||
|
: window.location.origin + '/back/public'
|
||||||
|
)
|
||||||
|
|
||||||
|
if (['jpg', 'jpeg', 'png'].includes(ext)) {
|
||||||
|
this.previewUrl = baseUrl + url
|
||||||
|
this.isImage = true
|
||||||
|
} else if (ext === 'pdf') {
|
||||||
|
this.previewUrl = baseUrl + url
|
||||||
|
this.isPDF = true
|
||||||
|
} else {
|
||||||
|
this.previewUrl = baseUrl + url
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dialogVisibleShowFile = true
|
||||||
|
},
|
||||||
|
downloadFile(url) {
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = url
|
||||||
|
link.setAttribute('download', this.currentFileName)
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,52 +5,69 @@
|
|||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>运营合同</span>
|
<span>运营合同</span>
|
||||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-circle-plus-outline"
|
<el-button
|
||||||
@click="createBaseType"></el-button>
|
style="float: right; padding: 3px 0"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-circle-plus-outline"
|
||||||
|
@click="createBaseType"/>
|
||||||
</div>
|
</div>
|
||||||
<el-tree :data="contract_type_list" node-key="type_id" @node-click="handle_node_click"
|
<el-tree
|
||||||
@node-collapse="closeTreeMenu" :props="defaultProps" @node-contextmenu="openTreeMenu"
|
:data="contract_type_list"
|
||||||
:expand-on-click-node="false">
|
:props="defaultProps"
|
||||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
:expand-on-click-node="false"
|
||||||
|
node-key="type_id"
|
||||||
|
@node-click="handle_node_click"
|
||||||
|
@node-collapse="closeTreeMenu"
|
||||||
|
@node-contextmenu="openTreeMenu">
|
||||||
|
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||||
<span>{{ node.label }}</span>
|
<span>{{ node.label }}</span>
|
||||||
</span>
|
</span>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<el-card class="box-card" v-if="currentData != null">
|
<el-card v-if="currentData != null" class="box-card">
|
||||||
<span>[合同类型说明]: {{ currentData.type_desp }}</span>
|
<span>[合同类型说明]: {{ currentData.type_desp }}</span>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-table :data="contract_info_list" border fit highlight-current-row
|
<el-table
|
||||||
style="width: 100%; margin-left: 2px;" height="80vh">
|
:data="contract_info_list"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
highlight-current-row
|
||||||
|
style="width: 100%; margin-left: 2px;"
|
||||||
|
height="80vh">
|
||||||
<!--el-table-column prop="asset_id" label="ID" align="center">
|
<!--el-table-column prop="asset_id" label="ID" align="center">
|
||||||
</el-table-column-->
|
</el-table-column-->
|
||||||
<el-table-column prop="contract_number" label="合同编号" align="left">
|
<el-table-column prop="contract_number" label="合同编号" align="left"/>
|
||||||
</el-table-column>
|
<el-table-column prop="contract_name" label="合同名称" align="left"/>
|
||||||
<el-table-column prop="contract_name" label="合同名称" align="left">
|
<el-table-column prop="contract_des" label="合同内容" align="left"/>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="contract_des" label="合同内容" align="left">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="合同类型" align="left">
|
<el-table-column label="合同类型" align="left">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="(scope.row.contract_category == 1)">销售合同</div>
|
<div v-if="(scope.row.contract_category == 1)">销售合同</div>
|
||||||
<div v-if="(scope.row.contract_category == 3)">采购合同</div>
|
<div v-if="(scope.row.contract_category == 3)">采购合同</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="contract_price" label="合同金额" align="left">
|
<el-table-column prop="contract_price" label="合同金额" align="left"/>
|
||||||
</el-table-column>
|
<el-table-column prop="create_time" label="签约时间" align="left"/>
|
||||||
<el-table-column prop="create_time" label="签约时间" align="left">
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
|
|
||||||
<el-table-column fixed="right" label="操作" width="250px">
|
<el-table-column fixed="right" label="操作" width="250px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button class="el-icon-view" v-if="scope.row.contract_url != ''"
|
<el-button
|
||||||
@click="showImg(scope.row)" size="mini" type="primary"></el-button>
|
v-if="scope.row.contract_url != ''"
|
||||||
<el-button @click="update(scope.row)" size="mini" class="el-icon-edit"
|
class="el-icon-view"
|
||||||
type="primary"></el-button>
|
size="mini"
|
||||||
<el-button class="el-icon-delete" @click="handleClick(scope.row)" size="mini"
|
type="primary"
|
||||||
type="danger"></el-button>
|
@click="showImg(scope.row)"/>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
class="el-icon-edit"
|
||||||
|
type="primary"
|
||||||
|
@click="update(scope.row)"/>
|
||||||
|
<el-button
|
||||||
|
class="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="handleClick(scope.row)"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -58,9 +75,9 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- 显示文件对话框 -->
|
<!-- 显示文件对话框 -->
|
||||||
<el-dialog title="文件信息" :visible.sync="dialogVisibleShowFile" width="80%" append-to-body>
|
<el-dialog :visible.sync="dialogVisibleShowFile" title="文件信息" width="80%" append-to-body>
|
||||||
<img v-if="isImage" :src="previewUrl" alt="Preview" style="max-width: 40%; max-height: 30%;">
|
<img v-if="isImage" :src="previewUrl" alt="Preview" style="max-width: 40%; max-height: 30%;">
|
||||||
<iframe v-else-if="isPDF" :src="previewUrl" frameborder="0" style="width: 100%; height: 600px;"></iframe>
|
<iframe v-else-if="isPDF" :src="previewUrl" frameborder="0" style="width: 100%; height: 600px;"/>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p>该文件类型({{ fileExtension }})需要下载后查看</p>
|
<p>该文件类型({{ fileExtension }})需要下载后查看</p>
|
||||||
<el-button type="primary" @click="downloadFile(previewUrl)">
|
<el-button type="primary" @click="downloadFile(previewUrl)">
|
||||||
@@ -69,23 +86,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
<div v-show="showTreeMenu" class="treeMenu">
|
<div v-show="showTreeMenu" class="treeMenu">
|
||||||
<div v-if="currentNodeLevel < 3" @click="createFolder" style="margin-left: 5px;">
|
<div v-if="currentNodeLevel < 3" style="margin-left: 5px;" @click="createFolder">
|
||||||
<i class="el-icon-plus" style="color: #1e9fff"></i>
|
<i class="el-icon-plus" style="color: #1e9fff"/>
|
||||||
增加合同类型
|
增加合同类型
|
||||||
</div>
|
</div>
|
||||||
<div @click="createContract" style="margin-top: 10px;margin-left: 5px;">
|
<div style="margin-top: 10px;margin-left: 5px;" @click="createContract">
|
||||||
<i class="el-icon-plus" style="color: #1e9fff"></i>
|
<i class="el-icon-plus" style="color: #1e9fff"/>
|
||||||
增加合同信息
|
增加合同信息
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 添加类型对话框 -->
|
<!-- 添加类型对话框 -->
|
||||||
<el-dialog title="添加类型" :visible.sync="dialogVisibleCreateFolder" width="30%">
|
<el-dialog :visible.sync="dialogVisibleCreateFolder" title="添加类型" width="30%">
|
||||||
<el-form :model="newNode" label-width="80px">
|
<el-form :model="newNode" label-width="80px">
|
||||||
<el-form-item label="类型名称">
|
<el-form-item label="类型名称">
|
||||||
<el-input v-model="newNode.label"></el-input>
|
<el-input v-model="newNode.label"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -94,21 +110,20 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加合同信息对话框 -->
|
<!-- 添加合同信息对话框 -->
|
||||||
<el-dialog title="添加合同信息" :visible.sync="dialogVisibleCreateContract" :close-on-click-modal="false" width="30%">
|
<el-dialog :visible.sync="dialogVisibleCreateContract" :close-on-click-modal="false" title="添加合同信息" width="30%">
|
||||||
<el-form :model="newNode3" label-width="80px">
|
<el-form :model="newNode3" label-width="80px">
|
||||||
<el-form-item label="合同编号">
|
<el-form-item label="合同编号">
|
||||||
<el-input v-model="newNode3.contract_number"></el-input>
|
<el-input v-model="newNode3.contract_number"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同名称">
|
<el-form-item label="合同名称">
|
||||||
<el-input v-model="newNode3.contract_name"></el-input>
|
<el-input v-model="newNode3.contract_name"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同内容">
|
<el-form-item label="合同内容">
|
||||||
<el-input v-model="newNode3.contract_des"></el-input>
|
<el-input v-model="newNode3.contract_des"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同金额">
|
<el-form-item label="合同金额">
|
||||||
<el-input v-model="newNode3.contract_price"></el-input>
|
<el-input v-model="newNode3.contract_price"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model="newNode3.contract_category" :label="1">销售合同</el-radio>
|
<el-radio v-model="newNode3.contract_category" :label="1">销售合同</el-radio>
|
||||||
@@ -116,15 +131,24 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="生效时间">
|
<el-form-item label="生效时间">
|
||||||
<el-date-picker v-model="newNode3.create_time" type="date" format="yyyy-MM-dd"
|
<el-date-picker
|
||||||
value-format="yyyy-MM-dd" placeholder="选择日期时间">
|
v-model="newNode3.create_time"
|
||||||
</el-date-picker>
|
type="date"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择日期时间"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="添加文件">
|
<el-form-item label="添加文件">
|
||||||
<el-upload class="upload-demo" :action="upload_url" :on-preview="handlePreview"
|
<el-upload
|
||||||
:on-remove="handleRemove" :on-success="handleNewSuccess" :before-upload="beforeUpload"
|
:action="upload_url"
|
||||||
:file-list="fileList" accept=".jpg,.jpeg,.png,.pdf,.pptx,.xlsx,.xls,.docx,.doc,.ppt,.zip,.rar">
|
:on-preview="handlePreview"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:on-success="handleNewSuccess"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:file-list="fileList"
|
||||||
|
class="upload-demo"
|
||||||
|
accept=".jpg,.jpeg,.png,.pdf,.pptx,.xlsx,.xls,.docx,.doc,.ppt,.zip,.rar">
|
||||||
<el-button size="small" type="primary">点击上传</el-button>
|
<el-button size="small" type="primary">点击上传</el-button>
|
||||||
<div slot="tip" class="el-upload__tip">
|
<div slot="tip" class="el-upload__tip">
|
||||||
支持jpg/jpeg/png/pdf/pptx/xlsx/xls/docx/doc/ppt/zip/rar文件,不超过100MB
|
支持jpg/jpeg/png/pdf/pptx/xlsx/xls/docx/doc/ppt/zip/rar文件,不超过100MB
|
||||||
@@ -139,33 +163,42 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 编辑合同对话框 -->
|
<!-- 编辑合同对话框 -->
|
||||||
<el-dialog title="编辑合同信息" :visible.sync="dialogVisibleEdit" :close-on-click-modal="false" width="30%">
|
<el-dialog :visible.sync="dialogVisibleEdit" :close-on-click-modal="false" title="编辑合同信息" width="30%">
|
||||||
<el-form :model="editNode" label-width="80px">
|
<el-form :model="editNode" label-width="80px">
|
||||||
<el-form-item label="合同编号">
|
<el-form-item label="合同编号">
|
||||||
<el-input v-model="editNode.contract_number" disabled></el-input>
|
<el-input v-model="editNode.contract_number" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同名称">
|
<el-form-item label="合同名称">
|
||||||
<el-input v-model="editNode.contract_name"></el-input>
|
<el-input v-model="editNode.contract_name"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同内容">
|
<el-form-item label="合同内容">
|
||||||
<el-input v-model="editNode.contract_des"></el-input>
|
<el-input v-model="editNode.contract_des"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同金额">
|
<el-form-item label="合同金额">
|
||||||
<el-input v-model="editNode.contract_price"></el-input>
|
<el-input v-model="editNode.contract_price"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model="editNode.contract_category" :label="1">销售合同</el-radio>
|
<el-radio v-model="editNode.contract_category" :label="1">销售合同</el-radio>
|
||||||
<el-radio v-model="editNode.contract_category" :label="3">采购合同</el-radio>
|
<el-radio v-model="editNode.contract_category" :label="3">采购合同</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="入库时间">
|
<el-form-item label="入库时间">
|
||||||
<el-date-picker v-model="editNode.create_time" type="datetime" format="yyyy-MM-dd"
|
<el-date-picker
|
||||||
value-format="yyyy-MM-dd" placeholder="选择日期时间">
|
v-model="editNode.create_time"
|
||||||
</el-date-picker>
|
type="datetime"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择日期时间"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="合同文件">
|
<el-form-item label="合同文件">
|
||||||
<el-upload class="upload-demo" :action="upload_url" :on-preview="handlePreview"
|
<el-upload
|
||||||
:on-remove="handleRemove" :on-success="handleNewSuccess" :before-upload="beforeUpload"
|
:action="upload_url"
|
||||||
:file-list="fileList" accept=".jpg,.jpeg,.png,.pdf,.pptx,.xlsx,.xls,.docx,.doc,.ppt,.zip,.rar">
|
:on-preview="handlePreview"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:on-success="handleNewSuccess"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:file-list="fileList"
|
||||||
|
class="upload-demo"
|
||||||
|
accept=".jpg,.jpeg,.png,.pdf,.pptx,.xlsx,.xls,.docx,.doc,.ppt,.zip,.rar">
|
||||||
<el-button size="small" type="primary">点击上传</el-button>
|
<el-button size="small" type="primary">点击上传</el-button>
|
||||||
<div slot="tip" class="el-upload__tip">
|
<div slot="tip" class="el-upload__tip">
|
||||||
支持jpg/jpeg/png/pdf/pptx/xlsx/xls/docx/doc/ppt/zip/rar文件,不超过100MB
|
支持jpg/jpeg/png/pdf/pptx/xlsx/xls/docx/doc/ppt/zip/rar文件,不超过100MB
|
||||||
@@ -186,7 +219,7 @@ import contract from '@/api/contract'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
let id = 1;
|
const id = 1
|
||||||
return {
|
return {
|
||||||
// contract_url:'',
|
// contract_url:'',
|
||||||
upload_url: process.env.BASE_WMS_API + '/upload/uploadFile',
|
upload_url: process.env.BASE_WMS_API + '/upload/uploadFile',
|
||||||
@@ -241,7 +274,7 @@ export default {
|
|||||||
fileList: [],
|
fileList: [],
|
||||||
contract_img: '',
|
contract_img: '',
|
||||||
contract_pdf_img: ''
|
contract_pdf_img: ''
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.get_contract_type_list()
|
this.get_contract_type_list()
|
||||||
@@ -251,12 +284,12 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
downloadFile(url) {
|
downloadFile(url) {
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a')
|
||||||
link.href = url;
|
link.href = url
|
||||||
link.setAttribute('download', this.currentFileName); // 使用数据库中的文件名
|
link.setAttribute('download', this.currentFileName) // 使用数据库中的文件名
|
||||||
document.body.appendChild(link);
|
document.body.appendChild(link)
|
||||||
link.click();
|
link.click()
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link)
|
||||||
},
|
},
|
||||||
|
|
||||||
createFolder() {
|
createFolder() {
|
||||||
@@ -273,13 +306,13 @@ export default {
|
|||||||
console.log(event, data, node, target)
|
console.log(event, data, node, target)
|
||||||
|
|
||||||
this.showTreeMenu = true // 显示菜单
|
this.showTreeMenu = true // 显示菜单
|
||||||
this.currentNode = node;
|
this.currentNode = node
|
||||||
this.currentData = data;
|
this.currentData = data
|
||||||
this.del_id = 0;
|
this.del_id = 0
|
||||||
this.del_id = data.dept_id
|
this.del_id = data.dept_id
|
||||||
|
|
||||||
// 记录当前节点的层级
|
// 记录当前节点的层级
|
||||||
this.currentNodeLevel = node.level;
|
this.currentNodeLevel = node.level
|
||||||
|
|
||||||
document.querySelector('.treeMenu')
|
document.querySelector('.treeMenu')
|
||||||
.setAttribute('style', `top:${event.clientY + 10}px;left:${event.clientX + 10}px;`)
|
.setAttribute('style', `top:${event.clientY + 10}px;left:${event.clientX + 10}px;`)
|
||||||
@@ -306,9 +339,9 @@ export default {
|
|||||||
contract_url: this.editNode.contract_url,
|
contract_url: this.editNode.contract_url,
|
||||||
contract_des: this.editNode.contract_des,
|
contract_des: this.editNode.contract_des,
|
||||||
contract_file_name: this.fileName
|
contract_file_name: this.fileName
|
||||||
};
|
}
|
||||||
|
|
||||||
console.log(formData);
|
console.log(formData)
|
||||||
|
|
||||||
// 调用后端接口更新数据
|
// 调用后端接口更新数据
|
||||||
contract.UpdateContractInfo(formData).then(response => {
|
contract.UpdateContractInfo(formData).then(response => {
|
||||||
@@ -322,7 +355,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error('请求失败,请稍后重试')
|
this.$message.error('请求失败,请稍后重试')
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
update(row) {
|
update(row) {
|
||||||
@@ -340,10 +373,10 @@ export default {
|
|||||||
console.log(this.editNode)
|
console.log(this.editNode)
|
||||||
|
|
||||||
// 清空文件列表
|
// 清空文件列表
|
||||||
this.fileList = [];
|
this.fileList = []
|
||||||
|
|
||||||
const url = this.editNode.contract_url
|
const url = this.editNode.contract_url
|
||||||
const ext = url.split('.').pop().toLowerCase();
|
const ext = url.split('.').pop().toLowerCase()
|
||||||
|
|
||||||
if (ext === 'jpg' || ext === 'jpeg' || ext === 'png') {
|
if (ext === 'jpg' || ext === 'jpeg' || ext === 'png') {
|
||||||
this.isImage = true
|
this.isImage = true
|
||||||
@@ -379,20 +412,20 @@ export default {
|
|||||||
'jpg', 'jpeg', 'png', 'pdf',
|
'jpg', 'jpeg', 'png', 'pdf',
|
||||||
'pptx', 'xlsx', 'xls', 'docx',
|
'pptx', 'xlsx', 'xls', 'docx',
|
||||||
'doc', 'ppt', 'zip', 'rar'
|
'doc', 'ppt', 'zip', 'rar'
|
||||||
];
|
]
|
||||||
const extension = file.name.split('.').pop().toLowerCase();
|
const extension = file.name.split('.').pop().toLowerCase()
|
||||||
const isAllowed = allowedExtensions.includes(extension);
|
const isAllowed = allowedExtensions.includes(extension)
|
||||||
const isLt100M = file.size / 1024 / 1024 < 100;
|
const isLt100M = file.size / 1024 / 1024 < 100
|
||||||
|
|
||||||
if (!isAllowed) {
|
if (!isAllowed) {
|
||||||
this.$message.error('不支持的文件类型!');
|
this.$message.error('不支持的文件类型!')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
if (!isLt100M) {
|
if (!isLt100M) {
|
||||||
this.$message.error('文件大小不能超过100MB!');
|
this.$message.error('文件大小不能超过100MB!')
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
return true;
|
return true
|
||||||
},
|
},
|
||||||
|
|
||||||
showImg(row) {
|
showImg(row) {
|
||||||
@@ -422,7 +455,7 @@ export default {
|
|||||||
content: `<img src="${url}" alt="Preview" style="max-width: 100%; max-height: 100%;">`,
|
content: `<img src="${url}" alt="Preview" style="max-width: 100%; max-height: 100%;">`,
|
||||||
closable: true,
|
closable: true,
|
||||||
appendToBody: true
|
appendToBody: true
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
previewPDF(url) {
|
previewPDF(url) {
|
||||||
@@ -431,7 +464,7 @@ export default {
|
|||||||
content: `<iframe src="${url}" frameborder="0" style="width: 100%; height: 600px;"></iframe>`,
|
content: `<iframe src="${url}" frameborder="0" style="width: 100%; height: 600px;"></iframe>`,
|
||||||
closable: true,
|
closable: true,
|
||||||
appendToBody: true
|
appendToBody: true
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
get_contract_type_list() {
|
get_contract_type_list() {
|
||||||
@@ -441,76 +474,73 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
get_contract_info_list(type) {
|
get_contract_info_list(type) {
|
||||||
var param = { contract_type: type }
|
var param = { contract_type: type }
|
||||||
|
|
||||||
console.log(param);
|
console.log(param)
|
||||||
contract.GetOperationContractList(param).then(response => {
|
contract.GetOperationContractList(param).then(response => {
|
||||||
this.contract_info_list = response.data.data
|
this.contract_info_list = response.data.data
|
||||||
console.log(this.contract_info_list);
|
console.log(this.contract_info_list)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
handle_node_click(data, node) {
|
handle_node_click(data, node) {
|
||||||
this.currentNode = node;
|
this.currentNode = node
|
||||||
this.currentData = data;
|
this.currentData = data
|
||||||
this.del_id = 0
|
this.del_id = 0
|
||||||
this.del_id = data.type_id
|
this.del_id = data.type_id
|
||||||
this.closeTreeMenu();
|
this.closeTreeMenu()
|
||||||
// 记录当前节点的层级
|
// 记录当前节点的层级
|
||||||
this.currentNodeLevel = node.level;
|
this.currentNodeLevel = node.level
|
||||||
this.get_contract_info_list(data.type_id);
|
this.get_contract_info_list(data.type_id)
|
||||||
},
|
},
|
||||||
|
|
||||||
createBaseType() {
|
createBaseType() {
|
||||||
this.currentNode = null;
|
this.currentNode = null
|
||||||
this.currentData = null;
|
this.currentData = null
|
||||||
this.newNode.label = '';
|
this.newNode.label = ''
|
||||||
this.dialogVisibleCreateFolder = true;
|
this.dialogVisibleCreateFolder = true
|
||||||
},
|
},
|
||||||
|
|
||||||
openDialogForLevel1() {
|
openDialogForLevel1() {
|
||||||
this.currentNode = null;
|
this.currentNode = null
|
||||||
this.currentData = null;
|
this.currentData = null
|
||||||
this.newNode.label = '';
|
this.newNode.label = ''
|
||||||
this.dialogVisibleCreateFolder = true;
|
this.dialogVisibleCreateFolder = true
|
||||||
},
|
},
|
||||||
|
|
||||||
confirmAddFolder() {
|
confirmAddFolder() {
|
||||||
if (this.newNode.label.trim() === '') {
|
if (this.newNode.label.trim() === '') {
|
||||||
this.$message.warning('请输入类型名称');
|
this.$message.warning('请输入类型名称')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var type_id = 0;
|
var type_id = 0
|
||||||
var param = { type_id: type_id, type_name: this.newNode.label };
|
var param = { type_id: type_id, type_name: this.newNode.label }
|
||||||
if (this.currentData != null) {
|
if (this.currentData != null) {
|
||||||
const newChild = { id: this.id++, label: this.newNode.label, children: [] }
|
const newChild = { id: this.id++, label: this.newNode.label, children: [] }
|
||||||
if (!this.currentData.children) {
|
if (!this.currentData.children) {
|
||||||
this.$set(this.currentData, 'children', [])
|
this.$set(this.currentData, 'children', [])
|
||||||
}
|
}
|
||||||
this.currentData.children.push(newChild);
|
this.currentData.children.push(newChild)
|
||||||
type_id = this.currentData.type_id;
|
type_id = this.currentData.type_id
|
||||||
param = { type_id: type_id, type_name: newChild.label };
|
param = { type_id: type_id, type_name: newChild.label }
|
||||||
}
|
}
|
||||||
|
|
||||||
contract.AddContractType(param).then(response => {
|
contract.AddContractType(param).then(response => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '添加成功'
|
message: '添加成功'
|
||||||
});
|
})
|
||||||
this.get_contract_type_list();
|
this.get_contract_type_list()
|
||||||
});
|
})
|
||||||
this.dialogVisibleCreateFolder = false;
|
this.dialogVisibleCreateFolder = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
confirmAddContract() {
|
confirmAddContract() {
|
||||||
if (this.newNode3.contract_number.trim() === '' || this.newNode3.contract_name.trim() === '') {
|
if (this.newNode3.contract_number.trim() === '' || this.newNode3.contract_name.trim() === '') {
|
||||||
this.$message.warning('请输入合同编号和合同名称');
|
this.$message.warning('请输入合同编号和合同名称')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const newChild = {
|
const newChild = {
|
||||||
@@ -527,7 +557,7 @@ export default {
|
|||||||
if (!this.currentData.children) {
|
if (!this.currentData.children) {
|
||||||
this.$set(this.currentData, 'children', [])
|
this.$set(this.currentData, 'children', [])
|
||||||
}
|
}
|
||||||
this.currentData.children.push(newChild);
|
this.currentData.children.push(newChild)
|
||||||
|
|
||||||
var contract_type = this.currentData.type_id
|
var contract_type = this.currentData.type_id
|
||||||
var param = {
|
var param = {
|
||||||
@@ -540,24 +570,24 @@ export default {
|
|||||||
contract_url: newChild.contract_url,
|
contract_url: newChild.contract_url,
|
||||||
contract_des: newChild.contract_des,
|
contract_des: newChild.contract_des,
|
||||||
contract_file_name: this.fileName
|
contract_file_name: this.fileName
|
||||||
};
|
}
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
|
|
||||||
console.log(param);
|
console.log(param)
|
||||||
contract.AddContractInfo(param).then(response => {
|
contract.AddContractInfo(param).then(response => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '添加成功'
|
message: '添加成功'
|
||||||
});
|
})
|
||||||
// this.get_contract_type_list();
|
// this.get_contract_type_list();
|
||||||
this.get_contract_info_list(contract_type)
|
this.get_contract_info_list(contract_type)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: '添加失败,请重试' + error.toString()
|
message: '添加失败,请重试' + error.toString()
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
this.dialogVisibleCreateContract = false;
|
this.dialogVisibleCreateContract = false
|
||||||
},
|
},
|
||||||
|
|
||||||
remove(data) {
|
remove(data) {
|
||||||
@@ -566,7 +596,7 @@ export default {
|
|||||||
this.$message({
|
this.$message({
|
||||||
message: res.data.message,
|
message: res.data.message,
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
})
|
||||||
this.get_contract_type_list()
|
this.get_contract_type_list()
|
||||||
this.get_contract_info_list(data.data.type_id)
|
this.get_contract_info_list(data.data.type_id)
|
||||||
}
|
}
|
||||||
@@ -579,7 +609,7 @@ export default {
|
|||||||
this.$message({
|
this.$message({
|
||||||
message: res.data.message,
|
message: res.data.message,
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
})
|
||||||
this.get_contract_info_list(row.contract_type)
|
this.get_contract_info_list(row.contract_type)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -587,9 +617,9 @@ export default {
|
|||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: '已取消删除'
|
message: '已取消删除'
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user