Bläddra i källkod

Merge branch 'stage' into dev0.3

asd26269546 1 år sedan
förälder
incheckning
c61956084d

+ 50 - 0
src/components/process/ServiceContract.vue

@@ -77,6 +77,20 @@
           </el-row>
         </div>
       </template>
+      <template #file>
+        <div style="width: 100%">
+          <el-upload
+            v-model:fileList="formData.data.fileList"
+            action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+            :data="uploadData"
+            multiple
+            :before-upload="uploadFile"
+            :on-success="handleSuccess2"
+            :on-preview="onPreviewFile2">
+            <el-button>选择</el-button>
+          </el-upload>
+        </div>
+      </template>
       <template #buyer>
         <div style="width: 100%">
           <div style="width: 100%">
@@ -586,6 +600,7 @@ const formData = reactive({
     amount: undefined,
     serviceContractProductList: [],
     serviceContractPayList: [],
+    fileList: [],
   },
 });
 const submit = ref(null);
@@ -645,6 +660,12 @@ const formConfig = computed(() => {
     },
     {
       type: "slot",
+      prop: "file",
+      slotName: "file",
+      label: "上传附件",
+    },
+    {
+      type: "slot",
       slotName: "commodity",
       label: "商品信息",
     },
@@ -699,6 +720,8 @@ const rules = ref({
     { required: true, message: "请选择收款账号", trigger: "change" },
   ],
 });
+
+
 const getDict = () => {
   proxy.getDictOne(["account_currency", "funds_payment_method"]).then((res) => {
     accountCurrency.value = res["account_currency"].map((x) => ({
@@ -1048,9 +1071,26 @@ const uploadFile = async (file) => {
   file.uploadState = true;
   return true;
 };
+
+const handleSuccess2 = (any, UploadFile) => {
+  console.log(any, UploadFile);
+  console.log(formData.data)
+  formData.data.fileList.push({
+    id: UploadFile.raw.id,
+    fileName: UploadFile.raw.fileName,
+    fileUrl: UploadFile.raw.fileUrl,
+    uploadState: UploadFile.raw.uploadState,
+  });
+};
+
 const handleSuccess = (any, UploadFile) => {
   UploadFile.raw.uploadState = false;
 };
+
+const onPreviewFile2 = (file) => {
+  window.open(file.fileUrl, "_blank");
+};
+
 const onPreviewFile = (file) => {
   window.open(file.raw.fileUrl, "_blank");
 };
@@ -1242,8 +1282,18 @@ watch(
       ["10", "20", "30"].includes(route.query.processType)
     ) {
       for (var text in props.queryData) {
+        
         formData.data[text] = props.queryData[text];
+        
       }
+      formData.data.fileList = formData.data.fileList.map((item) => {
+        return {
+          name: item.fileName,
+          url: item.fileUrl,
+          ...item
+        }
+      });
+      console.log(formData.data)
       if (formData.data.countryId) {
         getCityData(formData.data.countryId, "20");
       }

+ 1 - 1
src/views/process/processApproval/index.vue

@@ -816,7 +816,7 @@ onMounted(async () => {
   margin: 0 !important;
 }
 .el-upload-list li {
-  width: 100px;
+  
   margin-left: 10px;
 }
 .el-upload--text {

+ 2 - 1
src/views/salesMange/saleContract/middle/index.vue

@@ -584,7 +584,8 @@ const clickPrint = (row) => {
     printDetails.value = {...res,...res.contractMap.contract,
     buyContactName:res.buyContactName,
     buyContactNumber:res.buyContactNumber,
-    
+    sellContactName:res.sellContactName,
+    sellContactNumber:res.sellContactNumber,
     };
     console.log(printDetails.value.contractMap.contractProductList);
   });