<template>
	<fullscreen :fullscreen.sync="fullscreen" class="container">
		<div class="container-box">
			<toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
			<div class="search">
				<mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
				<div>
					<el-button class="btn-check" size="medium" type="primary" @click="dialogCheck(5)">合同信息管理
					</el-button>
					<el-button class="btn-check" size="medium" type="primary" @click="dialogCheck(6)">添加
					</el-button>
				</div>
			</div>
			<div class="tabbox">
				<el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
					tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
					<el-table-column prop="ledgerName" label="工单名称">
					</el-table-column>
					<el-table-column prop="opTime" label="创建时间">
					</el-table-column>
					<el-table-column prop="stsDesc" label="状态">
					</el-table-column>
					<el-table-column label="操作" width="180px" align="center">
						<template slot-scope="scope">
							<span style="margin:0 5px;">
								<el-button size="mini" type="primary" @click="dialogCheck(1,scope.row)">查看</el-button>
							</span>
							<span style="margin:0 5px;" v-if="scope.row.opNo == userInfo.loginNo">
								<el-button v-if="scope.row.sts == 3" size="mini" type="primary" @click="dialogCli(6,scope.row)">归档</el-button>
								<el-button v-if="scope.row.sts == 0 || scope.row.sts == 2" size="mini" type="primary" @click="dialogCheck(4,scope.row)">修改</el-button>
								<el-button v-if="scope.row.sts == 0 || scope.row.sts == 2" size="mini" type="danger" @click="delLine(scope.row)">删除</el-button>
							</span>
							<span style="margin:0 5px;" v-if="scope.row.secNo == userInfo.loginNo">
								<el-button v-if="scope.row.sts == 1" size="mini" type="danger" @click="dialogCheck(2,scope.row)">审核</el-button>
							</span>
						</template>
					</el-table-column>
				</el-table>
				<el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
					:total="total">
				</el-pagination>
			</div>
		</div>

		<el-dialog :title="titname + '服务质量考核及结算审批'" :visible.sync="dialogStatus" width="50%" :destroy-on-close="true"
			:modal-append-to-body="false" :close-on-click-modal="false" :before-close="closedia" :fullscreen="true">
			<div v-loading="loadinged">
				<el-form :model="infolist" ref="infolist" style="height: calc(100vh - 180px);overflow-y: scroll;">
					<el-form-item class="info-line online">
						<span>台账名称</span>
						<el-input v-model="infolist.ledgerName" :disabled="disableStatus"></el-input>
					</el-form-item>
					<div class="tit">基本信息</div>
					<div class="info-line">
						<el-form-item>
							<span>支撑方名称</span>
							<el-input v-model="infolist.factoryName" :disabled="disableStatus" placeholder="支撑方名称">
							</el-input>
						</el-form-item>
                        <el-form-item>
                        	<span>协议名称</span>
                        	<el-select :popper-append-to-body="false" clearable v-model="infolist.contractName" placeholder="协议名称" @change="choContra" :disabled="disableStatus">
                        	    <el-option v-for="items in suppOpt" :key="items.id" :label="items.contractName"
                        	        :value="items.id">
                        	    </el-option>
                        	</el-select>
                        </el-form-item>
						<el-form-item>
							<span>采购时段(开始)</span>
							<el-date-picker v-model="purchasePeriod1" type="date" placeholder="采购时段开始时间"
								:disabled="disableStatus">
							</el-date-picker>
						</el-form-item>
                        <el-form-item>
							<span>采购时段(结束)</span>
							<el-date-picker v-model="purchasePeriod2" type="date" placeholder="采购时段结束时间"
								:disabled="disableStatus">
							</el-date-picker>
						</el-form-item>
						<el-form-item>
							<span>协议时段(开始)</span>
							<el-date-picker v-model="treaTime1" type="date" placeholder="协议时段开始时间"
								:disabled="disableStatus">
							</el-date-picker>
						</el-form-item>
                        <el-form-item>
							<span>协议时段(结束)</span>
							<el-date-picker v-model="treaTime2" type="date" placeholder="协议时段结束时间"
								:disabled="disableStatus">
							</el-date-picker>
						</el-form-item>
                        <el-form-item>
                        	<span>协议编号</span>
                        	<el-input v-model="infolist.treatyNo" :disabled="disableStatus" placeholder="协议编号">
                        	</el-input>
                        </el-form-item>
						<el-form-item>
							<span>框架金额</span>
							<el-input v-model="infolist.frameMoney" :disabled="disableStatus" placeholder="框架金额">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>人天单价</span>
							<el-input v-model="infolist.unitPrice" :disabled="disableStatus" placeholder="人天单价">
							</el-input>
						</el-form-item>
					</div>
					<div style="padding-left: 100px" v-if="titname == '添加'||titname == '修改'">
						<myUpload @uploadBack="uploadBack1" :fileInfo="fileInfo1" :fileList="fileInfo1.fileList">
						</myUpload>
					</div>
					<div style="padding: 0 20px 0 100px;margin-bottom: 20px;"  v-if="titname == '查看'||titname == '审核'">
						<uploadDown :datalist="datalist1" :dialogStatus="uploadstatus"></uploadDown>
					</div>

					<div class="tit" style="margin-top: 20px;">工作量核定信息</div>
					<div class="info-line">
						<el-form-item>
							<span>评审工单名称</span>
							<el-input v-model="infolist.workName" :disabled="disableStatus" placeholder="评审工单名称">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>评审工单编号</span>
							<el-input v-model="infolist.workNo" :disabled="disableStatus" placeholder="评审工单编号">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>评审提交时间</span>
							<el-date-picker v-model="infolist.workSubTime" type="date" placeholder="评审提交时间"
								:disabled="disableStatus">
							</el-date-picker>
						</el-form-item>
						<el-form-item>
							<span>结果反馈时间</span>
							<el-date-picker v-model="infolist.workFeedTime" type="date" placeholder="结果反馈时间"
								:disabled="disableStatus">
							</el-date-picker>
						</el-form-item>
						<el-form-item>
							<span>报审量(人/天)</span>
							<el-input v-model="infolist.workAmount" :disabled="disableStatus" placeholder="报审量(人/天)">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>核减(人/天)</span>
							<el-input v-model="infolist.workCheck" :disabled="disableStatus" placeholder="核减(人/天)">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>有效(人/天)</span>
							<el-input v-model="infolist.workValid" :disabled="disableStatus" placeholder="有效(人/天)">
							</el-input>
						</el-form-item>
					</div>
					<div style="padding-left: 100px" v-if="titname == '添加'||titname == '修改'">
						<myUpload @uploadBack="uploadBack2" :fileInfo="fileInfo2" :fileList="fileInfo2.fileList">
						</myUpload>
					</div>
					<div style="padding: 0 20px 0 100px;margin-bottom: 20px;"  v-if="titname == '查看'||titname == '审核'">
						<uploadDown :datalist="datalist2" :dialogStatus="uploadstatus"></uploadDown>
					</div>

					<div class="tit" style="margin-top: 20px;">服务考核信息</div>
					<div class="info-line">
						<el-form-item>
							<span>会议纪要名称</span>
							<el-input v-model="infolist.serveName" :disabled="disableStatus" placeholder="会议纪要名称">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>会议纪要编号</span>
							<el-input v-model="infolist.serveNo" :disabled="disableStatus" placeholder="会议纪要编号">
							</el-input>
						</el-form-item>
					</div>
					<el-form-item class="info-line mouth">
						<span>服务评分</span>
						<el-input v-model="serveScore[0]" :disabled="disableStatus" placeholder="月份">
						</el-input>
						月
						<el-input v-model="serveScore[1]" :disabled="disableStatus"  style="margin-right:30px">
						</el-input>
						<el-input v-model="serveScore[2]" :disabled="disableStatus" placeholder="月份">
						</el-input>
						月
						<el-input v-model="serveScore[3]" :disabled="disableStatus"  style="margin-right:30px">
						</el-input>
						<el-input v-model="serveScore[4]" :disabled="disableStatus" placeholder="月份">
						</el-input>
						月
						<el-input v-model="serveScore[5]" :disabled="disableStatus"  style="margin-right:30px">
						</el-input>
					</el-form-item>
					<div class="info-line">
						<el-form-item>
							<span>平均得分</span>
							<el-input v-model="infolist.serveAveScore" :disabled="disableStatus" placeholder="平均得分">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>审批人员</span>
							<el-input v-model="infolist.serveAuditName" :disabled="disableStatus" placeholder="审批人员">
							</el-input>
						</el-form-item>
					</div>
					<div style="padding-left: 100px" v-if="titname == '添加'||titname == '修改'">
						<myUpload @uploadBack="uploadBack3" :fileInfo="fileInfo3" :fileList="fileInfo3.fileList">
						</myUpload>
					</div>
					<div style="padding: 0 20px 0 100px;margin-bottom: 20px;"  v-if="titname == '查看'||titname == '审核'">
						<uploadDown :datalist="datalist3" :dialogStatus="uploadstatus"></uploadDown>
					</div>

					<div class="tit" style="margin-top: 20px;">补充协议信息</div>
					<div class="info-line">
						<el-form-item>
							<span>协议名称</span>
							<el-input v-model="infolist.dealName" :disabled="disableStatus" placeholder="协议名称">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>签署时间</span>
							<el-date-picker v-model="infolist.dealTime" type="date" placeholder="签署时间"
								:disabled="disableStatus">
							</el-date-picker>
						</el-form-item>
						<el-form-item>
							<span>协议编号</span>
							<el-input v-model="infolist.dealNo" :disabled="disableStatus" placeholder="协议编号">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>支付金额</span>
							<el-input v-model="infolist.dealPay" :disabled="disableStatus" placeholder="支付金额">
							</el-input>
						</el-form-item>
						<el-form-item>
							<span>剩余预算</span>
							<el-input v-model="infolist.dealSurplus" :disabled="disableStatus" placeholder="剩余预算">
							</el-input>
						</el-form-item>
					</div>
					<div style="padding-left: 100px" v-if="titname == '添加'||titname == '修改'">
						<myUpload @uploadBack="uploadBack4" :fileInfo="fileInfo4" :fileList="fileInfo4.fileList">
						</myUpload>
					</div>
					<div style="padding: 0 20px 0 100px;margin-bottom: 20px;"  v-if="titname == '查看'||titname == '审核'">
						<uploadDown :datalist="datalist4" :dialogStatus="uploadstatus"></uploadDown>
					</div>

				</el-form>

				<div slot="footer" class="dialog-footer myfooter">
					<el-button type="primary" @click="dialogCli(2)" v-if="titname === '审核'">通 过
					</el-button>
					<el-button type="primary" @click="dialogCli(3)" v-if="titname === '审核'">打 回
					</el-button>
					<el-button type="primary" @click="checkexa = true" v-if="titname === '修改'||titname === '添加'">发 布
					</el-button>
					<el-button type="primary" @click="dialogCli(5)" v-if="titname === '修改'||titname === '添加'">草 稿
					</el-button>
					<el-button @click="dialogCli(1)" v-if="titname === '查看'">确 定</el-button>
					<el-button @click="dialogCli(1)">取 消</el-button>
				</div>
			</div>
		</el-dialog>

        <el-dialog title="选择审批人" :visible.sync="checkexa" width="50%" :destroy-on-close="true"
        	:modal-append-to-body="false" :close-on-click-modal="false">
        	<div>

        		<el-form :model="infolist" ref="infolist">
        			<el-form-item prop="visiblec" class="info-line online">
        				<span>审批人员</span>
        				<deptTreeOnly class="tree" @treeCheck="treeCheckonly" :defaultList="defaultList"
        					:type="depttype" :closeList="closeList"></deptTreeOnly>
        				<div class="tree treeUser">
        					<p>{{treeListonly.leaderAuditName}}
        						<i v-if="treeListonly.leaderAuditName" @click="deletes()"
        							class="el-icon-error"></i>
        					</p>
        				</div>
        			</el-form-item>
        		</el-form>

        		<div slot="footer" style="text-align: right;padding-bottom: 20px;">
        			<el-button type="primary" @click="dialogCli(4)">确 定</el-button>
        			<el-button @click="checkexa = false">取 消</el-button>
        		</div>
        	</div>
        </el-dialog>

		<myMessage :messTit='messTit' @closeMessage="closeMessage" :centerDialogVisible="centerDialogVisible"
			v-if="centerDialogVisible"></myMessage>
	</fullscreen>

