huahaiyan пре 6 година
родитељ
комит
c93094a8a5

+ 61 - 19
src/dashoo.cn/frontend_web/src/pages/oilsupplier/qualchange/_opera/operation.vue

@@ -448,30 +448,72 @@
       },
       uploadrequest(option) {
         let _this = this
-        axios.post(process.env.upfilehost, {})
-          .then(function (res) {
-            if (res.data && res.data.fid && res.data.fid !== '') {
-              option.action = `http://${res.data.publicUrl}/${res.data.fid}`
-              _this.waituploads.push({
-                uid: option.file.uid,
-                url: res.data.publicUrl,
-                fid: res.data.fid
-              })
-              uploadajax(option)
-            } else {
+        if (process.client) {
+          const myDomain = window.location.host
+          axios.post(process.env.upfilehost, {})
+            .then(function (res) {
+              if (res.data && res.data.fid && res.data.fid !== '') {
+                if (res.data.publicUrl.indexOf('/upfile') === 0) {
+                  option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
+                } else {
+                  option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                }
+                _this.waituploads.push({
+                  uid: option.file.uid,
+                  url: res.data.publicUrl,
+                  fid: res.data.fid
+                })
+                // axios.post(process.env.upfilehost, {})
+                //   .then(function (res) {
+                //     if (res.data && res.data.fid && res.data.fid !== '') {
+                //       option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                //       _this.waituploads.push({
+                //         uid: option.file.uid,
+                //         url: res.data.publicUrl,
+                //         fid: res.data.fid
+                //       })
+                uploadajax(option)
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '未上传成功!请刷新界面重新上传!'
+                })
+              }
+            })
+            .catch(function (error) {
               _this.$message({
                 type: 'warning',
-                message: '未上传成功!请刷新界面重新上传!'
+                message: '未上传成功!请重新上传!'
               })
-            }
-          })
-          .catch(function (error) {
-            _this.$message({
-              type: 'warning',
-              message: '未上传成功!请重新上传!'
             })
-          })
+        }
       },
