| | |
| | | <template> |
| | | <div class="app-container"> |
| | | |
| | | <el-row> |
| | | <el-row v-loading="loading"> |
| | | <el-col :span="8" v-for="(item, index) in contractList" :key="index" style="margin: 10px;width: 30%;"> |
| | | <el-card :body-style="{ padding: '0px' }"> |
| | | <el-image style="width: 420px;height: 187px;" |
| | |
| | | <span>{{ item.ruleCondition }}<br/></span> |
| | | <!-- {{ item.deductCategory }} {{ item.calcFraction }}{{ item.calcUnit ? "/" + item.calcUnit : '' }} --> |
| | | </el-tooltip> |
| | | </div> |
| | | </el-collapse-item> |
| | | <el-collapse-item title="考核结果应用规则" :name="ruleData.length"> |
| | | <div class="inline-input-container"> |
| | | <span v-for="(item, index) in moneyRules" :key="index"> |
| | | <div> |
| | | <span>{{ item.scoreCondition }}</span> |
| | | <el-tooltip class="item" effect="dark" :content="item.description" placement="top"> |
| | | <span style="margin-left: 20px;">{{ item.description }}</span> |
| | | </el-tooltip> |
| | | </div> |
| | | </span> |
| | | </div> |
| | | </el-collapse-item> |
| | | <el-form-item label="合同附件" prop="attachment" class="top"> |
| | |
| | | <div class="row-right" style="margin-left: 80px;"> |
| | | <div class="margin-5"> |
| | | <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" |
| | | :action="upload.url + '?unitId=' + upload.unitId + '&startTime=' + upload.startTime + '&endTime=' + upload.endTime + '&name=' + upload.name" |
| | | :action="upload.url" |
| | | :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" |
| | | :file-list="upload.fileList" |
| | | :data="upload" |
| | | :auto-upload="false" drag style="text-align: center;"> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listContract, getContract, updateContract, addContract } from "@/api/platform/contract"; |
| | | import { listContract, getContract, updateContract } from "@/api/platform/contract"; |
| | | import { getRuleListByContractId } from "../../../api/platform/calculate-rule"; |
| | | import { getMoneyRulesByContractId } from "../../../api/platform/calculate-money-rule"; |
| | | import { unitSelect } from "../../../api/platform/unit"; |
| | | import { deptSelect } from "../../../api/system/dept"; |
| | | import { getToken } from "@/utils/auth"; |
| | |
| | | name: "Contract", |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | contractInfo: {}, |
| | | // 合同导入参数 |
| | | upload: { |
| | |
| | | // 上传的地址 |
| | | url: process.env.VUE_APP_BASE_API + "/system/contract/importData", |
| | | ruleList: [], |
| | | fileList: [], |
| | | unitId: '', |
| | | startTime: '', |
| | | endTime: '' |
| | |
| | | // 是否显示详情 |
| | | detail: false, |
| | | ruleData: [], |
| | | moneyRules: [], |
| | | // 表单参数 |
| | | form: { |
| | | }, |
| | |
| | | let that = this; |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | addContract(this.upload).then (response => { |
| | | if (response.code != 200) { |
| | | this.$message.error("操作失败"); |
| | | } else { |
| | | this.$message.success("操作成功"); |
| | | } |
| | | that.upload.ruleList = JSON.stringify(this.upload.ruleList); |
| | | that.loading = true; |
| | | that.upload.open = false; |
| | | that.$refs.upload.submit().then(() => { |
| | | that.loading = false; |
| | | that.reset(); |
| | | }); |
| | | // that.$refs.upload.submit(); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.form.id = item.id; |
| | | this.contractInfo = item; |
| | | }); |
| | | getMoneyRulesByContractId(item.id).then(response => { |
| | | this.moneyRules = response.data; |
| | | }); |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | |
| | | /** 下载按钮操作 */ |
| | | handleDownload (data) { |
| | | this.$download.resource(data); |
| | | }, |
| | | reset () { |
| | | this.upload = { |
| | | open: false, |
| | | name: undefined, |
| | | unitId: undefined, |
| | | timezone: undefined, |
| | | ruleList: [] |
| | | }; |
| | | this.resetForm("form"); |
| | | } |
| | | } |
| | | }; |