Преглед на файлове

Merge branch '导入E10合同'

lxf преди 1 година
родител
ревизия
f8b56a76e3
променени са 1 файла, в които са добавени 54 реда и са изтрити 0 реда
  1. 54 0
      src/views/group/purchase/contract/index.vue

+ 54 - 0
src/views/group/purchase/contract/index.vue

@@ -27,6 +27,12 @@
             :loading="loading"
             :searchConfig="searchConfigTwo"
             highlight-current-row
+            :action-list="[
+              {
+                text: '导入E10合同',
+                action: () => clickImportContract(),
+              },
+            ]"
             @get-list="getListTwo"
             @clickReset="clickResetTwo">
             <template #typeExpand="{ item }">
@@ -72,6 +78,11 @@
                 <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickPurchaseCode(item)">{{ item.code }}</a>
               </div>
             </template>
+            <template #erpCode="{ item }">
+              <div>
+                <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickPurchaseCode(item)">{{ item.erpCode }}</a>
+              </div>
+            </template>
             <template #advancePayment="{ item }">
               <div>{{ item.advancePayment }}%</div>
             </template>
@@ -246,6 +257,17 @@
         <el-button type="primary" v-print="printObj" size="large">打印</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title="导入E10合同" v-if="openUpload" v-model="openUpload" width="600">
+      <div v-loading="loadingUpload">
+        <el-upload :show-file-list="false" action="##" :http-request="uploadServerLog" :before-upload="handleBeforeUpload">
+          <el-button style="background: #20b2aa; color: #fff; border: 1px solid #20b2aa">上传</el-button>
+        </el-upload>
+        <div style="text-align: center; margin: 10px">
+          <el-button @click="openUpload = false" size="large">关 闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -432,6 +454,13 @@ const configTwo = computed(() => {
     },
     {
       attrs: {
+        label: "E10单号",
+        slot: "erpCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
         label: "状态",
         prop: "flowStatus",
         width: 100,
@@ -844,6 +873,31 @@ const computeQuantity = () => {
   }
   return num;
 };
+const openUpload = ref(false);
+const loadingUpload = ref(false);
+const clickImportContract = () => {
+  loadingUpload.value = false;
+  openUpload.value = true;
+};
+const handleBeforeUpload = () => {
+  loadingUpload.value = true;
+};
+const uploadServerLog = (params) => {
+  let file = params.file;
+  let formData = new FormData();
+  formData.append("file", file);
+  proxy.postUploadFile("/purchase/purchaseImport", formData).then(
+    () => {
+      ElMessage({ message: "导入成功", type: "success" });
+      openUpload.value = false;
+      getListTwo();
+    },
+    (err) => {
+      console.log(err);
+      loadingUpload.value = false;
+    }
+  );
+};
 </script>
 
 <style lang="scss" scoped>