Browse Source

退款审批

lxf 1 year ago
parent
commit
dca5e8b147
1 changed files with 30 additions and 0 deletions
  1. 30 0
      src/components/process/PurchaseRefund.vue

+ 30 - 0
src/components/process/PurchaseRefund.vue

@@ -69,7 +69,9 @@ import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
 import moment from "moment";
 import { ElMessage } from "element-plus";
+import { useRoute } from "vue-router";
 
+const route = useRoute();
 const { proxy } = getCurrentInstance();
 const supplierList = ref([]);
 const returnGoods = ref([]);
@@ -99,11 +101,21 @@ let formData = reactive({
   },
 });
 const submit = ref(null);
+const judgeStatus = () => {
+  if (props.queryData.recordList && props.queryData.recordList.length > 0) {
+    let data = props.queryData.recordList.filter((item) => item.status === 2 && item.nodeType !== 1);
+    if (data && data.length > 0) {
+      return true;
+    }
+  }
+  return false;
+};
 const formOption = reactive({
   inline: true,
   labelWidth: 100,
   itemWidth: 100,
   rules: [],
+  disabled: false,
 });
 const formConfig = computed(() => {
   return [
@@ -243,6 +255,24 @@ defineExpose({
   submitData: formData.data,
   handleSubmit,
 });
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+watch(
+  props.queryData,
+  () => {
+    formOption.disabled = judgeStatus();
+    if (props.queryData && (route.query.processType == 10 || route.query.processType == 20)) {
+      for (var text in props.queryData) {
+        formData.data[text] = props.queryData[text];
+      }
+    }
+  },
+  {
+    deep: true,
+  }
+);
 // 获取用户信息并赋默认值
 const userInfo = useUserStore().user;
 onMounted(() => {