<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
  <div>
    <el-dialog
      :title="title"
      :close-on-click-modal="false"
	  draggable
      width="1200px"
      height="500px"
      @close="close"
      append-to-body
      v-model="visible">
    <el-row>
      <el-col :span="24">
        <el-tabs v-model="activeNameTop" type="border-card" @tab-click="tabHandleClickTop">
          <el-tab-pane label="项目信息" name="project" style="width: 100%;">
            <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method === 'view'"
                     label-width="135px" @submit.native.prevent>
              <el-row  :gutter="15">
                <el-col :span="24">
                  <el-form-item label="合同名称" prop="contractName"
                                :rules="[
                 ]">
                    <el-input :readonly="true" v-model="inputForm.contractName" placeholder="请选择合同"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="合同金额(元)" prop="contractAmount"
                                :rules="[
                 ]">
                    <el-input :disabled="true" v-model="inputForm.contractAmount" placeholder="请填写合同金额"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="委托人" prop="clientContactsName"
                                :rules="[
                 ]">
                    <el-input :disabled="true" v-model="inputForm.clientContactsName" placeholder="请填写委托人"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="付款主体" prop="payerSubject"
                                :rules="[
                 ]">
                    <el-select :disabled="true" v-model="inputForm.payerSubject" placeholder="请选择付款主体" style="width:100%;">
                      <el-option
                        v-for="item in $dictUtils.getDictList('cw_payment_subject')"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="付款方式" prop="paymentMethod"
                                :rules="[
                 ]">
                    <el-select :disabled="true" v-model="inputForm.paymentMethod" placeholder="请选择付款方式" style="width:100%;">
                      <el-option
                        v-for="item in $dictUtils.getDictList('cw_payment_method')"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-divider content-position="left"><i class="el-icon-document"></i> 项目信息</el-divider>
              <el-row  :gutter="15">
                <el-col :span="12">
                  <el-form-item label="项目名称" prop="projectName"
                                :rules="[
                                {required: true, message:'项目名称不能为空', trigger:'blur'}
                   ]">
                    <el-input v-model="inputForm.projectName" placeholder="请填写项目名称" clearable></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="项目编号" prop="projectNumber"
                                :rules="[
                   ]">
                    <el-input :disabled="true" v-model="inputForm.projectNumber" placeholder="请填写项目编号" ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="项目所属部门" prop="officeId"
                                :rules="[
                                {required: true, message:'项目所属部门不能为空', trigger:'blur'}
                   ]">
                    <SelectTree
                      ref="officeTree"
                      :props="{
                          value: 'id',             // ID字段名
                          label: 'name',         // 显示名称
                          children: 'children'    // 子级字段名
                        }"
                      :url="`/system-server/sys/office/treeData?type=2`"
                      :value="inputForm.officeId"
                      :accordion="true"
                      size="default"
                      @getValue="(value) => {inputForm.officeId=value}"/>
                  </el-form-item>
                </el-col>
<!--                <el-col :span="12">-->
<!--                  <el-form-item label="业务类型" prop="businessTypeName"-->
<!--                                :rules="[-->
<!--                   ]">-->
<!--                    <el-input :readonly="true" @focus="openBusinessTypeForm" v-model="inputForm.businessTypeName" placeholder="请填写业务类型" clearable></el-input>-->
<!--                  </el-form-item>-->
<!--                </el-col>-->
                <el-col :span="12">
                  <el-form-item label="风险等级" prop="riskLevel"
                                :rules="[
                   ]">
                    <el-select v-model="inputForm.riskLevel" placeholder="请选择风险等级" style="width:100%;">
                      <el-option
                        v-for="item in $dictUtils.getDictList('cw_project_risk_level')"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
				  <el-col :span="12">
					  <el-form-item label="项目等级" prop="projectLevel"
									:rules="[
                  {required: true, message:'请选择项目等级(500万及500万以上为A级，500万以下为B级)', trigger:'blur'}
               ]">
						  <el-radio-group v-model="inputForm.projectLevel">
							  <el-radio v-for="item in $dictUtils.getDictList('cw_project_level')" :label="item.value" >{{item.label}}</el-radio>
						  </el-radio-group>
					  </el-form-item>
				  </el-col>
                <el-col :span="12">
                  <el-form-item label="项目规模(元)" prop="projectMoney"
                                :rules="[
                                	{required: true, message:'项目规模不能为空', trigger:'blur'}
                   ]">
                    <el-input-number
                      v-model="inputForm.projectMoney"
                      controls-position="right"
                      style="width:100%"
                      :precision="2"
                      :max="9999999999"
                      :step="0.01"
                      :min="0"
                      placeholder="请填写项目规模"
                      :controls="false"
                    >
                    </el-input-number>
                  </el-form-item>
                </el-col>
                <el-col :span="12" v-if="inputForm.projectType === '1'">
                  <el-form-item label="项目类别" prop="reportType"
                                :rules="[
                                 {required: true, message:'项目类别不能为空', trigger:'blur'}
                  ]">
                    <el-select v-model="inputForm.reportType" placeholder="请选择项目类别" clearable style="width: 100%;">
                      <el-option
                        v-for="item in $dictUtils.getDictList('program_cost_audit_type')"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
				  <el-col :span="12" v-else>
                  <el-form-item label="项目类别" prop="reportType"
                                :rules="[
                                 {required: true, message:'项目类别不能为空', trigger:'blur'}
                  ]">
                    <el-select v-model="inputForm.reportType" placeholder="请选择项目类别" clearable style="width: 100%;">
                      <el-option
                        v-for="item in $dictUtils.getDictList('program_engineering_consultation_type')"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <!--<el-col :span="12">
                  <el-form-item label="审计期间" prop="auditYear"
                                :rules="[
                   ]">
                    <el-date-picker
                      v-model="inputForm.auditYear"
                      type="year"
                      value-format="YYYY"
                      placeholder="选择评审计期间"
                      style="width:100%"
                      placement="bottom-start"
                    >
                    </el-date-picker>
                  </el-form-item>
                </el-col>-->
                <el-col :span="12">
                  <el-form-item label="项目预计时间" prop="planDate"
                                :rules="[
                                {required: true, message:'项目预计时间不能为空', trigger:'blur'}
                   ]">
                    <el-date-picker
                      style="width: 100%"
                      placement="bottom-start"
					  format="YYYY-MM-DD h:m:s"
					  value-format="YYYY-MM-DD h:m:s"
                      v-model="inputForm.planDate"
                      type="datetimerange"
                      range-separator="至"
                      start-placeholder="开始日期"
                      @change="forUpdate"
                      end-placeholder="结束日期">
                    </el-date-picker>
                  </el-form-item>
                </el-col>

                <el-col :span="12">
                  <el-form-item label="现场负责人" prop="projectLeaderId"
                                :rules="[
                   ]">
					  <UserSelectForQualification :readonly="true" :disabled="method === 'view'" :limit='1' :modelValue="inputForm.projectLeaderId" @update:modelValue='(value) => {inputForm.projectLeaderId = value}'></UserSelectForQualification>
<!--                    <UserSelect :readonly="true" :disabled="method === 'view'" :limit='1' :modleValue="inputForm.projectLeaderId" @update:modelValue='(value) => {inputForm.projectLeaderId = value}'></UserSelect>-->
                  </el-form-item>
                </el-col>
				  <el-col :span="12">
					  <el-form-item label="工程类型" prop="engineeringType"
									:rules="[
                                 {required: true, message:'工程类型不能为空', trigger:'blur'}
                  ]">
						  <el-tree-select
							  v-model="inputForm.engineeringType"
							  :data="engineeringTypeList"
							  :render-after-expand="false"
							  style="width: 100%"
						  />
					  </el-form-item>
				  </el-col>
                <el-col :span="12">
                  <el-form-item label="项目经理1" prop="projectMasterId"
                                :rules="[
                                {required: true, message:'项目经理1不能为空', trigger:'blur'}
                   ]">
                    <!--                    <el-input v-model="inputForm.projectMasterId" placeholder="请填写项目经理" clearable></el-input>-->
<!--                    <UserSelectForQualification :readonly="true" :disabled="method === 'view'" :limit='1' :modelValue="inputForm.projectMasterId" @update:modelValue='(value) => {inputForm.projectMasterId = value}'></UserSelectForQualification>-->
					  <UserSelectSignatory :readonly="true" :disabled="status === 'audit' || status === 'taskFormDetail'"
										   :limit='1' :modelValue="inputForm.projectMasterId"
										   @update:modelValue='(value) => {inputForm.projectMasterId = value}'></UserSelectSignatory>
				  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="项目经理2" prop="realHeader"
                                :rules="[
                   ]">
