Pārlūkot izejas kodu

县级提交接口联调功能实现

maxiaoxiao 1 mēnesi atpakaļ
vecāks
revīzija
e2680aa390

+ 209 - 0
src/views/remote/farmland/components/shdialog.vue

@@ -0,0 +1,209 @@
+<template>
+  <!-- 审核详情 -->
+  <el-dialog :title="diatitle" v-model="open" width="500px" append-to-body>
+    <el-form
+      ref="dkjbxxRef"
+      :model="resultform"
+      :rules="rules"
+      label-width="100px"
+    >
+      <el-form-item label="图斑编号:" prop="dkbh">
+        {{ resultform.dkbh }}
+      </el-form-item>
+      <el-form-item label="审核结论:" prop="endTime">
+        <el-radio-group v-model="resultform.decide" :disabled="!issh">
+          <el-radio label="0" size="large" border>通过</el-radio>
+          <el-radio label="1" size="large" border>不通过</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="审核说明:" prop="notes" :disabled="!issh">
+        <el-input
+          v-model="resultform.notes"
+          type="textarea"
+          placeholder="请输入内容"
+        />
+      </el-form-item>
+    </el-form>
+    <div>
+      <!-- audiText[resultform.auditflowOperateType].replace("合规性", "") -->
+    </div>
+    <div>
+      附件材料:
+      <el-upload
+        multiple
+        :action="uploadFileUrl"
+        :file-list="resultform.fjs"
+        :limit="10"
+        :on-error="handleUploadError"
+        :on-success="handleUploadSuccess"
+        :show-file-list="false"
+        :headers="headers"
+        class="upload-file-uploader"
+        ref="fileUpload"
+      >
+        <!-- 上传按钮 -->
+        <el-button type="primary">上传</el-button>
+      </el-upload>
+      <!-- <fileUpload
+        :limit="10"
+        :fileSize="50"
+        :fileType="['zip', 'jpg', 'png']"
+        :isShowTip="false"
+        @changefile="changefile"
+      ></fileUpload> -->
+
+      <tablePage
+        :cloumn="fileHeader"
+        :table="{ total: 20, data: resultform.fjs }"
+        :indexed="false"
+        :check="false"
+        layout=""
+      >
+        <template #action="{ row, $index }">
+          <span class="usable" @click="preview(row)">查看</span>
+          <span class="usable" @click="download(row)"> 下载 </span>
+          <span class="usable" @click="handleDelete($index)"> 删除 </span>
+        </template>
+      </tablePage>
+    </div>
+    <div v-if="issh">说明:当审核结论为退回时,自动退回到核查任务环节。</div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="open = false">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup name="details">
+import { getToken } from "@/utils/auth";
+
+import {
+  hgxinfo,
+  scinfo,
+  tjinfo,
+  hgxDkjbxx,
+  scDkjbxx,
+  tjDkjbxx,
+} from "@/api/rsmonitoring/dkjbxx";
+const emit = defineEmits(['reset'])
+const { proxy } = getCurrentInstance();
+const uploadFileUrl = ref(
+  import.meta.env.VITE_APP_BASE_API + "/file/upload/v1"
+);
+const headers = ref({ Authorization: "Bearer " + getToken() });
+const resultdata = reactive({
+  open: false,
+  issh: false,
+  diatitle: "",
+  resultform: { fjs: [] },
+  // fileList: { total: 0, data: [{}] },
+  fileList: [],
+  fileHeader: [
+    { label: "文件名称", prop: "fjName", align: "center" },
+    { label: "文件格式", prop: "fjType", width: "120px" },
+    { label: "文件大小(M)", prop: "fjSize", width: "120px" },
+    { label: "操作", slot: "action", width: "120px", align: "center" },
+  ],
+});
+const { open, issh, diatitle, resultform, fileList, fileHeader } =
+  toRefs(resultdata);
+function moreAct(actitem, infoObj) {
+  diatitle.value = `${actitem.auditflowStepValue}结果`;
+  open.value = true;
+  issh.value = false;
+  let pram = {
+    dkid: infoObj.id,
+    auditflowStep: actitem.auditflowStep,
+    auditflowId: actitem.id,
+  };
+  if (actitem.auditflowOperateType == "001")
+    hgxinfo(pram).then((res) => {
+      resultform.value = res.data || {};
+    });
+  else if (actitem.auditflowOperateType == "002")
+    scinfo(pram).then((res) => {
+      resultform.value = res.data || {};
+    });
+  else if (actitem.auditflowOperateType == "003")
+    tjinfo(pram).then((res) => {
+      resultform.value = res.data || {};
+    });
+}
+function operate(infoObj, aStep) {
+  // if (oname == "sh") {
+  open.value = true;
+  issh.value = true;
+  resultform.value.dkjbxxId = infoObj.id;
+  resultform.value.dkbh = infoObj.dkbh;
+  resultform.value.auditflowStep = aStep;
+
+  // } else if (oname == "002")
+  //   scDkjbxx(pram).then((res) => {
+  //     resultform.value = res.data || {};
+  //   });
+  // else if (oname == "003")
+  //   tjDkjbxx(pram).then((res) => {
+  //     resultform.value = res.data || {};
+  //   });
+}
+
+// 审核;
+function submitForm() {
+  if (!issh.value) {
+    open.value = false;
+    return;
+  }
+  proxy.$refs["dkjbxxRef"].validate((valid) => {
+    if (valid) {
+      scDkjbxx(resultform.value).then((res) => {
+        proxy.$modal.msgSuccess("审核成功");
+        open.value = false;
+        reset();
+        emit("reset");
+      });
+    }
+  });
+}
+function reset() {
+  resultform.value = {};
+}
+function download(row) {
+  //http://192.168.60.221:9300/statics/
+  window.open(`${window.axiosURI}${row.fjPath}`);
+}
+function preview(row) {
+  window.open(` ${window.axiosURI}${row.fjPath}`, "_blank");
+}
+defineExpose({ moreAct, operate });
+
+// 上传失败
+function handleUploadError(err) {
+  proxy.$modal.msgError("上传文件失败");
+}
+function handleUploadSuccess(res, file, UploadFile, uploadFiles) {
+  if (res.code === 200) {
+    resultform.value.fjs.push({
+      fjName: file.name,
+      fjPath: res.data.url,
+      // url: res.data.path,
+      fjSize: Number((file.size / 1024 / 1024).toFixed(2)),
+      fjType: file.name.split(".").pop(),
+    });
+    proxy.$modal.closeLoading();
+  } else {
+    // number.value--;
+    proxy.$modal.closeLoading();
+    proxy.$modal.msgError(res.msg);
+    proxy.$refs.fileUpload.handleRemove(file);
+    // uploadedSuccessfully();
+  }
+}
+function handleDelete(index) {
+  resultform.value.fjs.splice(index, 1);
+}
+</script>
+
+<style>
+</style>

