|
@@ -862,6 +862,7 @@ import selectCity from "@/components/selectCity/index.vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import SelectContract from "@/components/contractCom/selectContract.vue";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
+import { watch } from "vue";
|
|
|
const userInfo = useUserStore();
|
|
|
|
|
|
const route = useRoute();
|
|
@@ -1825,6 +1826,107 @@ onMounted(() => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+const judgeStatusOne = () => {
|
|
|
+ if (props.queryData.processType == 20 || props.queryData.processType == 10) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+};
|
|
|
+watch(
|
|
|
+ () => props.queryData,
|
|
|
+ (val) => {
|
|
|
+ formOption.disabled = judgeStatusOne();
|
|
|
+ if (val.businessId && val.processType) {
|
|
|
+ let businessId = val.businessId;
|
|
|
+ proxy.post("/contract/detail", { id: businessId }).then((res) => {
|
|
|
+ if (res && res.dataJson) {
|
|
|
+ // res = { ...res, ...JSON.parse(res.dataJson) };
|
|
|
+ // res=proxy.deepClone()
|
|
|
+ // res.contractProductList = JSON.parse(res.dataJson).contractProductList;
|
|
|
+ }
|
|
|
+ if (!res.fileList) {
|
|
|
+ res.fileList = [];
|
|
|
+ }
|
|
|
+ if (!res.packageFileList) {
|
|
|
+ res.packageFileList = [];
|
|
|
+ }
|
|
|
+ res.countryId = res.buyCountryId;
|
|
|
+ res.provinceId = res.buyProvinceId;
|
|
|
+ res.cityId = res.buyCityId;
|
|
|
+ for (const key in res) {
|
|
|
+ formData.data[key] = res[key];
|
|
|
+ }
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: [businessId],
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ if (fileObj[businessId] && fileObj[businessId].length > 0) {
|
|
|
+ formData.data.fileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType === "1")
|
|
|
+ .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
|
|
|
+ formData.data.packageFileList = fileObj[businessId]
|
|
|
+ .filter((x) => x.businessType === "2")
|
|
|
+ .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ formData.data.contractProductList &&
|
|
|
+ formData.data.contractProductList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
|
+ const e = formData.data.contractProductList[i];
|
|
|
+ if (e.ehsdJson) {
|
|
|
+ let obj = JSON.parse(e.ehsdJson);
|
|
|
+ e.packMethod = obj.packMethod;
|
|
|
+ e.tradeMethods = obj.tradeMethods;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let ids = formData.data.contractProductList.map((x) => x.productId);
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: ids,
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ for (
|
|
|
+ let i = 0;
|
|
|
+ i < formData.data.contractProductList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ const e = formData.data.contractProductList[i];
|
|
|
+ for (const key in fileObj) {
|
|
|
+ if (e.productId === key) {
|
|
|
+ e.fileList = fileObj[key] || [];
|
|
|
+ if (e.fileList && e.fileList.length > 0) {
|
|
|
+ e.fileUrl = e.fileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (formData.data.countryId) {
|
|
|
+ getCityData(formData.data.countryId, "20");
|
|
|
+ }
|
|
|
+ if (formData.data.provinceId) {
|
|
|
+ getCityData(formData.data.provinceId, "30");
|
|
|
+ }
|
|
|
+ getDecisionAids();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ }
|
|
|
+);
|
|
|
|
|
|
const clickCopy = () => {
|
|
|
copyContract.value = true;
|