jinx 1 year ago
parent
commit
96349ebf91

+ 17 - 4
src/views/tables/author/author-one.vue

@@ -91,8 +91,8 @@
       <div class="item" style="margin-top: 100px">
         <span>受托人:</span>
         <div class="input-box">
-          <input style="width: 100%" v-model="data.authorByName" />
-          <div class="content-box">{{ data.authorByName }}</div>
+          <input style="width: 100%" v-model="data.authorByNameB" />
+          <div class="content-box">{{ data.authorByNameB }}</div>
         </div>
         <span>代理权限为:</span>
       </div>
@@ -108,9 +108,10 @@
 </template>
 
 <script setup>
-import { reactive, ref, toRefs, onBeforeMount, onMounted } from "vue";
+import { reactive, ref, toRefs, onBeforeMount, onMounted, watch } from "vue";
 import { tables } from "@/store/tables";
 import { tablesInfo, setData } from "../data";
+import { bus } from "@/hook/useGraphic";
 const props = defineProps({
   downMode: { type: Boolean, default: false },
   isDownloadShow: { type: Boolean, default: false },
@@ -119,6 +120,8 @@ const data = ref(null);
 const checkOptions = (item, index) => {
   item.check = item.options[index].id;
   data.value[item.type].check = item.check;
+
+  bus.emit("changeAuthorOneCheck");
 };
 const checkData = ref({
   check: 0,
@@ -138,7 +141,13 @@ const checkData = ref({
 const saveHandler = () => {
   return { type: "authorOne", data: data.value };
 };
-
+watch(
+  () => tablesInfo.authorOne,
+  (val, old) => {
+    console.error(val);
+  },
+  { deep: true }
+);
 defineExpose({ saveHandler, data });
 onMounted(() => {
   if (props.isDownloadShow) {
@@ -149,12 +158,16 @@ onMounted(() => {
   if (tablesInfo.authorOne) {
     data.value = tablesInfo.authorOne;
   }
+  bus.on("changeAuthorTwoCheck", (newData) => {
+    data.value.options.check = "";
+  });
 });
 </script>
 <style lang="scss" scoped>
 .content-box {
   width: 100%;
   height: 100%;
+  min-height: 28px;
   display: flex;
   align-items: center;
   justify-content: center;

+ 12 - 8
src/views/tables/author/author-two.vue

@@ -46,14 +46,14 @@
         <span style="padding-left: 20px">委托人(签名):</span>
         <div style="flex: 1">
           <input v-model="data.authorSign" />
-          <div class="content-box left" style="border:none;">{{ data.authorSign }}</div>
+          <div class="content-box left" style="border: none">{{ data.authorSign }}</div>
         </div>
       </div>
       <div class="item" style="margin-top: 100px">
         <span>受委托人(签名):</span>
         <div style="flex: 1">
           <input v-model="data.authorBySign" />
-          <div class="content-box left" style="border:none;">{{ data.authorBySign }}</div>
+          <div class="content-box left" style="border: none">{{ data.authorBySign }}</div>
         </div>
       </div>
     </div>
@@ -61,9 +61,10 @@
 </template>
 
 <script setup>
-import { reactive, ref, toRefs, onBeforeMount, onMounted } from "vue";
+import { reactive, ref, toRefs, onBeforeMount, onMounted, watch } from "vue";
 import { tables } from "@/store/tables";
-import { tablesInfo, setData } from "../data";
+import { tablesInfo, setData, resetData } from "../data";
+import { bus } from "@/hook/useGraphic";
 const props = defineProps({
   downMode: { type: Boolean, default: false },
   isDownloadShow: { type: Boolean, default: false },
@@ -76,6 +77,9 @@ const data = ref(null);
 const checkOptions = (item, index) => {
   item.check = item.options[index].id;
   data.value[item.type].check = item.check;
+  if (item.type == "oneOptions") {
+    bus.emit("changeAuthorTwoCheck");
+  }
 };
 const checkData1 = ref({
   check: 0,
@@ -121,16 +125,16 @@ onMounted(() => {
   if (tablesInfo.authorTwo) {
     data.value = tablesInfo.authorTwo;
   }
-  // if (tablesInfo.authorOne) {
-  //   console.error(tablesInfo);
-  //   data.value.oneOptions = tablesInfo.authorOne.options;
-  // }
+  bus.on("changeAuthorOneCheck", (newData) => {
+    data.value.oneOptions.check = "";
+  });
 });
 </script>
 <style lang="scss" scoped>
 .content-box {
   width: 100%;
   height: 100%;
+  min-height: 28px;
   display: flex;
   align-items: center;
   justify-content: center;

+ 7 - 2
src/views/tables/data/index.ts

@@ -204,6 +204,7 @@ let data = {
       { name: "", sex: "", age: "", id: "", address: "", phoneNum: "" },
     ],
     authorByName: "",
+    authorByNameB: "",
     authorBySex: "",
     authorByAge: "",
     authorById: "",
@@ -215,8 +216,12 @@ let data = {
 };
 
 export let tablesInfo = JSON.parse(JSON.stringify(data));
-export const resetData = () => {
-  tablesInfo = JSON.parse(JSON.stringify(data));
+export const resetData = (newData) => {
+  if (!newData) {
+    tablesInfo = JSON.parse(JSON.stringify(data));
+  } else {
+    tablesInfo = JSON.parse(JSON.stringify(newData));
+  }
 };
 export const setData = (type) => {
   if (tables && tables.value[type]) {

+ 1 - 0
src/views/tables/explorate-one.vue

@@ -555,6 +555,7 @@ onMounted(() => {
 .content-box {
   width: 100%;
   height: 100%;
+ 
   display: none;
   align-items: center;
   justify-content: center;

+ 1 - 1
src/views/tables/index.vue

@@ -127,7 +127,7 @@ const saveHandler = genUseLoading(async () => {
 
 const saveStore = () => {
   let reportData = initData();
-  console.error(reportData);
+  // console.error(reportData);
   const origin = tables.value;
   let newData = Object.assign(origin, reportData);
 };