</template>
<script>
	import mySearch from "../../../components/search.vue";
	import myMessage from "../../../components/myMessage.vue"
	import toolList from '../../../components/toolList'
	import myUpload from "../../../components/upload.vue";
	import uploadDown from "../../../components/uploadDown.vue";
	import deptTreeOnly from "../../../components/deptTreeOnly.vue"

	export default {
		components: {
			mySearch,
			myMessage,
			toolList,
			myUpload,
			uploadDown,
			deptTreeOnly
		},
		data() {
			return {
				searchList: [{
					type: 'input',
					tit: '合同名称',
					value: '',
					width: '24%',
				}, {
					type: 'input',
					tit: '台账名称',
					value: '',
					width: '24%',
				}, {
					type: 'date',
					tit: '开始时间',
					value: '',
					width: '24%',
				}, {
					type: 'date',
					tit: '结束时间',
					value: '',
					width: '24%',
				}, ],
				tooltit: '服务质量考核及结算审批',
				fullscreen: false,
				total: 0,
				pageSize: 1,
				tableData: [],
				dialogStatus: false,
				disableStatus: false,
				titname: '',
                purchasePeriod1:'',
                purchasePeriod2:'',
                treaTime1:'',
                treaTime2:'',
				infolist: {
					factoryName:'',
					treatyNo:'',
					frameMoney:'',
					unitPrice:'',
				},
				userInfo: {},
				params: {},
				centerDialogVisible: false,
				messTit: '',
				delid: '',
				loading: false,
				loadinged: false,
				attList1: [],
				attList2: [],
				attList3: [],
				attList4: [],
				fileInfo1: {
					url: '/market/cmkAttachInfo/upload?uploadType=area1',
					fileList: []
				},
				fileInfo2: {
					url: '/market/cmkAttachInfo/upload?uploadType=area2',
					fileList: []
				},
				fileInfo3: {
					url: '/market/cmkAttachInfo/upload?uploadType=area3',
					fileList: []
				},
				fileInfo4: {
					url: '/market/cmkAttachInfo/upload?uploadType=area4',
					fileList: []
				},
				datalist1: {
					url: '/market/compatt/downfile',
					type: 1,
                    attList:[]
				},
				datalist2: {
					url: '/market/compatt/downfile',
					type: 1,
                    attList:[]
				},
				datalist3: {
					url: '/market/compatt/downfile',
					type: 1,
                    attList:[]
				},
				datalist4: {
					url: '/market/compatt/downfile',
					type: 1,
                    attList:[]
				},
				uploadstatus: false,//文件状态
				suppOpt: [],
				serveScore: [],
                checkexa: false,
                treeListonly: {},
                defaultList: [],
                closeList: false,
                visionchonly: false,
                depttype: 0,
			}
		},
		methods: {
            deletes() {
            	this.treeListonly = {};
            	this.closeList = !this.closeList;
            },
            treeCheckonly(v) {
            	this.treeListonly = v;
            },
			//选择合同
			choContra(v){
				for (let i = 0; i < this.suppOpt.length; i++) {
					if(this.suppOpt[i].id == v){
						this.infolist.contractName = this.suppOpt[i].contractName;
						this.infolist.treatyNo = this.suppOpt[i].treatyNo;
						this.infolist.factoryName = this.suppOpt[i].factoryName;
						this.infolist.frameMoney = this.suppOpt[i].frameMoney;
						this.infolist.unitPrice = this.suppOpt[i].unitPrice;
						this.treaTime1 = this.suppOpt[i].treaTime.split('~')[0];
						this.treaTime2 = this.suppOpt[i].treaTime.split('~')[1];
						this.purchasePeriod1 = this.suppOpt[i].purchasePeriod.split('~')[0];
						this.purchasePeriod2 = this.suppOpt[i].purchasePeriod.split('~')[1];
					}
				}
			},
			closedia() {
				this.infolist = {
					factoryName:'',
					treatyNo:'',
					frameMoney:'',
					unitPrice:'',
				};
                this.purchasePeriod1='';
                this.purchasePeriod2='';
                this.treaTime1='';
                this.treaTime2='';
				this.dialogStatus = false;
				this.uploadstatus = false;
				this.checkexa = false;
			},
			//搜索数据
			searchInfo(v) {
				this.params = {};
				v[0] ? this.params.contractName = v[0] : '';
				v[1] ? this.params.ledgerName = v[1] : '';
				v[2] ? this.params.opTimeFrom =  this.$formatDate(v[2] , "YYYY-MM-DD") : '';
				v[3] ? this.params.opTimeTo = this.$formatDate(v[3] , "YYYY-MM-DD") : '';
				this.getList(this.params, this.pageSize);
			},
			//获取列表
			getList(v, n) {
				this.pageSize = n;
				let _this = this;
				this.loading = true;
				this.tableData = [];
				this.$http({
					url: "/market/cChannelBusi/queryPage",
					method: "post",
					headers: {
						"Content-Type": "application/json",
						"page": '{"pageNo":"' + n + '","pageSize":"10"}'
					},
					data: v,
				}).then((res) => {
					this.tableData = res.data.data;
					this.total = res.data.totalRecord;
					this.loading = false;
				});
			},
			// 分页
			currchange(v) {
				this.pageSize = v;
				this.getList(this.params, this.pageSize);
			},
			//申请
			dialogCheck(v, n) {
				let _this = this;
				this.dialogStatus = true;
				this.infolist = Object.assign({}, n);
				this.disableStatus = false;
				this.infolist.opTime =  this.$formatDate(new Date(), 'YYYY-MM-DD HH:mm:ss')
				if (v === 1) {
					this.titname = '查看';
					this.disableStatus = true;
				} else if (v === 2) { //审核
					this.titname = '审核';
				} else if (v === 3) { //归档
					this.titname = '归档';
				} else if (v === 4) { //修改
					this.titname = '修改';
				} else if (v === 6) { //添加
					this.titname = '添加';
					this.infolist = {
						factoryName:'',
						treatyNo:'',
						frameMoney:'',
						unitPrice:'',
					}
					return
				} else if (v == 5) {
					_this.$router.push({
						path: '/contractInfo',
					});
					_this.setabList('合同信息管理', '/contractInfo');
					return
				}
				this.$http({
					url: "/market/cChannelBusi/queryInfo",
					method: "post",
					headers: {
						"Content-Type": "application/json",
					},
					data: {id:n.id},
				}).then((res) => {
					this.uploadstatus = true;
					this.attList1 = [];
					this.fileInfo1.fileList = [];
					this.attList2 = [];
					this.fileInfo2.fileList = [];
					this.attList3 = [];
					this.fileInfo3.fileList = [];
					this.attList4 = [];
					this.fileInfo4.fileList = [];

                    this.datalist1.attList = [];
                    this.datalist2.attList = [];
                    this.datalist3.attList = [];
                    this.datalist4.attList = [];

					this.datalist1.attList = res.data.attList1;
					this.datalist2.attList = res.data.attList2;
					this.datalist3.attList = res.data.attList3;
					this.datalist4.attList = res.data.attList4;
					res.data.attList1.forEach(item => {
						this.fileInfo1.fileList.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
						this.attList1.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
					})
					this.datalist2.attList.forEach(item => {
						this.fileInfo2.fileList.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
						this.attList2.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
					})
					this.datalist3.attList.forEach(item => {
						this.fileInfo3.fileList.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
						this.attList3.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
					})
					this.datalist4.attList.forEach(item => {
						this.fileInfo4.fileList.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
						this.attList4.push({
							name: item.fileName,
							url: '',
							id: item.id,
							attchFileId: item.attchFileId,
							fileName: item.fileName
						});
					})
				});
				if(this.infolist.treaTime){
					this.treaTime1 = this.infolist.treaTime.split('~')[0];
					this.treaTime2 = this.infolist.treaTime.split('~')[1];
				}
				if(this.infolist.purchasePeriod){
					this.purchasePeriod1 = this.infolist.purchasePeriod.split('~')[0];
					this.purchasePeriod2 = this.infolist.purchasePeriod.split('~')[1];
				}
				if(this.infolist.serveScore){
					let serveScore1 = this.infolist.serveScore.split(';')[0];
					let serveScore2 = this.infolist.serveScore.split(';')[1];
					let serveScore3 = this.infolist.serveScore.split(';')[2];
					this.serveScore = [serveScore1.split(',')[0],serveScore1.split(',')[1],serveScore2.split(',')[0],serveScore2.split(',')[1],serveScore3.split(',')[0],serveScore3.split(',')[1]];
				}
			},
			setabList(n, p) {
				let params = {
					children: "",
					name: n,
					rountPath: p,
					target: "_self",
				};
				for (let i = 0; i < this.$store.state.tabList.length; i++) {
					if (this.$store.state.tabList[i].name === params.name) {
						this.$store.state.tabList[i] = params;
					}
				}
				let set = new Set([...this.$store.state.tabList, params]);
				set.add(params);
				this.$store.commit("setDefaultActive", params.rountPath);
				this.$store.commit("setTabList", Array.from(set));
			},
			//添加
			dialogCli(v,n) {
				this.uploadstatus = false;
				if (v == 1) {
					this.infolist = {
						factoryName:'',

						treatyNo:'',

						frameMoney:'',
						unitPrice:'',
					};
                    this.purchasePeriod1='';
                    this.purchasePeriod2='';
                    this.treaTime1='';
                    this.treaTime2='';
					this.dialogStatus = false;
					this.serveScore = [];
					this.attList1 = [];
					this.fileInfo1.fileList = [];
					this.attList2 = [];
					this.fileInfo2.fileList = [];
					this.attList3 = [];
					this.fileInfo3.fileList = [];
					this.attList4 = [];
					this.fileInfo4.fileList = [];
                    this.checkexa = false;
					return
				}
				// 0 草稿;1审核中;2未通过;3通过;4办结
				let info = this.infolist;
				info.attList1 = this.attList1;
				info.attList2 = this.attList2;
				info.attList3 = this.attList3;
				info.attList4 = this.attList4;
				info.workSubTime =  info.workSubTime?this.$formatDate(info.workSubTime, 'YYYY-MM-DD'):'';
				info.dealTime =  info.dealTime?this.$formatDate(info.dealTime, 'YYYY-MM-DD'):'';
				info.workFeedTime =  info.workFeedTime?this.$formatDate(info.workFeedTime, 'YYYY-MM-DD'):'';
				let t1 = this.purchasePeriod1?this.$formatDate(this.purchasePeriod1, "YYYY-MM-DD"):'';
				let t2 = this.purchasePeriod2?this.$formatDate(this.purchasePeriod2, "YYYY-MM-DD"):'';
				info.purchasePeriod = t1 + '~' + t2;
				let t3 = this.treaTime1?this.$formatDate(this.treaTime1, "YYYY-MM-DD"):'';
				let t4 = this.treaTime2?this.$formatDate(this.treaTime2, "YYYY-MM-DD"):'';
				info.treaTime = t3+ '~' +t4;
				info.serveScore = this.serveScore[0]+','+this.serveScore[1]+';'+this.serveScore[2]+','+this.serveScore[3]+';'+this.serveScore[4]+','+this.serveScore[5]+';';
				if (v == 2) { //通过
					let param = {};
					param.sts = "3";
					param.stsDesc = "通过";
					param.id = info.id;
					this.submitInfo("/market/cChannelBusi/update", param);
				}
				if (v == 3) { //打回
				let param = {};
					param.sts = "2";
					param.stsDesc = "打回";
					param.id = info.id;
					this.submitInfo("/market/cChannelBusi/update", param);
				}
				if (v == 4) { //发布
					info.sts = "1";
					info.stsDesc = "待审核";
					info.secNo = this.treeListonly.leaderAuditNo;
					info.secName = this.treeListonly.leaderAuditName;
					if(info.id){
						this.submitInfo("/market/cChannelBusi/update", info);
					}else{
						this.submitInfo("/market/cChannelBusi/add", info);
					}
				}
				if (v == 5) { //草稿
					info.sts = "0";
					info.stsDesc = "草稿";
					if(info.id){
						this.submitInfo("/market/cChannelBusi/update", info);
					}else{
						this.submitInfo("/market/cChannelBusi/add", info);
					}
				}
				if (v == 6) { //归档
					let param = {};
					param.sts = "4";
					param.id = n.id;
					param.stsDesc = "归档";
					this.submitInfo("/market/cChannelBusi/update", param);
				}
			},
			submitInfo(u, v) {
				let _this = this;
				this.loadinged = true;
				this.$http({
					url: u,
					method: "post",
					headers: {
						"Content-Type": "application/json",
					},
					data: v,
				}).then((res) => {
					this.loadinged = false;
					if (res.data.result === 1) {
						_this.$message({
							message: res.data.desc,
							type: 'error'
						});
					} else {
						_this.$message({
							message: '成功',
							type: 'success'
						});
						_this.infolist = {
							factoryName:'',
							treatyNo:'',
							frameMoney:'',
							unitPrice:'',
						};
                        _this.purchasePeriod1='';
                        _this.purchasePeriod2='';
                        _this.treaTime1='';
                        _this.treaTime2='';
						_this.dialogStatus = false;
						_this.attList1 = [];
						_this.fileInfo1.fileList = [];
						_this.attList2 = [];
						_this.fileInfo2.fileList = [];
						_this.attList3 = [];
						_this.fileInfo3.fileList = [];
						_this.attList4 = [];
						_this.fileInfo4.fileList = [];
                        _this.checkexa = false;
						_this.getList({}, _this.pageSize);
					}

				});
			},
			closeMessage(v) {
				this.centerDialogVisible = false;
				let _this = this;
				if (v === 1) {
					_this.$http({
						url: "/market/cChannelBusi/del",
						method: "post",
						headers: {
							"Content-Type": "application/json",
						},
						data: {
							id: this.delid
						},
					}).then((res) => {
						if (res.data.result === 1) {
							_this.$message({
								message: res.data.desc,
								type: 'error'
							});
						} else {
							_this.$message({
								message: '删除成功',
								type: 'success'
							});
							_this.getList(this.params, this.pageSize);
						}
					});
				}
			},
			//删除
			delLine(v) {
				this.centerDialogVisible = true;
				this.messTit = '即将删除此条数据, 是否删除?';
				this.delid = v.id;
			},
			//文件返回值
			uploadBack1(v) {
				this.attList1 = v;
			},
			uploadBack2(v) {
				this.attList2 = v;
			},
			uploadBack3(v) {
				this.attList3 = v;
			},
			uploadBack4(v) {
				this.attList4 = v;
			},
			//功能栏
			iconCli(v) {
				if (v === 1) {
					this.getList(this.params, this.pageSize);
				}
				if (v === 2) {
					this.fullscreen = !this.fullscreen
				}
			},
			getUser() {
				this.userInfo = JSON.parse(window.sessionStorage.userInfo);

				this.$http({
					url: "/market/cChannelContract/queryList",
					method: "post",
					headers: {
						"Content-Type": "application/json",
						"page": '{"pageNo":"' + 1 + '","pageSize":"1000"}'
					},
					data: {},
				}).then((res) => {
					this.suppOpt = res.data;
				});

			}
		},
		mounted() {
			this.getList({}, 1);
			this.getUser();
		},
		created() {

		}
	}