+ 84 - 0
src/views/remote/farmland/components/tjdialog.vue

@@ -0,0 +1,84 @@
+<template>
+  <!-- 审核详情 -->
+  <el-dialog :title="diatitle" v-model="open" width="500px" append-to-body>
+    <div v-if="tjform.decide == '1'">
+      <div>提交数据要求通过审核且完成合法性判定。</div>
+      <div>
+        当前图斑数据(图斑编号:{{ tjform.dkbh }})不满足上报要求,无法进行提交。
+      </div>
+      <div>请核实数据后,再进行操作。</div>
+    </div>
+    <div v-else>
+      确定对该图斑数据(图斑编号:{{
+        tjform.dkbh
+      }})进行提交吗?提交后无法进行修改。
+      <div>图斑审核结果:通过</div>
+      <div>图斑合法性判定:合法用地。</div>
+      <div>提交数据包括图斑核查数据、审核数据、合法性判定数据。</div>
+    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="open = false">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup name="details">
+import { scinfo, tjinfo, scDkjbxx, tjDkjbxx } from "@/api/rsmonitoring/dkjbxx";
+const { proxy } = getCurrentInstance();
+const emit = defineEmits(["reset"]);
+const resultdata = reactive({
+  open: false,
+  action: false,
+  diatitle: "",
+  tjform: {},
+});
+const { open, action, diatitle, tjform } = toRefs(resultdata);
+function moreAct(actitem, infoObj) {
+  diatitle.value = `提交结果`;
+  action.value = false;
+  getinfo(actitem, infoObj);
+}
+function getinfo(actitem, infoObj) {
+  let pram = {
+    dkid: infoObj.id,
+    auditflowStep: actitem.auditflowStep,
+    auditflowId: actitem.id,
+  };
+  tjinfo(pram).then((res) => {
+    tjform.value = res.data || {};
+    open.value = true;
+  });
+}
+function operate(infoObj, auditflowStep) {
+  diatitle.value = `提交`;
+  action.value = true;
+  // tjform.value.dkjbxxId = infoObj.id;
+  // tjform.value.dkbh = infoObj.dkbh;
+  getinfo({ auditflowStep }, infoObj);
+}
+
+// 审核;
+function submitForm() {
+  if (!action.value) {
+    open.value = false;
+    return;
+  }
+  proxy.$refs["dkjbxxRef"].validate((valid) => {
+    if (valid) {
+      tjDkjbxx(tjform.value).then((res) => {
+        proxy.$modal.msgSuccess("提交成功");
+        open.value = false;
+        emit("reset");
+      });
+    }
+  });
+}
+
+defineExpose({ moreAct, operate });
+</script>
+
+<style>
+</style>