<!--                    <UserSelectForQualification :readonly="true" :disabled="method === 'view'" :limit='1' :modelValue="inputForm.realHeader" @update:modelValue='(value) => {inputForm.realHeader = value}'></UserSelectForQualification>-->
					  <UserSelectSignatory :readonly="true" :disabled="status === 'audit' || status === 'taskFormDetail'"
										   :limit='1' :modelValue="inputForm.realHeader"
										   @update:modelValue='(value) => {inputForm.realHeader = value}'></UserSelectSignatory>
				  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="创建人" prop="createBy.name"
                                :rules="[
                   ]">
                    <el-input :disabled="true" v-model="inputForm.createBy.name" placeholder="请填写创建人" clearable></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="创建时间" prop="createDate"
                                :rules="[
                   ]">
                    <el-input :disabled="true" v-model="inputForm.createDate" placeholder="请填写创建时间" clearable></el-input>
                  </el-form-item>
                </el-col>
				  <el-col :span="12">
					  <el-form-item label="项目开始时间" prop="projectStartTime"
									:rules="[
                   ]">
						  <el-date-picker
							  v-model="inputForm.projectStartTime"
							  type="date"
							  value-format="YYYY-MM-DD"
							  placeholder="选择项目开始时间"
							  style="width:100%"
							  placement="bottom-start"
							  clearable>
						  </el-date-picker>
					  </el-form-item>
				  </el-col>
				  <el-col :span="12">
					  <el-form-item label="项目结束时间" prop="projectEndTime"
									:rules="[
                   ]">
						  <el-date-picker
							  v-model="inputForm.projectEndTime"
							  type="date"
							  value-format="YYYY-MM-DD"
							  placeholder="选择项目结束时间"
							  style="width:100%"
							  placement="bottom-start"
							  clearable>
						  </el-date-picker>
					  </el-form-item>
				  </el-col>
              </el-row>
            </el-form>
            <el-tabs v-model="activeName" style="width: 100%;" type="border-card" @tab-click="tabHandleClick">
              <el-tab-pane name="client">
				  <template v-slot:label>
					  <span><span style="color: red;border-top: 20px">*</span> 被服务单位</span>
				  </template>
                <el-row :gutter="15">
                  <el-button type="primary" style="margin-bottom: 15px" :disabled="method === 'view'" @click="openWorkClient">
                    新增被服务单位
                  </el-button>
                </el-row>
				  <el-row  :gutter="15">
					  <el-form :disabled="method === 'view'" style="width: 100%;">
						  <vxe-table
							  border
							  show-overflow
							  show-footer
							  :column-config="{resizable: true}"
							  ref="clientTable"
							  :key="tableKeyClient"
							  class="vxe-table-element"
							  :data="inputForm.cwProjectClientInfoDTOList"
							  style=""
							  keep-source
							  highlight-current-row
						  >
							  <vxe-table-column align="center" field="name" title="客户名称" :edit-render="{}" show-overflow="title"></vxe-table-column>
							  <vxe-table-column align="center" field="no" title="客户编号" :edit-render="{}" show-overflow="title"></vxe-table-column>
							  <vxe-table-column align="center" title="操作" width="100">
								  <template #default="scope">
									  <el-button type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
								  </template>
							  </vxe-table-column>
						  </vxe-table>
					  </el-form>
				  </el-row>
              </el-tab-pane>
              <el-tab-pane name="contact">
				  <template v-slot:label>
					  <span><span style="color: red;border-top: 20px">*</span> 客户联系人</span>
				  </template>
                <el-row :gutter="15">
                  <el-button type="primary" style="margin-bottom: 15px" :disabled="method === 'view'" @click="insertEvent('contact')">
                    新增客户联系人
                  </el-button>
                </el-row>
				  <el-row  :gutter="15">
					  <el-form :disabled="method === 'view'" style="width: 100%;">
						  <vxe-table
							  border
							  show-overflow
							  show-footer
							  :column-config="{resizable: true}"
							  ref="contactTable"
							  :key="tableKeyContact"
							  class="vxe-table-element"
							  :data="inputForm.cwProjectClientContactDTOList"
							  style=""
							  keep-source
							  highlight-current-row
							  :edit-rules="validContactRules"
						  >
							  <vxe-table-column align="center" min-width="110" field="name" title="姓名" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input v-model="scope.row.name" placeholder="姓名" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="sex" title="性别" :edit-render="{name: '$select', options: $dictUtils.getDictList('sex')}">
								  <template #default="scope">
									  <vxe-select :disabled="method === 'view'" v-model="scope.row.sex" placeholder="性别" clearable style="width: 100%;" transfer>
										  <vxe-option
											  v-for="item in $dictUtils.getDictList('sex')"
											  :key="item.value"
											  :label="item.label"
											  :value="item.value">
										  </vxe-option>
									  </vxe-select>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="officeId" title="部门" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input v-model="scope.row.officeId" placeholder="部门" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="position" title="职务" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input v-model="scope.row.position" placeholder="职务" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="contactFirst" title="联系方式1" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input v-model="scope.row.contactFirst" oninput="value=value.replace(/[^\d]/g,'')" placeholder="联系方式1" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="contactSecond" title="联系方式2" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input v-model="scope.row.contactSecond" oninput="value=value.replace(/[^\d]/g,'')" placeholder="联系方式2" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="fax" title="传真" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input v-model="scope.row.fax" placeholder="传真" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="email" title="邮箱" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input v-model="scope.row.email" @change="$forceUpdate()" @blur="blurEmail(scope.$rowIndex)" placeholder="邮箱" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" min-width="110" field="remarks" title="备注" :edit-render="{}" show-overflow="title">
								  <template #default="scope">
									  <el-input maxlength="500" v-model="scope.row.remarks" placeholder="备注" clearable></el-input>
								  </template>
							  </vxe-table-column>
							  <vxe-table-column align="center" title="操作" width="100">
								  <template #default="scope">
									  <el-button type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'contact')">删除</el-button>
								  </template>
							  </vxe-table-column>
						  </vxe-table>
					  </el-form>
				  </el-row>
              </el-tab-pane>
              <el-tab-pane label="项目组成员" name="members">
                <el-row  :gutter="15">
                  <vxe-table
                    border
                    show-overflow
                    show-footer
                    :column-config="{resizable: true}"
                    ref="memberTable"
                    :key="tableKeyMembers"
                    class="vxe-table-element"
                    :data="inputForm.cwProjectMembersDTOList"
                    style=""
                    highlight-current-row
                  >
                    <vxe-table-column min-width="218" align="center" field="name" title="姓名" show-overflow="title"></vxe-table-column>
                    <vxe-table-column min-width="218" align="center" field="officeName" title="部门" show-overflow="title"></vxe-table-column>
                    <vxe-table-column min-width="218" align="center" field="roleName" title="角色" show-overflow="title"></vxe-table-column>
                    <vxe-table-column min-width="218" align="center" field="mobile" title="手机号" show-overflow="title"></vxe-table-column>
                    <vxe-table-column min-width="218" align="center" field="status" title="状态">
                      <template #default="scope">
                        <span v-if="scope.row.status === '0'" style="color: #67C23A">正常</span>
                        <span v-else>移除</span>
                      </template>
                    </vxe-table-column>
                  </vxe-table>
                </el-row>
              </el-tab-pane>
				<el-tab-pane name="construction">
					<template v-slot:label>
						<span> 施工方信息</span>
					</template>
					<el-row :gutter="15">
						<el-button style="margin-bottom: 15px" type="primary" :disabled="true" @click="openConstructionForm()"  plain>
							添加施工方信息联系人
						</el-button>
					</el-row>
					<el-row  :gutter="15">
						<el-form :disabled="true" style="width: 100%;">
							<vxe-table
								border
								show-overflow
								show-footer
								:column-config="{resizable: true}"
								ref="construction"
								:key="tableKeyConstruction"
								class="vxe-table-element"
								:data="inputForm.cwProjectConstructionList"
								keep-source
								style=""
								highlight-current-row
								:edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: true, icon: '-'}"
							>
								<vxe-table-column min-width="250" align="center"  field="name" title="施工方单位名称" :edit-render="{}">
									<template v-slot:edit="scope">
										<el-input v-model="scope.row.name" placeholder="施工方单位名称" clearable></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="250" align="center" field="clientName" title="联系人姓名" :edit-render="{}">
									<template v-slot:edit="scope">
										<el-input v-model="scope.row.clientName" placeholder="联系人姓名" clearable></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="250" align="center" field="contactFirst" title="联系方式1" :edit-render="{}">
									<template v-slot:edit="scope">
										<el-input v-model="scope.row.contactFirst" oninput="value=value.replace(/[^\d]/g,'')" placeholder="联系方式1" clearable></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="240" align="center" field="contactSecond" title="联系方式2" :edit-render="{}">
									<template v-slot:edit="scope">
										<el-input v-model="scope.row.contactSecond" oninput="value=value.replace(/[^\d]/g,'')" placeholder="联系方式2" clearable></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column align="center" title="操作" width="100">
									<template v-slot="scope">
										<el-button type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'construction')">删除</el-button>
									</template>
								</vxe-table-column>
							</vxe-table>
						</el-form>
					</el-row>
				</el-tab-pane>
              <el-tab-pane label="附件" name="files">
                <!--        附件-->
                <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
              </el-tab-pane>

            </el-tabs>
          </el-tab-pane>
          <el-tab-pane label="合同信息" name="contract">
			  <el-form size="default" :model="inputForm2" ref="inputForm2" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'"
					   label-width="150px">
				  <el-row  :gutter="0">
					  <el-col :span="12">
						  <el-form-item label="委托方" prop="clientContacts"
										:rules="[
                 ]">
							  <el-input maxlength="100" @focus="openWorkClient2()" v-model="inputForm2.clientContacts" placeholder="请选择委托方">
								  <el-button slot="append" icon="el-icon-search" @click="openWorkClient2()"></el-button>
							  </el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="客户编号" prop="customerNo"
										:rules="[
                   ]">
							  <el-input :disabled="true" v-model="inputForm2.customerNo" placeholder="请填写客户编号" clearable></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="统一社会信用代码" prop="uscCode"
										:rules="[
                   ]">
							  <el-input :disabled="true" v-model="inputForm2.uscCode" placeholder="请填写统一社会信用代码" clearable></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="委托方电话" prop="clientContactsPhone"
										:rules="[
                          // {required: true, message: '委托方电话', trigger: 'blur'}
                 ]">
							  <el-input maxlength="15" :disabled="true" v-model="inputForm2.clientContactsPhone" placeholder="请输入委托方电话"
							  ></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="地址" prop="address"
										:rules="[
                   ]">
							  <el-input :disabled="true" v-model="inputForm2.address" placeholder="地址" clearable></el-input>
						  </el-form-item>
					  </el-col>
				  </el-row>
				  <el-divider content-position="left"><i class="el-icon-document"></i> 基本信息</el-divider>
				  <el-row  :gutter="0">
					  <el-col :span="12">
						  <el-form-item label="合同名称" prop="contractName"
										:rules="[{required: true, message: '合同名称不能为空', trigger: 'blur'}
                 ]">
							  <el-input v-model="inputForm2.contractName" placeholder="请输入合同名称"     clearable></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="合同编号" prop="contractNo">
							  <el-input maxlength="64" :disabled="true" v-model="inputForm2.contractNo" placeholder="自动生成"></el-input>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="合同类型" prop="contractType"
										:rules="[{required: true, message: '合同类型不能为空', trigger: 'blur'}
                 ]" >
							  <el-select v-model="inputForm2.contractType" :disabled="contractNoFlag" placeholder="请选择合同类型" style="width:100%;">
								  <el-option
									  v-for="item in $dictUtils.getDictList('cw_contract_type')"
									  :key="item.value"
									  :label="item.label"
									  :value="item.value">
								  </el-option>
							  </el-select>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="付款主体" prop="payerSubject"
										:rules="[{required: true, message: '付款主体不能为空', trigger: 'blur'}
                 ]">
							  <el-select v-model="inputForm2.payerSubject" placeholder="请选择付款主体" style="width:100%;">
								  <el-option
									  v-for="item in $dictUtils.getDictList('cw_payment_subject')"
									  :key="item.value"
									  :label="item.label"
									  :value="item.value">
								  </el-option>
							  </el-select>
						  </el-form-item>
					  </el-col>
					  <el-col :span="12">
						  <el-form-item label="付款方式" prop="paymentMethod"
										:rules="[
                 ]">
							  <el-select v-model="inputForm2.paymentMethod" placeholder="请选择付款方式" style="width:100%;">
								  <el-option
									  v-for="item in $dictUtils.getDictList('cw_payment_method')"
									  :key="item.value"
									  :label="item.label"
									  :value="item.value">
								  </el-option>
							  </el-select>
						  </el-form-item>
					  </el-col>
					  <el-col>
						  <el-form-item label="付款描述" prop="paymentDescribe"
										:rules="[
               ]">
							  <el-input type="textarea" v-model="inputForm2.paymentDescribe" placeholder="请输入付款描述"
							  ></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12">
						  <el-form-item label="签约日期" prop="signingDate"
										:rules="[
                {required: true, message:'请输入签约日期', trigger:'blur'}
               ]">
							  <el-date-picker
								  placement="bottom-start"
								  value-format="YYYY-MM-DD"
								  v-model="inputForm2.signingDate"
								  style="width: 100%"
								  placeholder="选择日期">
							  </el-date-picker>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12">
						  <el-form-item label="合同份数" prop="contractNum"
										:rules="[{required: true, message: '合同份数', trigger: 'blur'}
                 ]">
							  <el-input maxlength="64" v-model="inputForm2.contractNum" placeholder="请输入合同份数"></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12">
						  <el-form-item label="对方合同编号" prop="contractOpposite">
							  <el-input maxlength="64" v-model="inputForm2.contractOpposite" placeholder="请填写对方合同编号"></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12">
						  <el-form-item  prop="department" label="所属部门">
							  <SelectTree
								  ref="officeTree"
								  :props="{
                  value: 'id',             // ID字段名
                  label: 'name',         // 显示名称
                  children: 'children'    // 子级字段名
                }"

								  :url="`/system-server/sys/office/treeData?type=2`"
								  :value="inputForm2.department"
								  :accordion="true"
								  size="default"
								  @getValue="(value) => {inputForm2.department=value}"/>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12">
						  <el-form-item label="创建人" prop="createBy"
										:rules="[{required: true, message: '创建人', trigger: 'blur'}
                 ]">
							  <el-input maxlength="64" :disabled="true" v-model="inputForm2.createBy" placeholder="请输入创建人"></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12">
						  <el-form-item label="创建时间" prop="createTime">
							  <el-date-picker
								  placement="bottom-start"
								  value-format="YYYY-MM-DD"
								  v-model="inputForm2.createTime"
								  style="width: 100%"
								  :disabled="true"
								  placeholder="选择日期">
							  </el-date-picker>
						  </el-form-item>
					  </el-col>

					  <el-col>
						  <el-form-item label="合同金额类别" prop="contractAmountType"
										:rules="[
                  {required: true, message:'请选择合同金额类别', trigger:'blur'}
               ]">
							  <el-radio-group v-model="inputForm2.contractAmountType">
								  <el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :label="item.value" >{{item.label}}</el-radio>
							  </el-radio-group>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12" v-if="inputForm2.contractAmountType === '1'">
						  <el-form-item label="合同金额(元)" prop="contractAmount"
										:rules="[
                  {required: true, message:'请输入合同金额(元)', trigger:'blur'}
               ]">
							  <el-input maxlength="15" v-model="inputForm2.contractAmount" placeholder="请输入合同金额(元)"
										@keyup.native="inputForm2.contractAmount = twoDecimalPlaces(inputForm2.contractAmount)"
							  ></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12" v-if="inputForm2.contractAmountType === '2'">
						  <el-form-item label="预计金额(元)" prop="predictAmount"
										:rules="[
                  /*{required: true, message:'请输入预计金额(元)', trigger:'blur'}*/
               ]">
							  <el-input maxlength="15" v-model="inputForm2.predictAmount" placeholder="请输入预计金额(元)"
										@keyup.native="inputForm2.predictAmount = twoDecimalPlaces(inputForm2.predictAmount)"
							  ></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="12">
						  <el-form-item label="合同实际金额" prop="actualContractAmount">
							  <el-input maxlength="64" :disabled="true" v-model="inputForm2.actualContractAmount"
										@keyup.native="inputForm2.actualContractAmount = twoDecimalPlaces(inputForm2.actualContractAmount)"
							  ></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="24">
						  <el-form-item label="收费标准" prop="contractFees">
							  <el-checkbox-group v-model="inputForm2.contractFees">
								  <el-checkbox @change="changeContractFee" v-for="item in $dictUtils.getDictList('contract_fee_new')" :label="item.value">
									  {{item.label}}
								  </el-checkbox>
							  </el-checkbox-group>
						  </el-form-item>
					  </el-col>

					  <el-col :span="24">
						  <el-form-item prop="contractFee">
							  <el-input style="width: 100%" placeholder="请选择收费标准" v-model="inputForm2.contractFee"></el-input>
						  </el-form-item>
					  </el-col>

					  <el-col :span="24">
						  <el-form-item label="付款约定" prop="paymentAgreement">
							  <el-input maxlength="1000" type="textarea" v-model="inputForm2.paymentAgreement" placeholder="请输入付款约定"></el-input>
						  </el-form-item>
					  </el-col>

				  </el-row>

				  <el-tabs v-model="activeName" type="border-card" @tab-click="tabHandleClick">
					  <el-tab-pane name="contractProper">
						  <template v-slot:label>
							  <span><span style="color: red;border-top: 20px">*</span> 合同文件</span>
						  </template>
						  <!--        合同文件-->
						  <UpLoadComponent ref="uploadComponent2"></UpLoadComponent>
					  </el-tab-pane>
					  <el-tab-pane name="contactParty">
						  <template v-slot:label>
							  <span><span style="color: red;border-top: 20px">*</span> 参与签约方</span>
						  </template>
						  <el-row :gutter="15">
							  <el-button type="primary" style="margin-bottom: 15px" size="small" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'" @click="openWorkClient">
								  新增参与签约方
							  </el-button>
						  </el-row>
						  <el-row :gutter="15">
							  <el-form style="width: 100%;">
								  <vxe-table
									  border
									  show-overflow
									  show-footer
									  :column-config="{resizable: true}"
									  ref="contactTable"
									  :key="tableKeyClient"
									  class="vxe-table-element"
									  :data="inputForm2.cwWorkClientContactDTOList"
									  style=""
									  highlight-current-row
									  :edit-config="{trigger: 'click', mode: 'row', showStatus: false, autoClear: false}"
								  >
									  <vxe-table-column min-width="435" align="center" field="no" title="客户编号" :edit-render="{}">
										  <template v-slot:edit="scope">
											  <el-input :readonly="true" v-model="scope.row.no" placeholder="客户编号" clearable></el-input>
										  </template>
									  </vxe-table-column>
									  <vxe-table-column min-width="435" align="center" field="name" title="客户名称" :edit-render="{}">
										  <template v-slot:edit="scope">
											  <el-input :readonly="true" v-model="scope.row.name" placeholder="客户名称" clearable></el-input>
										  </template>
									  </vxe-table-column>
									  <vxe-table-column align="center" title="操作" width="220px">
										  <template v-slot="scope">
											  <el-button size="small" :disabled="status === 'audit' || status === 'taskFormDetail'|| method==='view'" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'client')">删除</el-button>
										  </template>
									  </vxe-table-column>
								  </vxe-table>
							  </el-form>
						  </el-row>
					  </el-tab-pane>
				  </el-tabs>

			  </el-form>
          </el-tab-pane>
			<el-tab-pane label="项目计划信息" name="projectPlan">
				<el-form :model="inputForm3" ref="inputForm3" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'|| method ==='view'"
						 label-width="135px" @submit.native.prevent>
					<el-divider content-position="left"><i class="el-icon-document"></i> 项目计划信息</el-divider>
					<el-row  :gutter="15">
						<el-col :span="12">
							<el-form-item label="项目名称" prop="projectName"
										  :rules="[
                                {required: true, message:'项目名称不能为空', trigger:'blur'}
                   ]">
								<el-input :disabled="true" v-model="inputForm3.projectName" placeholder="请填写项目名称" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目编号" prop="projectNumber"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm3.projectNumber" placeholder="请填写项目编号" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="创建人" prop="createName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm3.createName" placeholder="请填写创建人" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="创建时间" prop="createTime"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm3.createTime" placeholder="请填写创建时间" clearable></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-form :model="inputForm3" ref="inputForm3" v-loading="loading" :class="method==='view'?'readonly':''"
							 label-width="135px" @submit.native.prevent>
						<el-divider content-position="left"><i class="el-icon-document"></i> 项目计划列表
							<el-button size="default" style="margin-left: 20px" type="primary" :disabled = "method === 'view'" @click="insertEvent()" plain>
								新增
							</el-button>

							<el-button size="default" style="margin-left: 20px" type="primary" @click="exportPlan()" plain>
								导出
							</el-button>
							<a v-if="inputForm3.planStartDate !=='' && inputForm3.planEndDate !== ''" style="margin-left: 1em;font-size: 14px">项目起始时间:{{inputForm3.planStartDate}} - {{inputForm3.planEndDate}}</a>
						</el-divider>
					</el-form>

					<el-row  :gutter="15">
						<el-col :span="24">
							<vxe-table
								border
								show-overflow
								show-footer
								:column-config="{resizable: true}"
								ref="detailTable"
								:key="detailkey"
								class="vxe-table-element"
								:data="inputForm3.planDetailsList"
								style=""
								highlight-current-row
								:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
							>
								<vxe-table-column type="seq" width="60" title="序号"></vxe-table-column>
								<vxe-table-column min-width="190" field="taskPhase" title="任务阶段" :edit-render="{}" show-overflow="title" :rules="[{required: true, message:'请输入任务阶段', trigger:'blur'}]">
									<template v-slot:edit="scope">
										<el-autocomplete
											class="inline-input"
											v-model="scope.row.taskPhase"
											:fetch-suggestions="querySearch"
											placeholder="请输入内容"
											@select="handleSelect"
										></el-autocomplete>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="190" field="planStartDate" title="计划开始时间" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-date-picker
											v-model="scope.row.planStartDate"
											type="date"
											value-format="YYYY-MM-DD"
											placeholder="选择计划开始时间"
											style="width:100%"
											placement="bottom-start"
											clearable>
										</el-date-picker>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="190" field="planEndDate" title="计划结束时间" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-date-picker
											v-model="scope.row.planEndDate"
											type="date"
											value-format="YYYY-MM-DD"
											placeholder="选择计划结束时间"
											style="width:100%"
											placement="bottom-start"
											clearable>
										</el-date-picker>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="190" field="warnName" title="提醒人" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input v-model="scope.row.warnName" @focus="userPullListForm1(scope.$rowIndex)"></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="190" field="achieverName" title="完成人" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input v-model="scope.row.achieverName" @focus="userPullListForm(scope.$rowIndex)"></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column title="操作" width="100">
									<template v-slot="scope">
										<el-button size="default" type="danger" :disabled = "method === 'view'" @click="removeEvent(scope.row,scope.$rowIndex)"  >删除</el-button>
									</template>
								</vxe-table-column>
							</vxe-table>
						</el-col>
					</el-row>
				</el-form>
				<UpLoadComponent ref="uploadComponent3"></UpLoadComponent>
			</el-tab-pane>
			<el-tab-pane label="质量复核信息" name="qualityCheck">
				<el-form :model="inputForm4" ref="inputForm4" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail' || method==='view'"
						 label-width="135px" @submit.native.prevent>
					<el-divider content-position="left"><i class="el-icon-document"></i> 质量复核信息</el-divider>
					<el-row  :gutter="0">
						<el-col :span="12">
							<el-form-item label="送审价(元)" prop="reviewFee"
										  :rules="[
							{required: true, message: '送审价(元)不能为空', trigger: 'blur'},
                   ]">
								<el-input
									@change="getFee"
									v-on:input="inputForm4.reviewFee=inputForm4.reviewFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.reviewFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="请输入送审价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="审定价(元)" prop="approvalFee"
										  :rules="[
									{required: true, message: '审定价(元)不能为空', trigger: 'blur'},
			   ]">
								<el-input
									@change="getApprovalFee"
									v-on:input="inputForm4.approvalFee=inputForm4.approvalFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.approvalFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="请输入审定价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="合同类别" prop="contractCategory" :rules="[]">
								<el-radio-group v-model="inputForm4.contractCategory">
									<el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :key="item.value" :label="item.value">{{item.label}}</el-radio>
								</el-radio-group>
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="inputForm4.contractCategory === '1'">
							<el-form-item label="合同价(元)" prop="contractFee"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.contractFee" placeholder="请输入合同价(元)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="inputForm4.contractCategory === '2'">
							<el-form-item label="费率(%)" prop="contractRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.contractRate" placeholder="请输入费率(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="下一节点审核人" prop="reviewBy"
										  :rules="[
										{required: true, message:'下一节点审核人不能为空', trigger:'change'}
                   ]">
								<UserSelectSignatory style="width: 100%" ref="userSelect1"
													 :readonly="true" :limit='1' :modelValue="inputForm4.reviewBy"
													 @update:modelValue='(value) => {inputForm4.reviewBy = value}'></UserSelectSignatory>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="核增核减额(元)" prop="verifyFee"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.verifyFee" :disabled="true" placeholder="请输入核增核减额(元)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="核增核减率(%)" prop="verifyRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.verifyRate" :disabled="true" placeholder="请输入核增核减率(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="咨询标的额(元)" prop="consultFee"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.consultFee" :disabled="true" placeholder="请输入咨询标的额(元)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="土建造价(元)" prop="buildingFee"
										  :rules="[

			   ]">
								<el-input
									@change="getBuildingFee"
									v-on:input="inputForm4.buildingFee=inputForm4.buildingFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.buildingFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="土建造价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="安装造价(元)" prop="installFee"
										  :rules="[

			   ]">
								<el-input
									@change="getInstallFee"
									v-on:input="inputForm4.installFee=inputForm4.installFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.installFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="安装造价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="土建比例(%)" prop="buildingRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.buildingRate" :disabled="true" placeholder="请输入土建比例(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="安装比例(%)" prop="installRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.installRate" :disabled="true" placeholder="请输入安装比例(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="工作开始时间" prop="workStartDate" :rules="[
					  	{required: true, message: '工作开始时间不能为空', trigger: 'blur'},
					  	{ validator: validateDateRange, trigger: 'change' }
               ]">
								<el-date-picker
									style="width: 100%"
									v-model="inputForm4.workStartDate"
									value-format="YYYY-MM-DD"
									placeholder="选择日期"
								>
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="工作结束时间" prop="workEndDate" :rules="[
					  	{required: true, message: '工作结束时间不能为空', trigger: 'blur'},
					  	{ validator: validateDateRange, trigger: 'change' }
               ]">
								<el-date-picker
									style="width: 100%"
									v-model="inputForm4.workEndDate"
									value-format="YYYY-MM-DD"
									placeholder="选择日期"
								>
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="造价咨询营业收入(万元)" prop="ziXunShouRu"
										  :rules="[
										{ validator: ziXunShouRuRange, trigger: 'change' },
										{required: true, message: '造价咨询营业收入(万元)不能为空', trigger: 'blur'},
			   ]">
								<el-input
									v-on:input="inputForm4.ziXunShouRu=inputForm4.ziXunShouRu.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.ziXunShouRu"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="请输入造价咨询营业收入(万元)"
									clearable />
							</el-form-item>
						</el-col>
					</el-row>
					<div>
						<el-divider content-position="left"><i class="el-icon-document"></i>
							<span style="color:#f5222d;">*</span> 项目组成员(质量控制流程)
							<el-button size="default" style="margin-left: 20px" type="primary" @click="insertEvent('detail')" plain>
								新增
							</el-button>
						</el-divider>
						<el-row :gutter="15">
							<el-col :span="24">
								<vxe-table
									border
									show-footer
									show-overflow
									ref="detailTable"
									:key="detailKey"
									class="vxe-table-element"
									:data="inputForm4.detailInfos"
									:column-config="{resizable: true}"
									style=""
									highlight-current-row
									:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
								>
									<vxe-table-column title="编号" field="index" width="80">
										<template v-slot="scope">
											{{ scope.$rowIndex + 1 }}
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="166" field="memberName" title="成员名称" :edit-render="{}" show-overflow="title" :rules="[{required: true, message:'请选择用户', trigger:'blur'}]">
										<template v-slot:edit="scope">
											<el-input v-model="scope.row.memberName" :disabled="scope.$rowIndex == 0 " @focus="userPullListForm(scope.$rowIndex)"></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="164" field="userRole" title="角色" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input v-model="scope.row.userRole" :readonly="true"></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="145" field="enrollCertNo" title="注册/资格证号" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input v-model="scope.row.enrollCertNo" :readonly="true"></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="145" field="profession" title="专业" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input v-model="scope.row.profession" :readonly="true"></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="165" field="content" title="本人负责内容" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input v-model="scope.row.content" ></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="145" field="opinion" title="审核意见" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input v-model="scope.row.opinion" ></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column title="操作" width="100">
										<template v-slot="scope">
											<el-button size="default" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'detail')"  v-if="scope.$rowIndex !== 0 ">删除</el-button>
										</template>
									</vxe-table-column>
								</vxe-table>
							</el-col>
						</el-row>
					</div>
				</el-form >
			</el-tab-pane>
			<el-tab-pane label="报告签发信息" name="issueInfo">
				<el-form :model="inputForm4" ref="inputForm4" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail' || method==='view'"
						 label-width="135px" @submit.native.prevent>
					<el-divider content-position="left"><i class="el-icon-document"></i> 质量复核信息</el-divider>
					<el-row  :gutter="0">
						<el-col :span="12">
							<el-form-item label="送审价(元)" prop="reviewFee"
										  :rules="[
							{required: true, message: '送审价(元)不能为空', trigger: 'blur'},
                   ]">
								<el-input
									@change="getFee"
									v-on:input="inputForm4.reviewFee=inputForm4.reviewFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.reviewFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="请输入送审价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="审定价(元)" prop="approvalFee"
										  :rules="[
									{required: true, message: '审定价(元)不能为空', trigger: 'blur'},
			   ]">
								<el-input
									@change="getApprovalFee"
									v-on:input="inputForm4.approvalFee=inputForm4.approvalFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.approvalFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="请输入审定价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="合同类别" prop="contractCategory" :rules="[]">
								<el-radio-group v-model="inputForm4.contractCategory">
									<el-radio v-for="item in $dictUtils.getDictList('contract_amount_type')" :key="item.value" :label="item.value">{{item.label}}</el-radio>
								</el-radio-group>
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="inputForm4.contractCategory === '1'">
							<el-form-item label="合同价(元)" prop="contractFee"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.contractFee" placeholder="请输入合同价(元)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="inputForm4.contractCategory === '2'">
							<el-form-item label="费率(%)" prop="contractRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.contractRate" placeholder="请输入费率(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="下一节点审核人" prop="reviewBy"
										  :rules="[
										{required: true, message:'下一节点审核人不能为空', trigger:'change'}
                   ]">
								<UserSelectSignatory style="width: 100%" ref="userSelect1"
													 :readonly="true" :limit='1' :modelValue="inputForm4.reviewBy"
													 @update:modelValue='(value) => {inputForm4.reviewBy = value}'></UserSelectSignatory>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="核增核减额(元)" prop="verifyFee"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.verifyFee" :disabled="true" placeholder="请输入核增核减额(元)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="核增核减率(%)" prop="verifyRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.verifyRate" :disabled="true" placeholder="请输入核增核减率(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="咨询标的额(元)" prop="consultFee"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.consultFee" :disabled="true" placeholder="请输入咨询标的额(元)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="土建造价(元)" prop="buildingFee"
										  :rules="[

			   ]">
								<el-input
									@change="getBuildingFee"
									v-on:input="inputForm4.buildingFee=inputForm4.buildingFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.buildingFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="土建造价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="安装造价(元)" prop="installFee"
										  :rules="[

			   ]">
								<el-input
									@change="getInstallFee"
									v-on:input="inputForm4.installFee=inputForm4.installFee.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.installFee"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="安装造价(元)"
									clearable />
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="土建比例(%)" prop="buildingRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.buildingRate" :disabled="true" placeholder="请输入土建比例(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="安装比例(%)" prop="installRate"
										  :rules="[

			   ]">
								<el-input v-model="inputForm4.installRate" :disabled="true" placeholder="请输入安装比例(%)" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="工作开始时间" prop="workStartDate" :rules="[
					  	{required: true, message: '工作开始时间不能为空', trigger: 'blur'},
					  	{ validator: validateDateRange, trigger: 'change' }
               ]">
								<el-date-picker
									style="width: 100%"
									v-model="inputForm4.workStartDate"
									value-format="YYYY-MM-DD"
									placeholder="选择日期"
								>
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="工作结束时间" prop="workEndDate" :rules="[
					  	{required: true, message: '工作结束时间不能为空', trigger: 'blur'},
					  	{ validator: validateDateRange, trigger: 'change' }
               ]">
								<el-date-picker
									style="width: 100%"
									v-model="inputForm4.workEndDate"
									value-format="YYYY-MM-DD"
									placeholder="选择日期"
								>
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="造价咨询营业收入(万元)" prop="ziXunShouRu"
										  :rules="[
										{ validator: ziXunShouRuRange, trigger: 'change' },
										{required: true, message: '造价咨询营业收入(万元)不能为空', trigger: 'blur'},
			   ]">
								<el-input
									v-on:input="inputForm4.ziXunShouRu=inputForm4.ziXunShouRu.replace(/[^\d.]/g,'')
							  .replace(/^\./g,'')
							  .replace(/\.{2,}/g,'.')
							  .replace('.','$#$').replace(/\./g,'').replace('$#$','.')
							  .replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
									v-model="inputForm4.ziXunShouRu"
									controls-position="right"
									:controls="false"
									style="width:100%;"
									placeholder="请输入造价咨询营业收入(万元)"
									clearable />
							</el-form-item>
						</el-col>
					</el-row>
				</el-form >
			</el-tab-pane>
			<el-tab-pane label="档案信息" name="filesInfo">
				<el-divider content-position="left"><i class="el-icon-document"></i>
					<span>文件信息</span>
				</el-divider>
				<el-row  :gutter="15" >
					<el-col :span="24">
						<vxe-table
							border
							show-overflow
							ref="clientTable"
							class="vxe-table-element"
							style=""
							:row-config="{keyField: 'id'}"
							:column-config="{resizable: true}"
							:tree-config="{transform: true, expandAll: true}"
							:key="tableKey"
							:data="tableData">
							<vxe-column field="name" title="文件要求" width="240px" tree-node>
								<template #default="scope">
							<span style="font-weight: bold"
								  v-if="scope.row.parentId === '0'"
							>{{ scope.row.name }}
							</span>
									<span
										v-if="scope.row.parentId !== '0' && scope.row.mustFlag === 1"
									><span style="color: red;font-weight: bold">* </span>{{ scope.row.name }}
							</span>
									<span
										v-if="scope.row.parentId !== '0' && scope.row.mustFlag === 0"
									>{{ scope.row.name }}
							</span>
								</template>
							</vxe-column>
							<vxe-column min-width="470" field="attachmentName" title="文件描述/文件名称" show-overflow="false">
								<template #default="scope">
							<span
								v-if="scope.row.levelFlag === 2"
							>
								<span style="font-weight: bold">文件格式及大小：{{ scope.row.size }}</span>
								<br>
								<span>{{ scope.row.type }}</span>
							</span>
									<div v-if="ifName(scope.row) === true">
										<el-image
											style="width: 30px; height: 30px;padding-top: 4px;"
											:src="scope.row.lsUrl"
											:preview-src-list="[scope.row.lsUrl]"
											:preview-teleported="true"
										></el-image>
									</div>
									<div v-else>
										<el-link v-if="scope.row.levelFlag === 3"  type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.attachmentName}}</el-link>
									</div>
								</template>
							</vxe-column>
							<vxe-column field="workAttachmentType" width="100px" title="文件类型"></vxe-column>
							<vxe-column field="createDate" title="上传时间" width="100px"></vxe-column>
							<vxe-column field="fileSize" width="100px" title="文件大小(M)">
								<template #default="scope">
									{{getSize(scope.row.fileSize)}}
								</template>
							</vxe-column>

							<vxe-column
								title="操作"
								width="100px"
								fixed="right"
								align="center"
							>
								<template #default="scope">
									<el-button
										v-if="scope.row.levelFlag === 2"
										type="primary"
										size="small"
										:disabled="status === 'audit' ||status === 'taskFormDetail'|| method ==='view'"
										@click="openFileForm(scope.row.id,this.inputForm4.id)"
									>编辑</el-button>
									<el-button
										v-if="scope.row.levelFlag === 3"
										type="info"
										size="small"
										@click="toHref(scope.row)" >下载</el-button>

								</template>
							</vxe-column>
						</vxe-table>
					</el-col>
				</el-row>
				<FileForm ref="fileForm" @getFiles="getFiles"></FileForm>
			</el-tab-pane>
			<el-tab-pane label="线上归档信息" name="onlineArchive">
				<el-form :model="inputForm5" ref="inputForm5" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail' || method==='view'"
						 label-width="135px" @submit.native.prevent>

					<el-divider content-position="left"><i class="el-icon-document"></i> 项目信息</el-divider>
					<el-row  :gutter="0">
						<el-col :span="12">
							<el-form-item label="报告号" prop="reportNo"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.reportNo" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="报告日期" prop="reportDate"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.reportDate" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="合同编号" prop="contractNo"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.contractNo" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="合同名称" prop="contractName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.contractName" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="委托方" prop="clientName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.clientName" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目编号" prop="projectNumber"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.projectNumber" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目名称" prop="projectName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.projectName" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="归档申请人" prop="applyUserName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm5.applyUserName" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="归档时间" prop="applyDates"
										  :rules="[
                   ]">
								<el-date-picker
									:disabled="true"
									style="width: 100%;"
									v-model="inputForm5.applyDates"
									type="date"
									value-format="YYYY-MM-DD"
									placeholder="选择归档时间">
								</el-date-picker>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="24">
							<el-form-item label="说明" prop="onlineRemarks"
										  :rules="[
                   ]">
								<el-input type="textarea"
										  maxlength="200" placeholder="请输入说明"
										  show-word-limit v-model="inputForm5.onlineRemarks"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form >
			</el-tab-pane>
			<el-tab-pane label="纸质归档信息" name="paperArchive">
				<el-form :model="inputForm6" ref="inputForm6" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail' || method==='view'"
						 label-width="135px" @submit.native.prevent>
					<el-divider content-position="left"><i class="el-icon-document"></i> 项目合同信息</el-divider>
					<el-row>
						<el-col :span="12">
							<el-form-item label="合同编号" prop="contractNo"
										  :rules="[
                   ]">
								<el-input placeholder="" :disabled="true" show-word-limit v-model="inputForm6.contractNo"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="合同名称" prop="contractName"
										  :rules="[
                   ]">
								<el-input placeholder="" :disabled="true" show-word-limit v-model="inputForm6.contractName"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="合同金额(元)" prop="contractAmount"
										  :rules="[
                   ]">
								<el-input placeholder="" :disabled="true" show-word-limit v-model="inputForm6.contractAmount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="委托方" prop="clientName"
										  :rules="[
                   ]">
								<el-input placeholder="" :disabled="true" show-word-limit v-model="inputForm6.clientName"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="合同类型" prop="contractType"
										  :rules="[
              ]">
								<el-select :disabled="true" v-model="inputForm6.contractType" placeholder="请选择" style="width:100%;">
									<el-option
										v-for="item in $dictUtils.getDictList('cw_contract_type')"
										:key="item.value"
										:label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>
					<el-divider content-position="left"><i class="el-icon-document"></i> 项目基础信息</el-divider>
					<el-row  :gutter="0">
						<el-col :span="12">
							<el-form-item label="项目名称" prop="projectName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm6.projectName" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目编号" prop="projectNumber"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm6.projectNumber" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="创建人" prop="projectCreateByName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm6.projectCreateByName" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目责任人" prop="projectCreateByName"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm6.projectCreateByName" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目所属部门" prop="officeId"
										  :rules="[
                                {required: true, message:'项目所属部门不能为空', trigger:'blur'}
                   ]">
								<SelectTree
									ref="officeTree"
									:props="{
                          value: 'id',             // ID字段名
                          label: 'name',         // 显示名称
                          children: 'children'    // 子级字段名
                        }"
									:url="`/system-server/sys/office/treeData?type=2`"
									:value="inputForm6.officeId"
									:accordion="true"
									size="large"
									:disabled="true"
									@getValue="(value) => {inputForm6.officeId=value}"/>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="现场负责人" prop="projectManager"
										  :rules="[
                   ]">
								<el-input :disabled="true" v-model="inputForm6.projectManager" clearable></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="12" v-if="inputForm.projectType === '1'">
							<el-form-item label="项目类别" prop="reportType"
										  :rules="[
                                 {required: true, message:'项目类别不能为空', trigger:'blur'}
                  ]">
								<el-select :disabled="true" v-model="inputForm6.reportType" placeholder="请选择项目类别" clearable style="width: 100%;">
									<el-option
										v-for="item in $dictUtils.getDictList('program_cost_audit_type')"
										:key="item.value"
										:label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12" >
							<el-form-item label="项目类别" prop="reportType"
										  :rules="[
                                 {required: true, message:'项目类别不能为空', trigger:'blur'}
                  ]">
								<el-select :disabled="true" v-model="inputForm6.reportType" placeholder="请选择项目类别" clearable style="width: 100%;">
									<el-option
										v-for="item in $dictUtils.getDictList('program_engineering_consultation_type')"
										:key="item.value"
										:label="item.label"
										:value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目等级" prop="projectLevel"
										  :rules="[
                  {required: true, message:'请选择项目等级(500万及500万以上为A级，500万以下为B级)', trigger:'blur'}
               ]">
								<el-radio-group :disabled="true" v-model="inputForm6.projectLevel">
									<el-radio  v-for="item in $dictUtils.getDictList('cw_project_level')" :label="item.value" >{{item.label}}</el-radio>
								</el-radio-group>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="项目规模(元)" prop="projectMoney"
										  :rules="[{required: true, message:'项目规模不能为空', trigger:'blur'}
                   ]">
								<el-input-number
									:disabled="true"
									v-model="inputForm6.projectMoney"
									controls-position="right"
									style="width:100%"
									:precision="2"
									:max="9999999999"
									:step="0.01"
									:min="0"
									placeholder="请填写项目规模"
									:controls="false"
									clearable>
								</el-input-number>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="工作开始日期" prop="planStartDate"
										  :rules="[
                 ]">
								<el-date-picker
									:disabled="true"
									v-model="inputForm6.planStartDate"
									type="date"
									value-format="YYYY-MM-DD"
									placeholder="选择工作开始日期"
									style="width:100%"
									placement="bottom-start"
									clearable>
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="工作结束日期" prop="planEndDate"
										  :rules="[
                 ]">
								<el-date-picker
									:disabled="true"
									v-model="inputForm6.planEndDate"
									type="date"
									value-format="YYYY-MM-DD"
									placeholder="选择工作结束日期"
									style="width:100%"
									placement="bottom-start"
									clearable>
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="12">
							<el-form-item label="创建时间" prop="createDate"
										  :rules="[
                   ]">
								<el-date-picker
									:disabled="true"
									v-model="inputForm6.createDate"
									type="date"
									value-format="YYYY-MM-DD"
									placeholder="选择创建时间"
									style="width:100%"
									placement="bottom-start"
									clearable>
								</el-date-picker>
							</el-form-item>
						</el-col>
					</el-row>
					<el-form v-if="status === 'audit'" :model="inputForm6" ref="inputForm6" v-loading="loading" :class="method==='view'?'readonly':''"
							 label-width="135px" @submit.native.prevent>
						<el-row>
							<el-col  :span="12">
								<el-form-item label="案卷号" prop="filedNo"
											  :rules="[
                                {required: true, message:'案卷号不能为空', trigger:'blur'}
                   ]">
									<el-input :disabled="false" v-model="inputForm6.filedNo" placeholder="请填写案卷号" clearable></el-input>
								</el-form-item>
							</el-col>
							<el-col  :span="12">
								<el-form-item label="确认案卷号" prop="confirmFiledNo"
											  :rules="[
                                {required: true, message:'确认案卷号不能为空', trigger:'blur'}
                   ]">
									<el-input :disabled="false" v-model="inputForm6.confirmFiledNo" placeholder="请填写确认案卷号" clearable></el-input>
								</el-form-item>
							</el-col>
						</el-row>
					</el-form>
					<el-form v-if="inputForm6.paperArchivingStatus === '5'" :model="inputForm6" ref="inputForm6" v-loading="loading" :class="method==='view'?'readonly':''"
							 label-width="135px" @submit.native.prevent>
						<el-row>
							<el-col  :span="12">
								<el-form-item label="案卷号" prop="filedNo"
											  :rules="[
                                {required: true, message:'案卷号不能为空', trigger:'blur'}
                   ]">
									<el-input :disabled="true" v-model="inputForm6.filedNo" placeholder="请填写案卷号" clearable></el-input>
								</el-form-item>
							</el-col>
							<el-col  :span="12">
								<el-form-item label="确认案卷号" prop="confirmFiledNo"
											  :rules="[
                                {required: true, message:'确认案卷号不能为空', trigger:'blur'}
                   ]">
									<el-input :disabled="true" v-model="inputForm6.confirmFiledNo" placeholder="请填写确认案卷号" clearable></el-input>
								</el-form-item>
							</el-col>
						</el-row>
					</el-form>
					<el-divider content-position="left"><i class="el-icon-document"></i>
						委托方联系人信息
					</el-divider>
					<el-row  :gutter="15" >
						<el-col :span="24">
							<vxe-table
								:column-config="{resizable: true}"
								border
								show-footer
								show-overflow
								ref="contactTable"
								class="vxe-table-element"
								:data="inputForm6.contactInfos"
								style="margin-left: 5em"
								:key="amountKey"
								highlight-current-row
								:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
							>
								<vxe-table-column min-width="260" field="clientContactsName" title="委托方" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.clientContactsName" ></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="260" field="name" title="联系人姓名" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.name" ></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="261" field="contactFirst" title="联系方式1" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.contactFirst" ></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="261" field="contactSecond" title="联系方式2" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.contactSecond" ></el-input>
									</template>
								</vxe-table-column>
							</vxe-table>
						</el-col>
					</el-row>
					<el-divider content-position="left"><i class="el-icon-document"></i>
						施工方信息
					</el-divider>
					<el-row  :gutter="15" >
						<el-col :span="24">
							<vxe-table
								:column-config="{resizable: true}"
								border
								show-footer
								show-overflow
								ref="contactTable"
								class="vxe-table-element"
								:data="inputForm6.constructionParty"
								style="margin-left: 5em"
								:key="amountKey3"
								highlight-current-row
								:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
							>
								<vxe-table-column min-width="260" field="clientContactsName" title="施工方单位名称" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.clientContactsName" ></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="260" field="name" title="联系人姓名" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.name" ></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="261" field="contactFirst" title="联系方式1" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.contactFirst" ></el-input>
									</template>
								</vxe-table-column>
								<vxe-table-column min-width="261" field="contactSecond" title="联系方式2" :edit-render="{}" show-overflow="title">
									<template v-slot:edit="scope">
										<el-input maxlength="15" :readonly="true" v-model="scope.row.contactSecond" ></el-input>
									</template>
								</vxe-table-column>
							</vxe-table>
						</el-col>
					</el-row>
					<el-divider content-position="left"><i class="el-icon-document"></i>
						项目报告
					</el-divider>
					<el-form :model="inputForm6" ref="inputForm6" v-loading="loading" :class="method==='view'?'readonly':''"
							 label-width="160px" @submit.native.prevent>
						<el-row  :gutter="15" >
							<el-col :span="24">
								<vxe-table
									:column-config="{resizable: true}"
									border
									show-footer
									show-overflow
									ref="contactTable"
									class="vxe-table-element"
									:data="inputForm6.projectReportInfos"
									style="margin-left: 5em"
									:key="amountKey2"
									highlight-current-row
									:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
								>
									<vxe-table-column min-width="260" field="reportNo" title="报告编号" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input maxlength="15" :readonly="true" v-model="scope.row.reportNo" @focus="openProgramPageForm(scope.$rowIndex, scope.row)"></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="260" field="projectName" title="报告名称" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input maxlength="15" :readonly="true" v-model="scope.row.projectName" ></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="261" field="createTime" title="创建日期" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input maxlength="15" :readonly="true" v-model="scope.row.createTime" ></el-input>
										</template>
									</vxe-table-column>
									<vxe-table-column min-width="261" field="status" title="状态" :edit-render="{}" show-overflow="title">
										<template v-slot:edit="scope">
											<el-input maxlength="15" :readonly="true" v-model="scope.row.status" ></el-input>
										</template>
									</vxe-table-column>
								</vxe-table>
							</el-col>
						</el-row>
					</el-form>
				</el-form >
			</el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
		<template #footer>
			<span class="dialog-footer">
			  <el-button  @click="close()" icon="el-icon-circle-close">关闭</el-button>
			  <el-button  v-if="method === 'edit'" type="primary" icon="el-icon-circle-check" @click="doSubmit('save')">确定</el-button>
			</span>
		</template>
      <WorkClientChooseForm ref="workClientChooseForm" @getWorkClientChoose="getWorkClientChoose"></WorkClientChooseForm>
      <CwProjectBusinessTypeListForm ref="cwProjectBusinessTypeListForm" @getBusinessType="getBusinessType"></CwProjectBusinessTypeListForm>
      <ContractNameForm ref="contractNameForm"></ContractNameForm>
      <InvoiceForm ref="invoiceFormDialog"></InvoiceForm>
      <ReportManagementForm ref="reportManagementForm"></ReportManagementForm>
      <ProjectRecordsForm ref="projectRecordsForm"></ProjectRecordsForm>
		<WorkClientChooseRadio ref="workClientChooseRadio" @getWorkClientRadioChoose="getWorkClientChoose2"></WorkClientChooseRadio>
		<CwConstructionForm ref="cwConstructionForm" @getProgram2="getProgram2"></CwConstructionForm>
	</el-dialog>
  </div>