</script>
<style scoped lang="scss">
	.tit {
		font-size: 20px;
		margin-bottom: 20px;
	}

	.compListree {
		width: 100% !important;

		span {
			width: 100% !important;
			display: inline-block;
			padding: 10px 0;

			em {
				width: 120px;
				display: inline-block;
				font-style: normal;
			}

			.el-select {
				width: calc(100% - 120px)
			}
		}
	}

	.onetab {
		margin-bottom: 20px;
		padding: 0 20px;
	}

	.titbox {
		div {
			float: right;

			i {
				font-size: 22px;
				margin-left: 20px;
				cursor: pointer;
			}
		}
	}

	.tabbox {
		margin-top: 15px;
	}

	.pageBox {
		text-align: right;
		margin-top: 10px;
	}

	.info-line {
		width: 100%;
		display: block;
		padding-left: 20px;

		div {
			width: 50%;
			display: inline-block;
		}

		span {
			width: 100px;
			display: inline-block;
			text-align: left;

			i {
				color: red;
				display: inline-block;
				padding-right: 5px;
			}
		}

		.el-select,
		.el-input {
			width: calc(100% - 120px);
		}
	}
	.mouth{
		.el-input {
			width: 95px;
		}
	}
	.online {
		width: 100%;

		.el-select {
			width: calc(100% - 100px);
		}

		span {
			vertical-align: top;
		}

		.el-textarea {
			width: calc(100% - 100px);
		}

		.tree {
			width: calc(50% - 60px);
			display: inline-block;
			margin-right: 20px;
			height: 300px;
			overflow-y: scroll;

			.el-icon-error {
				float: right;
				font-size: 20px;
				margin-top: 9px;
				cursor: pointer;
			}
		}

		.treeUser {
			margin: 0;
			border: 1px solid #ddd;

			p {
				background: #f4f4f4;
				padding: 0 20px;
				margin-bottom: 5px;
			}
		}
	}
    .online {
    	width: 100%;

    	.el-select {
    		width: calc(100% - 100px);
    	}

    	span {
    		vertical-align: top;
    	}

    	.el-textarea {
    		width: calc(100% - 120px);
    	}

    	.tree {
    		width: calc(50% - 60px);
    		display: inline-block;
    		margin-right: 20px;
    		height: 300px;
    		overflow-y: scroll;

    		.el-icon-error {
    			float: right;
    			font-size: 20px;
    			margin-top: 9px;
    			cursor: pointer;
    		}
    	}

    	.treeUser {
    		margin: 0;
    		border: 1px solid #ddd;

    		p {
    			background: #f4f4f4;
    			padding: 0 20px;
    			margin-bottom: 5px;
    		}
    	}

    	.treeUserb {
    	    width: calc(100% - 100px);
    	    border: 1px solid #ddd;
    	    background: #f4f4f4;
    	    border-radius: 3px;
    	    height: auto;
    	    overflow: hidden;

    	    p {
    	        display: inline-block;
    	        padding: 0 20px;
    	        margin-bottom: 5px;
    	    }
    	}
    }
</style>