+      // uploadrequest(option) {
+      //   let _this = this
+      //   axios.post(process.env.upfilehost, {})
+      //     .then(function (res) {
+      //       if (res.data && res.data.fid && res.data.fid !== '') {
+      //         option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+      //         _this.waituploads.push({
+      //           uid: option.file.uid,
+      //           url: res.data.publicUrl,
+      //           fid: res.data.fid
+      //         })
+      //         uploadajax(option)
+      //       } else {
+      //         _this.$message({
+      //           type: 'warning',
+      //           message: '未上传成功!请刷新界面重新上传!'
+      //         })
+      //       }
+      //     })
+      //     .catch(function (error) {
+      //       _this.$message({
+      //         type: 'warning',
+      //         message: '未上传成功!请重新上传!'
+      //       })
+      //     })
+      // },
       // 判断附件是否上传成功
       attachissuccess() {
         if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {

+ 44 - 25
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -45,8 +45,8 @@
             <el-row>
               <el-col :span="8">
                 <el-form-item label="供应商公司名称" prop="checkSelectedSupplier">
-                  <el-select ref="suppselect" :disabled="formData.Status>0||IsCompanyUser == 1" v-model="supplierOptions" filterable
-                    @change="getInfo" placeholder="请选择供应商公司" style="width: 100%">
+                  <el-select ref="suppselect" :disabled="formData.Status>0||IsCompanyUser == 1"
+                    v-model="supplierOptions" filterable @change="getInfo" placeholder="请选择供应商公司" style="width: 100%">
                     <el-option v-for="item in supplierList" :key="item.SupplierId" :label="item.SupplierName"
                       :value="item.SupplierId">
                     </el-option>
@@ -55,14 +55,15 @@
               </el-col>
               <el-col :span="16">
                 <el-form-item label="备注" prop="Remark">
-                  <el-input :disabled="formData.Status>0||IsCompanyUser == 1" type="textarea" v-model="formData.Remark" placeholder="请输入">
+                  <el-input :disabled="formData.Status>0||IsCompanyUser == 1" type="textarea" v-model="formData.Remark"
+                    placeholder="请输入">
                   </el-input>
                 </el-form-item>
               </el-col>
             </el-row>
           </el-form>
         </el-card>
-       <!-- 增项分类列表 -->
+        <!-- 增项分类列表 -->
         <el-row :gutter="2">
           <el-col :span="12">
             <el-card class="box-card" style="margin-top: 10px;height: calc(100vh - 353px);overflow: auto">
@@ -306,7 +307,7 @@
 
     <choose-auditor ref="chooseAuditor" @close="setAuditer" @hideChooseAuditer="chooseAuditorVisible=false"
       :visible="chooseAuditorVisible"></choose-auditor>
-      <choose-auditor-fen ref="chooseAuditorFen" @close="setAuditerFen" @hideChooseAuditer="chooseAuditorVisibleFen=false"
+    <choose-auditor-fen ref="chooseAuditorFen" @close="setAuditerFen" @hideChooseAuditer="chooseAuditorVisibleFen=false"
       :visible="chooseAuditorVisibleFen"></choose-auditor-fen>
   </div>
 </template>
@@ -690,29 +691,45 @@
       },
       uploadrequest(option) {
         let _this = this
-        axios.post(process.env.upfilehost, {})
-          .then(function (res) {
-            if (res.data && res.data.fid && res.data.fid !== '') {
-              option.action = `http://${res.data.publicUrl}/${res.data.fid}`
-              _this.waituploads.push({
-                uid: option.file.uid,
-                url: res.data.publicUrl,
-                fid: res.data.fid
-              })
-              uploadajax(option)
-            } else {
+        if (process.client) {
+          const myDomain = window.location.host
+          axios.post(process.env.upfilehost, {})
+            .then(function (res) {
+              if (res.data && res.data.fid && res.data.fid !== '') {
+                if (res.data.publicUrl.indexOf('/upfile') === 0) {
+                  option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
+                } else {
+                  option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                }
+                _this.waituploads.push({
+                  uid: option.file.uid,
+                  url: res.data.publicUrl,
+                  fid: res.data.fid
+                })
+                // axios.post(process.env.upfilehost, {})
+                //   .then(function (res) {
+                //     if (res.data && res.data.fid && res.data.fid !== '') {
+                //       option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                //       _this.waituploads.push({
+                //         uid: option.file.uid,
+                //         url: res.data.publicUrl,
+                //         fid: res.data.fid
+                //       })
+                uploadajax(option)
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '未上传成功!请刷新界面重新上传!'
+                })
+              }
+            })
+            .catch(function (error) {
               _this.$message({
                 type: 'warning',
-                message: '未上传成功!请刷新界面重新上传!'
+                message: '未上传成功!请重新上传!'
               })
-            }
-          })
-          .catch(function (error) {
-            _this.$message({
-              type: 'warning',
-              message: '未上传成功!请重新上传!'
             })
-          })
+        }
       },
       // 判断附件是否上传成功
       attachissuccess() {
@@ -752,7 +769,9 @@
         let params = {
           SuppTypeCode: '02',
         }
-        _this.$axios.get('/suppliercertappend/getsupplier', {params})
+        _this.$axios.get('/suppliercertappend/getsupplier', {
+            params
+          })
           .then(res => {
             _this.supplierList = res.data
           })

+ 35 - 19
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -814,29 +814,45 @@
       },
       uploadrequest(option) {
         let _this = this
-        axios.post(process.env.upfilehost, {})
-          .then(function (res) {
-            if (res.data && res.data.fid && res.data.fid !== '') {
-              option.action = `http://${res.data.publicUrl}/${res.data.fid}`
-              _this.waituploads.push({
-                uid: option.file.uid,
-                url: res.data.publicUrl,
-                fid: res.data.fid
-              })
-              uploadajax(option)
-            } else {
+        if (process.client) {
+          const myDomain = window.location.host
+          axios.post(process.env.upfilehost, {})
+            .then(function (res) {
+              if (res.data && res.data.fid && res.data.fid !== '') {
+                if (res.data.publicUrl.indexOf('/upfile') === 0) {
+                  option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
+                } else {
+                  option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                }
+                _this.waituploads.push({
+                  uid: option.file.uid,
+                  url: res.data.publicUrl,
+                  fid: res.data.fid
+                })
+                // axios.post(process.env.upfilehost, {})
+                //   .then(function (res) {
+                //     if (res.data && res.data.fid && res.data.fid !== '') {
+                //       option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                //       _this.waituploads.push({
+                //         uid: option.file.uid,
+                //         url: res.data.publicUrl,
+                //         fid: res.data.fid
+                //       })
+                uploadajax(option)
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '未上传成功!请刷新界面重新上传!'
+                })
+              }
+            })
+            .catch(function (error) {
               _this.$message({
                 type: 'warning',
-                message: '未上传成功!请刷新界面重新上传!'
+                message: '未上传成功!请重新上传!'
               })
-            }
-          })
-          .catch(function (error) {
-            _this.$message({
-              type: 'warning',
-              message: '未上传成功!请重新上传!'
             })
-          })
+        }
       },
       // 判断附件是否上传成功
       attachissuccess() {

+ 37 - 21
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -115,8 +115,8 @@
           <el-table :data="subfileList" size="mini" border>
             <el-table-column label="操作" width="150" align="center" fixed>
               <template slot-scope="scope">
-                <el-button type="primary" plain size="mini" title="编辑" @click="openDialog(scope.row)"
-                  :disabled="scope.row.SupType != 2||formData.Status > 0">编辑
+                <el-button type="primary" plain size="mini" title="上传" @click="openDialog(scope.row)"
+                  :disabled="scope.row.SupType != 2||formData.Status > 0">上传
                 </el-button>
               </template>
             </el-table-column>
@@ -742,29 +742,45 @@
       },
       uploadrequest(option) {
         let _this = this
-        axios.post(process.env.upfilehost, {})
-          .then(function (res) {
-            if (res.data && res.data.fid && res.data.fid !== '') {
-              option.action = `http://${res.data.publicUrl}/${res.data.fid}`
-              _this.waituploads.push({
-                uid: option.file.uid,
-                url: res.data.publicUrl,
-                fid: res.data.fid
-              })
-              uploadajax(option)
-            } else {
+        if (process.client) {
+          const myDomain = window.location.host
+          axios.post(process.env.upfilehost, {})
+            .then(function (res) {
+              if (res.data && res.data.fid && res.data.fid !== '') {
+                if (res.data.publicUrl.indexOf('/upfile') === 0) {
+                  option.action = `http://${myDomain}/${res.data.publicUrl}/${res.data.fid}`
+                } else {
+                  option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                }
+                _this.waituploads.push({
+                  uid: option.file.uid,
+                  url: res.data.publicUrl,
+                  fid: res.data.fid
+                })
+                // axios.post(process.env.upfilehost, {})
+                //   .then(function (res) {
+                //     if (res.data && res.data.fid && res.data.fid !== '') {
+                //       option.action = `http://${res.data.publicUrl}/${res.data.fid}`
+                //       _this.waituploads.push({
+                //         uid: option.file.uid,
+                //         url: res.data.publicUrl,
+                //         fid: res.data.fid
+                //       })
+                uploadajax(option)
+              } else {
+                _this.$message({
+                  type: 'warning',
+                  message: '未上传成功!请刷新界面重新上传!'
+                })
+              }
+            })
+            .catch(function (error) {
               _this.$message({
                 type: 'warning',
-                message: '未上传成功!请刷新界面重新上传!'
+                message: '未上传成功!请重新上传!'
               })
-            }
-          })
-          .catch(function (error) {
-            _this.$message({
-              type: 'warning',
-              message: '未上传成功!请重新上传!'
             })
-          })
+        }
       },
       // 判断附件是否上传成功
       attachissuccess() {