龚焕茏
2024-04-24 130d63cd0b0e39e26e7826440814e5f8ed1d9e1e
合同导入模板生成、导入合同及规则、合同规则展示
1个文件已修改
49 ■■■■ 已修改文件
src/views/system/contract/index.vue 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/contract/index.vue
@@ -33,21 +33,19 @@
        <el-collapse v-model="activeNames" @change="handleChange">
          <el-collapse-item  v-for="(item, index) in ruleData" :key="index" :title="item.ruleName" :name="index">
            <div class="inline-input-container" v-for="(item, index) in item.children" :key="index">
              {{ item.ruleDesc }} <br/>
              {{ item.ruleCondition }} {{ item.deductCategory }} {{ item.calcFraction }}{{ item.calcUnit ? "/" + item.calcUnit : item.calcUnit  }}
              <b>{{ item.ruleDesc }}</b> <br v-if="item.ruleDesc"/>
              <el-tooltip class="item" effect="dark" :content="item.deductCategory + ' ' + item.calcFraction + (item.calcUnit ? '/' + item.calcUnit : '')" placement="top">
                <span>{{ item.ruleCondition }}</span>
                <!-- {{ item.deductCategory }} {{ item.calcFraction }}{{ item.calcUnit ? "/" + item.calcUnit : ''  }} -->
            </el-tooltip>
            </div>
          </el-collapse-item>
          <el-form-item label="合同附件" prop="certificates">
            <el-upload>
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">请上传大小不超过 5MB 格式为 doc/xls/ppt/txt/pdf/png/jpg 的文件</div>
            </el-upload>
          <el-form-item label="合同附件" prop="attachment" class="top">
            <file-upload v-model="form.attachment"/>
          </el-form-item>
          <el-dialog :visible.sync="dialogVisible" append-to-body="false">
            <img width="100%" :src="dialogImageUrl" alt="">
          </el-dialog>
            <el-link class="top" v-for="item in contractInfo.attachment != null ? contractInfo.attachment.split(',') : contractInfo.attachment" :underline="false" :key="item" @click="handleDownload(item)">{{ item.substring(item.lastIndexOf("/") + 1) }}</el-link>
          <div style="text-align: right; margin-top: 10px;">
            <el-button type="primary" @click="submitForm1(props.row)">提交</el-button>
            <el-button type="primary" @click="submitForm">提交</el-button>
          </div>
        </el-collapse>
      </el-form>
@@ -95,7 +93,7 @@
</template>
<script>
import { listContract, getContract } from "@/api/platform/contract";
import { listContract, getContract, updateContract } from "@/api/platform/contract";
import { getRuleListByContractId } from "../../../api/platform/calculate-rule";
import { unitSelect } from "../../../api/platform/unit";
import { deptSelect } from "../../../api/system/dept";
@@ -105,6 +103,7 @@
  name: "Contract",
  data() {
    return {
      contractInfo: {},
      // 合同导入参数
      upload: {
        // 是否显示弹出层(合同导入)
@@ -178,6 +177,15 @@
    this.selectDept();
  },
  methods: {
    submitForm() {
      updateContract(this.form).then(response => {
        if (response.code != 200) {
          this.$message.error("操作失败");
        } else {
          this.$message.success("操作成功");
        }
      });
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "合同导入";
@@ -197,7 +205,11 @@
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$message.success("操作成功");
      if (response.code != 200) {
        this.$message.warning(response.msg);
      } else {
        this.$message.success(response.msg);
      }
      this.getList();
    },
    // 提交上传文件
@@ -246,6 +258,8 @@
    getRuleList(item) {
      getRuleListByContractId(item.id).then(response => {
        this.ruleData = response.data;
        this.form.id = item.id;
        this.contractInfo = item;
      });
    },
    /** 新增按钮操作 */
@@ -270,6 +284,10 @@
        this.title = "修改合同";
      });
    },
    /** 下载按钮操作 */
    handleDownload (data) {
      this.$download.resource(data);
    }
  }
};
</script>
@@ -321,4 +339,9 @@
.clearfix:after {
  clear: both
}
.top {
  display: block;
  margin-top: 10px;
}
</style>