</template>

<script>
	import CwConstructionForm from '@/views/cw/projectRecords/CwConstructionForm'
	import OSSSerivce, {
		// eslint-disable-next-line no-unused-vars
		beforeAvatarUpload,
		// eslint-disable-next-line no-unused-vars
		openWindowOnUrl,
		// eslint-disable-next-line no-unused-vars
		toHref
	} from '@/api/sys/OSSService'
	import ReportReviewService from '@/api/cw/reportManagement/ReportReviewService'
	import FileForm from '@/views/cw/reportManagement/reportReview/FileForm'
	import UserSelectSignatory from '@/components/userSelectNew'
	import WorkClientChooseRadio from '@/views/cw/workClientInfo/WorkClientChooseRadio'
  import UpLoadComponent from '@/views/common/UpLoadComponent'
  import SelectTree from '@/components/treeSelect/treeSelect.vue'
  import UserSelect from '@/components/userSelect'
  import UserSelectForQualification from '@/components/userSelectForQualification'
  import projectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
  import projectReportService from '@/api/cw/reportManagement/ProjectReportService'
  import WorkClientChooseForm from '../workClientInfo/WorkClientChooseForm'
  import CwProjectBusinessTypeListForm from '@/views/cw/projectBusinessType/CwProjectBusinessTypeListForm'
  import ContractNameForm from '../workContract/ContractNameForm'
  import workClientService from '@/api/cw/workClientInfo/WorkClientService'
  import contractInfoService from '@/api/cw/workContract/contractInfoService'
  import cwFinanceInvoiceService from '@/api/cw/invoice/CwFinanceInvoiceService'
  import userService from '@/api/sys/UserService'
  export default {
    name: 'ProjectRecordsForm',
    props: {
      businessId: {
        type: String,
        default: ''
      },
      formReadOnly: {
        type: Boolean,
        default: false
      },
      status: {
        type: String,
        default: ''
      }
    },
    data () {
      return {
		  engineeringTypeList: [],
        title: '',
        method: '',
        loading: false,
        inputForm: {
			engineeringType: '',
			cwProjectConstructionList: [],
          id: '',
			projectType: '',
          createDate: '',
			projectStartTime: '',
			projectEndTime: '',
          createBy: {
            id: '',
            name: ''
          },
          remarks: '',
          projectNumber: '',
          projectName: '',
          officeId: '',
          projectMoney: '',
          auditYear: '',
          planStartDate: '',
          planEndDate: '',
          projectMasterId: '',
          projectLeaderId: '',
          procInsId: '',
          processDefinitionId: '',
          status: '',
          workAttachmentDtoList: [],
          cwProjectClientInfoDTOList: [],
          contractName: '',
          contractAmount: '',
          contractNum: '',
          payerSubject: '',
          paymentMethod: '',
          contractId: '',
          businessType: '',
          riskLevel: '',
			projectLevel: '',
          businessTypeName: '',
          planDate: [],
          realHeader: '',
          clientContactsName: '',
          reportType: '',
			reportId: '',
          cwProjectClientContactDTOList: [],
          cwProjectMembersDTOList: []
        },
		  programRow: '',
		  programRow2: '',
		  tableKeyConstruction: '3',
		  inputForm2: {
			  customerId: '',  // 客户id
			  address: '',
			  uscCode: '',
			  customerNo: '',
			  contractFees: [],
			  contractFee: '',
			  contractNo: '',
			  contractType: '',
			  contractName: '',
			  payerSubject: '',
			  paymentMethod: '',
			  paymentDescribe: '',
			  signingDate: '',
			  contractAmount: '',
			  predictAmount: '',
			  actualContractAmount: '',
			  contractNum: '2',
			  contractStatus: '新创建',
			  paymentAgreement: '',
			  changeNum: '0',
			  department: '',
			  clientContacts: '',
			  clientContactsPhone: '',
			  createBy: this.$store.state.user.name,
			  createId: this.$store.state.user.id,
			  createTime: '',
			  contractProperList: [],
			  cwWorkClientContactDTOList: [],
			  contractAmountType: '',
			  contractOpposite: '',
			  fees: ''
		  },
		  inputForm3: {
			  id: '',
			  createDate: '',
			  createName: '',
			  createTime: '',
			  remarks: '',
			  projectNumber: '',
			  projectName: '',
			  planFileList: [],
			  planStartDate: '',
			  planEndDate: '',
			  planDetailsList: [],
		  },
		  inputForm4: {
			  reviewByName: '',
			  procInsId3: '',
			  reviewNewId: '',
			  projectLevel: '',
			  memberName: '',
			  enrollCertNo: '',
			  profession: '',
			  professionType: '',
			  projectName: '',
			  projectId: '',
			  projectNumber: '',
			  projectManager: '',
			  projectManagerId: '',
			  projectCreateByName: '',
			  projectCreateTime: '',
			  reviewFee: '',
			  approvalFee: '',
			  contractCategory: '',
			  contractFee: '',
			  contractRate: '',
			  reviewBy: '',
			  verifyFee: '',
			  verifyRate: '',
			  consultFee: '',
			  buildingFee: '',
			  installFee: '',
			  buildingRate: '',
			  installRate: '',
			  workStartDate: '',
			  workEndDate: '',
			  ziXunShouRu: '',
			  detailInfos: [],
			  createBy: {
				  id: '',
				  name: this.$store.state.user.name
			  },
		  },
		  inputForm5: {
			  onlineArchivingProcInsId: '',
			  onlineArchivingId: '',
			  projectId: '',
			  reportNo: '',
			  reportDate: '',
			  contractNo: '',
			  contractName: '',
			  clientName: '',
			  projectNumber: '',
			  applyDates: new Date(),
			  onlineRemarks: '',
			  applyUserName: this.$store.state.user.name,
			  applyUserId: this.$store.state.user.id,
			  projectName: '',
			  createBy: {
				  id: '',
				  name: this.$store.state.user.name
			  },
		  },
		  inputForm6: {
			  paperArchivingStatus: '',
			  paperArchivingId: '',
			  contactInfos: [],
			  constructionParty: [],
			  projectReportInfos: [],
			  contractNo: '',
			  contractName: '',
			  contractAmount: '',
			  clientName: '',
			  contractType: '',
			  projectName: '',
			  projectNumber: '',
			  location: '',
			  projectCreateByName: '',
			  officeId: '',
			  projectManager: '',
			  reportType: '',
			  projectLevel: '',
			  projectMoney: '',
			  planStartDate: '',
			  planEndDate: '',
			  createDate: '',
			  filedNo: '',
			  confirmFiledNo: '',
			  createBy: {
				  id: '',
				  name: this.$store.state.user.name
			  },
		  },
		  amountKey: '',
		  amountKey2: '',
		  amountKey3: '',
		  detailKey: '',
		  tableData: [],
        keyWatch: '',
        activeName: 'client',
        activeNameTop: 'project',
        tableKey: '',
        tableKeyClient: '1',
        tableKeyMembers: '3',
        visible: false,
        invoiceList: [],
        invoiceForm: {
          no: ''
        },
        reportForm: {
          reportNo: '',
          projectName: '',
          projectNumber: ''
        },
        tableKeyContact: '2',
        validContactRules: {
          name: [
            {required: true, message: '姓名不可以为空'}
          ],
          sex: [
            {required: true, message: '性别不可以为空'}
          ],
          officeId: [
            {required: true, message: '部门不可以为空'}
          ],
          position: [
            {required: true, message: '职务不可以为空'}
          ],
          contactFirst: [
            {required: true, message: '联系方式1不可以为空'}
          ]
        }
      }
    },
	  ReportReviewService: null,
    created () {
		this.reportReviewService = new ReportReviewService()
    },
    computed: {
      bus: {
        get () {
          this.$refs.uploadComponent.setDividerName('附件', false)
          this.$refs.uploadComponent2.setDividerName('附件', false)
          this.$refs.uploadComponent3.setDividerName('附件', false)
          return this.businessId
        },
        set (val) {
          this.businessId = val
        }
      }
    },
    watch: {
      'keyWatch': {
        handler (newVal) {
          if (this.commonJS.isNotEmpty(this.bus)) {
            this.init('', this.bus)
          } else {
            this.$nextTick(() => {
              this.$refs.inputForm.resetFields()
            })
          }
        }
      }
    },
    components: {
		CwConstructionForm,
		FileForm,
		UserSelectSignatory,
		WorkClientChooseRadio,
      UpLoadComponent,
      SelectTree,
      UserSelect,
		UserSelectForQualification,
      WorkClientChooseForm,
      CwProjectBusinessTypeListForm,
      ContractNameForm,
      InvoiceForm: () => import('../invoice/InvoiceForm'),
      ReportManagementForm: () => import('../reportManagement/ReportManagementForm')
    },
    methods: {
      getKeyWatch (keyWatch) {
        this.keyWatch = keyWatch
      },
      forUpdate () {
        this.$forceUpdate()
      },
      init (method, id) {
        this.visible = true
        if (method === 'edit') {
          this.title = '项目信息修改'
          this.method = method
        } else {
          this.title = '项目详情'
          this.method = 'view'
        }
        this.activeName = 'client'
        this.activeNameTop = 'project'
        this.inputForm = {
			engineeringType: '',
			cwProjectConstructionList: [],
          id: '',
			projectType: '',
          createDate: '',
          createBy: {
            id: '',
            name: this.$store.state.user.name
          },
          remarks: '',
          projectNumber: '',
          projectName: '',
          officeId: '',
          projectMoney: '',
          auditYear: '',
          planStartDate: '',
          planEndDate: '',
          projectMasterId: '',
          projectLeaderId: '',
          procInsId: '',
          processDefinitionId: '',
          status: '',
          workAttachmentDtoList: [],
          cwProjectClientInfoDTOList: [],
          contractName: '',
          contractAmount: '',
          contractNum: '',
          payerSubject: '',
          paymentMethod: '',
          contractId: '',
          businessType: '',
          riskLevel: '',
			projectLevel: '',
          businessTypeName: '',
          planDate: [],
          realHeader: '',
          clientContactsName: '',
			reportId: '',
          cwProjectClientContactDTOList: [],
          cwProjectMembersDTOList: []
        }
		  this.inputForm2 = {
			  customerId: '',  // 客户id
			  address: '',
			  uscCode: '',
			  customerNo: '',
			  contractFees: [],
			  contractFee: '',
			  contractNo: '',
			  contractType: '',
			  contractName: '',
			  payerSubject: '',
			  paymentMethod: '',
			  paymentDescribe: '',
			  signingDate: '',
			  fees: '',
			  contractAmount: '',
			  predictAmount: '',
			  actualContractAmount: '',
			  contractNum: '',
			  contractStatus: '',
			  paymentAgreement: '',
			  changeNum: '',
			  department: '',
			  clientContacts: '',
			  clientContactsPhone: '',
			  createBy: this.$store.state.user.name,
			  createId: this.$store.state.user.id,
			  createTime: '',
			  contractProperList: [],
			  cwWorkClientContactDTOList: [],
			  contractAmountType: '',
			  contractOpposite: ''
		  }
		  this.inputForm3 = {
			  id: '',
			  createName: '',
			  createTime: '',
			  remarks: '',
			  projectNumber: '',
			  projectName: '',
			  planFileList: [],
			  planStartDate: '',
			  planEndDate: '',
			  planDetailsList: []
		  }
		  this.inputForm4 = {
			  reviewByName: '',
			  procInsId3: '',
			  reviewNewId: '',
			  projectLevel: '',
			  memberName: '',
			  enrollCertNo: '',
			  profession: '',
			  professionType: '',
			  projectName: '',
			  projectId: '',
			  projectNumber: '',
			  projectManager: '',
			  projectManagerId: '',
			  projectCreateByName: '',
			  projectCreateTime: '',
			  reviewFee: '',
			  approvalFee: '',
			  contractCategory: '',
			  contractFee: '',
			  contractRate: '',
			  reviewBy: '',
			  verifyFee: '',
			  verifyRate: '',
			  consultFee: '',
			  buildingFee: '',
			  installFee: '',
			  buildingRate: '',
			  installRate: '',
			  workStartDate: '',
			  workEndDate: '',
			  ziXunShouRu: '',
			  detailInfos: [],
			  createBy: {
				  id: '',
				  name: this.$store.state.user.name
			  },
		  }
		  this.inputForm5 = {
			  onlineArchivingProcInsId: '',
			  onlineArchivingId: '',
			  projectId: '',
			  reportNo: '',
			  reportDate: '',
			  contractNo: '',
			  contractName: '',
			  clientName: '',
			  projectNumber: '',
			  applyDates: '',
			  onlineRemarks: '',
			  applyUserName: '',
			  applyUserId: '',
			  projectName: '',
			  createBy: {
				  id: '',
				  name: this.$store.state.user.name
			  },
		  }
		  this.inputForm6 = {
			  paperArchivingStatus: '',
			  paperArchivingId: '',
			  contactInfos: [],
			  constructionParty: [],
			  projectReportInfos: [],
			  contractNo: '',
			  contractName: '',
			  contractAmount: '',
			  clientName: '',
			  contractType: '',
			  projectName: '',
			  projectNumber: '',
			  location: '',
			  projectCreateByName: '',
			  officeId: '',
			  projectManager: '',
			  reportType: '',
			  projectLevel: '',
			  projectMoney: '',
			  planStartDate: '',
			  planEndDate: '',
			  createDate: '',
			  filedNo: '',
			  confirmFiledNo: '',
			  createBy: {
				  id: '',
				  name: this.$store.state.user.name
			  },
		  }
		  this.engineeringTypeList = []
        this.inputForm.id = id
        this.loading = false
        this.$nextTick(() => {
          this.$refs.inputForm.resetFields()
          this.loading = true
          projectRecordsService.queryById(this.inputForm.id).then((data) => {
			  this.engineeringTypeList = data.engineeringTypeList
            this.$refs.uploadComponent.clearUpload()
            this.inputForm = this.recover(this.inputForm, data)
            this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
            if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
              this.inputForm.workAttachmentDtoList = []
            }
            if (this.commonJS.isEmpty(this.inputForm.createDate)) {
              this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
            }
            if (this.commonJS.isEmpty(this.inputForm.createBy.name)) {
              this.inputForm.createBy.name = this.$store.state.user.name
            }
            if (this.commonJS.isEmpty(this.inputForm.cwProjectClientContactDTOList)) {
              this.inputForm.cwProjectClientContactDTOList = []
            }
            if (this.commonJS.isEmpty(this.inputForm.officeId)) {
              this.inputForm.officeId = this.$store.state.user.office.id
            }
			  if (this.commonJS.isEmpty(this.inputForm.cwProjectConstructionList)) {
				  this.inputForm.cwProjectConstructionList = []
			  }
            if (this.commonJS.isEmpty(this.inputForm.cwProjectMembersDTOList)) {
              this.inputForm.cwProjectMembersDTOList = []
            } else {
              this.inputForm.cwProjectMembersDTOList.forEach((member, index) => {
                userService.queryDetailById(member.userId).then((data) => {
                  member.name = this.commonJS.isEmpty(data.name) ? '' : data.name
                  member.mobile = this.commonJS.isEmpty(data.mobile) ? '' : data.mobile
                  member.officeName = this.commonJS.isEmpty(data.officeDTO) ? '' : this.commonJS.isEmpty(data.officeDTO.name) ? '' : data.officeDTO.name
                  member.roleName = this.commonJS.isEmpty(data.roleList) ? '' : data.roleList.map(role => { return this.commonJS.isEmpty(role.name) ? '' : role.name }).join(',')
                  this.tableKeyMembers = Math.random()
                })
              })
            }
            // if (this.formReadOnly) {
            //   this.method = 'view'
            // }
            this.$refs.uploadComponent.newUpload(this.method, this.inputForm.workAttachmentDtoList, 'cw_project_records', null, null, null, null, false)
            if (this.commonJS.isEmpty(this.inputForm.cwProjectClientInfoDTOList)) {
              this.inputForm.cwProjectClientInfoDTOList = []
            }
            if (this.commonJS.isEmpty(this.inputForm.projectMasterId) && this.method !== 'view') {
              this.inputForm.projectMasterId = this.$store.state.user.id
            }
            if (this.commonJS.isEmpty(this.inputForm.projectLeaderId) && this.method !== 'view') {
              this.inputForm.projectLeaderId = this.$store.state.user.id
            }
            if (this.commonJS.isEmpty(this.inputForm.projectMoney)) {
              this.inputForm.projectMoney = 0
            }
            //获取合同相关信息
			  contractInfoService.findById(this.inputForm.contractId).then((data) => {
				  this.$refs.uploadComponent2.clearUpload()
				  this.inputForm2 = this.recover(this.inputForm2, data)
				  if (this.inputForm2.contractNo) {
					  this.contractNoFlag = true
				  } else {
					  this.contractNoFlag = false
				  }
				  if (this.commonJS.isEmpty(this.inputForm2.contractAmountType)) {
					  this.inputForm2.contractAmountType = '1'
				  }
				  if (this.commonJS.isEmpty(this.inputForm2.department)) {
					  this.inputForm2.department = this.$store.state.user.office.id
				  }
				  // 对数值进行判断是否为空,为空则赋值默认值
				  if (this.inputForm2.contractStatus === undefined || this.inputForm2.contractStatus === '') {
					  this.inputForm2.contractStatus = '新创建'
				  }
				  if (this.inputForm2.contractNum === undefined || this.inputForm2.contractNum === '') {
					  this.inputForm2.contractNum = '2'
				  }
				  if (this.inputForm2.changeNum === undefined || this.inputForm2.changeNum === '') {
					  this.inputForm2.changeNum = '0'
				  }
				  if (this.inputForm2.createBy === undefined || this.inputForm2.createBy === '') {
					  this.inputForm2.createBy = this.$store.state.user.name
				  }
				  if (this.inputForm2.createId === undefined || this.inputForm2.createId === '') {
					  this.inputForm2.createId = this.$store.state.user.id
				  }
				  if (this.commonJS.isEmpty(this.inputForm2.createTime)) {
					  this.inputForm2.createTime = this.moment(new Date()).format('YYYY-MM-DD')
				  }
				  const f = []
				  if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
					  data.fees.split(',').forEach(item => {
						  if (item !== null && item !== undefined && item !== '') {
							  f.push(item)
						  }
					  })
				  }
				  this.inputForm2.contractFees = f
				  if (this.status === 'audit' || this.status === 'taskFormDetail') {
					  method = 'view'
				  }
				  this.$refs.uploadComponent2.newUpload(method, this.inputForm2.contractProperList, 'cwWorkContract', null, null, null, null, false)
				  // this.$refs.archiveFile.newUpload('view', [], 'cwWorkContract', null, null, null, null, false)
				  this.loading = false
			  })
			  //获取项目计划信息
			  projectRecordsService.queryPlanById(this.inputForm.id).then((data) => {
				  console.log('data',data)
				  this.$refs.uploadComponent3.clearUpload()

				  this.inputForm3 = this.recover(this.inputForm3, data)
				  this.inputForm3 = JSON.parse(JSON.stringify(this.inputForm3))
				  this.inputForm3.planStartDate = this.moment(data.planStartDate).format('YYYY-MM-DD')
				  this.inputForm3.planEndDate = this.moment(data.planEndDate).format('YYYY-MM-DD')

				  if (this.commonJS.isEmpty(this.inputForm3.planDetailsList)) {
					  this.inputForm3.planDetailsList = []
					  let phase = this.$dictUtils.getDictList('cw_project_plan_phase')
					  console.log('phase',phase)
					  phase.forEach((item) => {
						  console.log('item', item)
						  let a = {
							  taskPhase: item.label,
							  planStartDate: '',
							  planEndDate: '',
							  warnName: this.$store.state.user.name,
							  warnUser:this.$store.state.user.id,
							  achiever:this.$store.state.user.id,
							  achieverName: this.$store.state.user.name,
						  }
						  this.$refs.detailTable.insertAt(a)
						  this.inputForm3.planDetailsList.push(a)
						  this.detailkey = Math.random()
					  })
					  var li = this.inputForm3.planDetailsList.length - 1
					  console.log('this.inputForm3.planStartDate',this.inputForm3.planDetailsList)
					  if (this.commonJS.isNotEmpty(this.inputForm3.planStartDate)) {
						  this.inputForm3.planDetailsList[0].planStartDate = this.inputForm3.planStartDate
					  }
					  if (this.commonJS.isNotEmpty(this.inputForm3.planEndDate)) {
						  this.inputForm3.planDetailsList[li].planEndDate = this.inputForm3.planEndDate
					  }
				  }

				  this.$refs.uploadComponent3.newUpload(this.method, this.inputForm3.planFileList, 'cw_project_plan', null, '项目计划附件信息', null, null, false)

				  this.loading = false
			  })
			//  获取质量复核信息
			  projectReportService.queryByIdNew(this.inputForm.reportId).then((data) => {
				  this.inputForm4 = this.recover(this.inputForm4, data)

				  if (this.commonJS.isEmpty(this.inputForm4.contractCategory)) {
					  this.inputForm4.contractCategory = '1'
				  }

				  // 根据证书类型  获取字典值
				  let professionList = this.getProfessionList(this.inputForm4.professionType)
				  if (this.commonJS.isEmpty(this.inputForm4.detailInfos)) {
					  professionList.forEach(item => {
						  if (item.value == this.inputForm4.profession) {
							  this.inputForm4.profession = item.label
						  }
					  })
					  let d = {
						  memberName: this.inputForm4.memberName,
						  userId: this.inputForm4.projectManagerId,
						  userRole: '负责人',
						  enrollCertNo: this.inputForm4.enrollCertNo,
						  profession: this.inputForm4.profession,
					  }
					  this.inputForm4.detailInfos = []
					  this.inputForm4.detailInfos.push(d)
					  this.detailKey = Math.random()
				  } else {
					  this.reportReviewService.getUserInfo(this.inputForm4.reviewBy).then((data) => {
						  this.inputForm4.detailInfos.forEach(item => {
							  professionList = this.getProfessionList(item.professionType)
							  professionList.forEach(item2 => {
								  if (item.profession == item2.value) {
									  item.profession = item2.label
								  }
								  if (item.userRole === '技术负责人') {
									  item.memberName = data.memberName + '(' + this.inputForm4.reviewByName + '代)'
								  }
							  })
						  })
					  })
				  }
					console.log('我到这里来')
					console.log('data.projectId', data.projectId)
					console.log('this.inputForm4.id', this.inputForm4.id)
				  projectReportService.getAttachmentList(data.projectId,this.inputForm.reportId,'').then((data) => {
					  this.tableData = data
					  this.tableKey = Math.random()
				  })
				  this.loading = false
			  })
			  // 获取线上归档信息
			  projectReportService.queryByIdNew(this.inputForm.reportId).then((data) => {
				  if (data) {
					  this.inputForm5 = this.recover(this.inputForm5, data)

					  if (this.commonJS.isEmpty(this.inputForm5.applyUserId)) {
						  this.inputForm5.applyUserId = this.$store.state.user.id
						  this.inputForm5.applyUserName = this.$store.state.user.name
					  }
					  if (this.commonJS.isEmpty(this.inputForm5.applyDates)) {
						  this.inputForm5.applyDates = this.moment(new Date()).format('YYYY-MM-DD')
					  }
					  this.loading = false
				  }

			  })
			//  获取纸质归档信息
			  projectReportService.queryByIdNew(this.inputForm.reportId).then((data) => {
				  if (data) {
					  this.inputForm6 = this.recover(this.inputForm6, data)
					  this.loading = false
				  }

			  })
            this.loading = false
          })
        })
      },
      saveForm (callback) {
        this.doSubmit('save', callback)
      },
      startForm (callback) {
        this.doSubmit('start', callback)
      },
      async agreeForm (callback) {
        await projectRecordsService.queryById(this.inputForm.id).then((data) => {
          if (data.status !== '2') { // 审核状态不是“待审核”，就弹出提示
            this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
            throw new Error()
          } else {
            this.doSubmit('agree', callback)
          }
        })
      },
      // 表单提交
      doSubmit (status, callback) {
        if (status === 'save') {
          this.$refs['inputForm'].validate((valid) => {
            if (valid) {
              // 暂存
              // this.inputForm.status = '1'
              this.loading = true
              if (this.commonJS.isEmpty(this.inputForm.cwProjectClientContactDTOList)) {
                this.loading = false
                this.$message.error('“客户联系人”中至少填写一条信息')
                throw new Error('“客户联系人”中至少填写一条信息')
              }
              this.contactSubmit()
              this.inputForm.planStartDate = this.inputForm.planDate[0]
              this.inputForm.planEndDate = this.inputForm.planDate[1]
              if (this.$refs.uploadComponent.checkProgress()) {
                this.loading = false
                return
              }
              this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
              // this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
              projectRecordsService.saveForm(this.inputForm).then((data) => {
                // callback(data.businessTable, data.businessId, this.inputForm)
                this.$emit('refreshList')
                this.close()
                this.loading = false
              }).catch(() => {
                this.loading = false
              })
            }
          })
        } else if (status === 'start') {
          // 送审  待审核
          this.inputForm.status = '2'
        } else if (status === 'agree') {
          // 审核同意
          this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
          this.inputForm.agreeUserId = this.$store.state.user.id
          this.inputForm.status = '5'
        }
        this.$refs['inputForm'].validate((valid) => {
          if (valid) {
            this.loading = true
            if (this.$refs.uploadComponent.checkProgress()) {
              this.loading = false
              return
            }
            this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
            if (this.commonJS.isEmpty(this.inputForm.createDate)) {
              this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
            }
            projectRecordsService.saveForm(this.inputForm).then((data) => {
              callback(data.businessTable, data.businessId, this.inputForm)
              this.loading = false
            }).catch(() => {
              this.loading = false
            })
          }
        })
      },
      async updateStatusById (type) {
        if (type === 'reject' || type === 'reback') {
          if (await this.$refs.uploadComponent.checkProgress()) {
            this.loading = false
            throw new Error()
          }
          await projectRecordsService.queryById(this.inputForm.id).then((data) => {
            if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
              this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
              throw new Error()
            } else {
              if (type === 'reject') {
                // 驳回
                this.inputForm.status = '4'
                let param = {status: '4', id: this.inputForm.id}
                projectRecordsService.updateStatusById(param)
              }
              if (type === 'reback') {
                // 撤回
                let param = {status: '3', id: this.inputForm.id}
                projectRecordsService.updateStatusById(param)
              }
            }
          })
        }
      },
      close () {
		  this.engineeringTypeList = []
        this.inputForm = {
			engineeringType: '',
			cwProjectConstructionList: [],
          id: '',
			projectType: '',
          createDate: '',
			projectStartTime: '',
			projectEndTime: '',
          createBy: {
            id: '',
            name: ''
          },
          remarks: '',
          projectNumber: '',
          projectName: '',
          officeId: '',
          projectMoney: '',
          auditYear: '',
          planStartDate: '',
          planEndDate: '',
          projectMasterId: '',
          projectLeaderId: '',
          procInsId: '',
          processDefinitionId: '',
          status: '',
          workAttachmentDtoList: [],
          cwProjectClientInfoDTOList: [],
          contractName: '',
          contractAmount: '',
          contractNum: '',
          payerSubject: '',
          paymentMethod: '',
          contractId: '',
          businessType: '',
          riskLevel: '',
			projectLevel: '',
          businessTypeName: '',
          planDate: [],
          realHeader: '',
          clientContactsName: '',
			reportId: '',
          cwProjectClientContactDTOList: [],
          cwProjectMembersDTOList: []
        }
        this.$refs.uploadComponent.clearUpload()
        this.$refs.inputForm.resetFields()
        this.$emit('refreshList')
        this.visible = false
      },
      tabHandleClick (event) {
		  // console.log(event)
      },
      tabHandleClickTop (event) {
      	if (event.props.name === 'project') {
			this.activeName = 'client'
		}
      	if (event.props.name === 'contract') {
			this.activeName = 'contractProper'
		}

        // console.log(event)
		  console.log('event', event.props.name)
      },
      // 新增
      // eslint-disable-next-line no-dupe-keys
      insertEvent (type) {
        if (type === 'client') {
          let d = {
            no: '',
            name: '',
            companyLevel: ''
          }
          if (this.commonJS.isEmpty(this.inputForm.cwProjectClientInfoDTOList)) {
            this.inputForm.cwProjectClientInfoDTOList = []
          }
          this.$refs.clientTable.insertAt(d)
          this.inputForm.cwProjectClientInfoDTOList.push(d)
          this.tableKeyClient = Math.random()
        }
        if (type === 'contact') {
          let d = {
            contactFirst: '',
            contactSecond: '',
            email: '',
            fax: '',
            name: '',
            officeId: '',
            position: '',
            remarks: '',
            sex: ''
          }
          if (this.commonJS.isEmpty(this.inputForm.cwProjectClientContactDTOList)) {
            this.inputForm.cwProjectClientContactDTOList = []
          }
          this.$refs.contactTable.insertAt(d)
          this.inputForm.cwProjectClientContactDTOList.push(d)
          this.tableKeyContact = Math.random()
        }
      },
      // 删除
      removeEvent (row, rowIndex, type) {
        if (type === 'client') {
          this.$refs.clientTable.remove(row)
          this.inputForm.cwProjectClientInfoDTOList.splice(rowIndex, 1)
        }
        if (type === 'contact') {
          this.$refs.contactTable.remove(row)
          this.inputForm.cwProjectClientContactDTOList.splice(rowIndex, 1)
        }
		  if (type === 'construction') {
			  this.$refs.construction.remove(row)
			  this.inputForm.cwProjectConstructionList.splice(rowIndex, 1)
		  }
      },
      openWorkClient () {
        this.$refs.workClientChooseForm.init()
      },
      getWorkClientChoose (list) {
        if (this.commonJS.isEmpty(this.inputForm.cwProjectClientInfoDTOList)) {
          this.inputForm.cwProjectClientInfoDTOList = []
        }
        let _this = this
        let _list = list
        const waitForEach = function () {
          return new Promise(function (resolve, reject) {
            _list.forEach((item) => {
              _this.inputForm.cwProjectClientInfoDTOList.forEach(client => {
                if (item.no === client.no) {
                  _this.$message.error('已存在客户 “' + client.name + '”，请重新选择')
                  throw new Error('已存在客户 “' + client.name + '”，请重新选择')
                }
              })
            })
            resolve()
          })
        }
        waitForEach().then(() => {
          list.forEach(item => {
            this.$refs.clientTable.insertAt(item)
            this.inputForm.cwProjectClientInfoDTOList.push(item)
            this.tableKeyClient = Math.random()
          })
        })
      },
      getBusinessType (row) {
        this.inputForm.businessType = row.id
        this.inputForm.businessTypeName = row.name
      },
      openBusinessTypeForm () {
        this.$refs.cwProjectBusinessTypeListForm.init()
      },
      viewInvoice (flag, id) {
        this.$refs.invoiceFormDialog.init(flag, id)
      },
      blurEmail (index) {
        if (this.commonJS.isNotEmpty(this.inputForm.cwProjectClientContactDTOList[index].email)) {
          if (!this.validateXG.isEmail(this.inputForm.cwProjectClientContactDTOList[index].email)) {
            this.$message.error('客户联系人中，第' + (index + 1) + '条数据的“邮箱”填写错误，请重新填写')
            this.inputForm.cwProjectClientContactDTOList[index].email = ''
            throw new Error('客户联系人中，第' + (index + 1) + '条数据的“邮箱”填写错误，请重新填写')
          }
        }
      },
      contactSubmit () {
        this.inputForm.cwProjectClientContactDTOList.forEach((item, index) => {
          if (this.commonJS.isNotEmpty(item.email)) {
            if (!this.validateXG.isEmail(item.email)) {
              this.$message.error('客户联系人中，第' + (index + 1) + '条数据的“邮箱”填写错误')
              this.loading = false
              throw new Error('客户联系人中，第' + (index + 1) + '条数据的“邮箱”填写错误')
            }
          }
          if (this.commonJS.isEmpty(item.name)) {
            this.$message.error('客户联系人中，第' + (index + 1) + '条数据的“姓名”未填写')
            this.loading = false
            throw new Error('客户联系人中，第' + (index + 1) + '条数据的“姓名”未填写')
          }
          if (this.commonJS.isEmpty(item.sex)) {
            this.$message.error('客户联系人中，第' + (index + 1) + '条数据的“性别”未填写')
            this.loading = false
            throw new Error('客户联系人中，第' + (index + 1) + '条数据的“性别”未填写')
          }
          if (this.commonJS.isEmpty(item.officeId)) {
            this.$message.error('客户联系人中，第' + (index + 1) + '条数据的“部门”未填写')
            this.loading = false
            throw new Error('客户联系人中，第' + (index + 1) + '条数据的“部门”未填写')
          }
          if (this.commonJS.isEmpty(item.position)) {
            this.$message.error('客户联系人中，第' + (index + 1) + '条数据的“职务”未填写')
            this.loading = false
            throw new Error('客户联系人中，第' + (index + 1) + '条数据的“职务”未填写')
          }
          if (this.commonJS.isEmpty(item.contactFirst)) {
            this.$message.error('客户联系人中，第' + (index + 1) + '条数据的“联系方式1”未填写')
            this.loading = false
            throw new Error('客户联系人中，第' + (index + 1) + '条数据的“联系方式1”未填写')
          }
        })
      },
		openWorkClient2 () {
			this.$refs.workClientChooseRadio.init()
		},
		getWorkClientChoose2 (list) {
			if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
				this.inputForm.cwWorkClientContactDTOList = []
			}
			// console.log('list', list)
			let _this = this
			// eslint-disable-next-line no-unused-vars
			let _list = list
			let _num = 0
			const waitForEach = function () {
				return new Promise(function (resolve, reject) {
					if (_this.commonJS.isEmpty(_this.inputForm.cwWorkClientContactDTOList)) {
						resolve()
					} else {
						_this.inputForm.cwWorkClientContactDTOList.forEach((client, index) => {
							if (_this.inputForm.customerNo === client.no) {
								_this.$refs.contactTable.remove(client)
								_this.inputForm.cwWorkClientContactDTOList.splice(index, 1)
							}
						})
						setTimeout(() => {
							resolve()
						}, 400)
					}
				})
			}
			waitForEach().then(() => {
				this.inputForm.customerNo = list.no
				this.inputForm.uscCode = list.uscCode
				this.inputForm.address = list.address
				this.inputForm.customerId = list.id
				this.inputForm.clientContacts = list.name
				this.inputForm.clientContactsPhone = list.mobile
				const wait = function () {
					return new Promise(function (resolve, reject) {
						_this.inputForm.cwWorkClientContactDTOList.forEach(client => {
							if (_list.no === client.no) {
								_num = 1
							}
						})
						setTimeout(() => {
							resolve()
						}, 100)
					})
				}
				wait().then(() => {
					if (_num === 0) {
						this.inputForm.cwWorkClientContactDTOList.push({no: list.no, name: list.name})
						this.$refs.contactTable.insertAt({no: list.no, name: list.name})
						this.tableKeyClient = Math.random()
					}
				})
			})
		},
		// 自定义服务端导出
		exportPlan() {
			let optionName = this.inputForm3.projectName+"项目计划.xls"
			// 传给服务端的参数
			const params = {
				id: this.inputForm3.id,
				mode:'all'
			}
			return projectRecordsService.exportPlan(params).then((res) => {
				// 将二进制流文件写入excel表，以下为重要步骤
				this.$utils.downloadExcel(res,  optionName)
			}).catch(function (err) {
				if (err.response) {
					console.log(err.response)
				}
			})
		},
		getProfessionList(type) {
			switch (type) {
				case '1':
				case '2':
					return this.$dictUtils.getDictList('sys_cert_profession_build');
				case '3':
				case '4':
					return this.$dictUtils.getDictList('sys_cert_profession_cost');
				case '5':
					return this.$dictUtils.getDictList('sys_cert_profession_supervision');
				case '6':
					return this.$dictUtils.getDictList('sys_cert_profession_accounting');
				default:
					return [];
			}
		},
		getFiles(){
			projectReportService.getAttachmentList(this.inputForm4.projectId,this.inputForm.reportId,'').then((data) => {
				this.tableData = data
				this.tableKey = Math.random()
			})

		},
		ifName (row) {
			if (this.commonJS.isEmpty(row.attachmentName)) {
				row.attachmentName = '---'
				return false
			}
			let suffix = row.attachmentName.substring(row.attachmentName.lastIndexOf('.') + 1)
			if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
				return true
			} else {
				return false
			}
		},
		//测试按钮
		openFileForm(id,typeId){
			console.log('this.id', id )
			this.$refs.fileForm.init("add", id,this.inputForm4.projectId)
		},
		toHref (row) {
			console.log("toHref",row)
			toHref(row)
		},
		getSize (value) {
			if (this.commonJS.isEmpty(value)) {
				return ''
			} else {
				let val = parseInt(value)
				let k = 1024
				let sizes = ['B', 'KB', 'MB', 'GB', 'PB', 'TB', 'EB', 'ZB', 'YB']
				let i = Math.floor(Math.log(val) / Math.log(k))
				let result = val / Math.pow(k, i);
				let kb = parseFloat(result.toPrecision(3));
				return kb + '' + sizes[i]
			}
		},
		ziXunShouRuRange(rule, value, callback) {
			if (!value || value.trim() === "") {
				callback(new Error('造价咨询营业收入不能为空！'));
			} else if (parseFloat(value) <= 0) {
				callback(new Error('造价咨询营业收入必须大于0！'));
			} else {
				callback();
			}
		},
		openConstructionForm () {
			this.$refs.cwConstructionForm.init()
			if (this.inputForm.cwProjectConstructionList.length > 0) {
				this.programRow2 = this.inputForm.cwProjectConstructionList.length
			} else {
				this.programRow2 = this.inputForm.cwProjectConstructionList.length
			}
		},
		getProgram2 (rows) {
			console.log('rows', rows)
			rows.forEach((item, index) => {
				if (index === 0) {
					let d = {
						name: '',
						clientName: '',
						contactFirst: '',
						contactSecond: '',
						clientId: ''
					}
					this.$refs.construction.insertAt(d)
					this.inputForm.cwProjectConstructionList.push(d)
					this.tableKeyConstruction = Math.random()

					let r = this.inputForm.cwProjectConstructionList[this.programRow2]
					r.name = item.name
					r.clientName = item.clientName
					r.contactFirst = item.contactFirst
					r.contactSecond = item.contactSecond
					r.clientId = item.clientId
					this.inputForm.cwProjectConstructionList[this.programRow2] = r
				} else {
					let r = {
						name: item.name,
						clientName: item.clientName,
						contactFirst: item.contactFirst,
						contactSecond: item.contactSecond,
						clientId: item.clientId
					}
					this.inputForm.cwProjectConstructionList.push(r)
					this.tableKeyConstruction = Math.random()
				}
			})
			this.$forceUpdate()
			this.programRow2 = ''
		},
    }
  }
</script>
<style scoped>
  /deep/ .el-input-number .el-input__inner {
    text-align: left;
  }
</style>
