Przeglądaj źródła

现场考察报告删除;企业资质与准入项顺序

baichengfei 5 lat temu
rodzic
commit
5b60e6b521

+ 82 - 14
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodsinfo.vue

@@ -727,18 +727,43 @@
         </el-col>
       </el-row>
       <el-row style="margin-top: 10px;">
-        <viewer :images="scenefileurllist">
-          <el-col :span="6"  v-for="(tmpUrl,index) in scenefileurllist" :key="index" style="vertical-align: middle;	text-align: center;">
-            <el-link :href="'http://'+fileurlcut(scenefile.FileUrl, index)" target="_blank" type="primary"
-                     v-if="imgFormat(scenefile.FileUrl, index)" >
-              {{scenefile.FileName.split('$')[index]}}</el-link>
-            <img
-              v-else
-              class="photoStyle" alt=""
-              :src="'http://'+fileurlcut(scenefile.FileUrl, index)"
-              :key="index">
-          </el-col>
-        </viewer>
+        <el-table :data="scenefileurllist" border size="mini">
+          <el-table-column prop="FileUrlList" label="报告" show-overflow-tooltip>
+            <template slot="empty" v-if="scenefile.FileName == ''">暂无数据</template>
+            <template slot-scope="scope">
+              <viewer :images="scenefileurllist">
+                <el-col :span="6"  v-for="(tmpUrl,index) in scenefileurllist" v-if="index<1" :key="index" style="vertical-align: middle;	text-align: center;">
+                  <el-link :href="'http://'+fileurlcut(scenefile.FileUrl, scope.$index)" target="_blank" type="primary"
+                           v-if="imgFormat(scenefile.FileUrl, index)" >
+                    {{scenefile.FileName.split('$')[scope.$index]}}</el-link>
+                  <img
+                    v-else
+                    class="photoStyle" alt=""
+                    :src="'http://'+fileurlcut(scenefile.FileUrl, scope.$index)"
+                    :key="index">
+                </el-col>
+              </viewer>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" width="150" align="center" fixed>
+            <template slot-scope="scope">
+              <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
+                         v-if="scenefile.FileName != ''" @click="deletedata(scenefile.FileName.split('$')[scope.$index], scenefile.FileUrl.split('$')[scope.$index])">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+<!--        <viewer :images="scenefileurllist">-->
+<!--          <el-col :span="6"  v-for="(tmpUrl,index) in scenefileurllist" :key="index" style="vertical-align: middle;	text-align: center;">-->
+<!--            <el-link :href="'http://'+fileurlcut(scenefile.FileUrl, index)" target="_blank" type="primary"-->
+<!--                     v-if="imgFormat(scenefile.FileUrl, index)" >-->
+<!--              {{scenefile.FileName.split('$')[index]}}</el-link>-->
+<!--            <img-->
+<!--              v-else-->
+<!--              class="photoStyle" alt=""-->
+<!--              :src="'http://'+fileurlcut(scenefile.FileUrl, index)"-->
+<!--              :key="index">-->
+<!--          </el-col>-->
+<!--        </viewer>-->
       </el-row>
     </el-card>
 
@@ -927,6 +952,7 @@ export default {
     }
 
     return {
+      subfileList: [],
       manufacturerList: [],
       certId: 0,
       visible: false,
@@ -1157,6 +1183,21 @@ export default {
     }
   },
   methods: {
+    deletedata (FileName, FileUrl) {
+      let _this = this
+      _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.editSubfile(FileName, FileUrl)
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
+    },
     updatemanufacturers () {
       let _this = this
       if (_this.formData.OperType !== '制造商') {
@@ -1245,7 +1286,15 @@ export default {
         }
       }
     },
-    editSubfile () {
+    indexOf (arr, val) {
+      for (var i = 0; i < arr.length; i++) {
+        if (arr[i] === val) {
+          return i
+        }
+      }
+      return -1
+    },
+    editSubfile (FileName, FileUrl) {
       let _this = this
       _this.SubfileForm.SupplierId = parseInt(_this.formData.Id)
       var list = _this.scenefileurllist
@@ -1255,10 +1304,15 @@ export default {
         url += list[i] + '$'
         name += list[i].split('|')[1] + '$'
       }
+      if (name) {
+        name = ''
+      }
+      console.log(name, 'dada1')
       var newUrl = url + _this.SubfileForm['FileUrl']
       var newName = name + _this.SubfileForm['FileName']
       var nameArr = newName.split('$')
       var urlArr = newUrl.split('$')
+      console.log(newName, 'dada1')
       // name去重
       for (var i = 0, len = nameArr.length; i < len; i++) {
         for (var j = i + 1, len = nameArr.length; j < len; j++) {
@@ -1279,6 +1333,19 @@ export default {
           }
         }
       }
+      if (FileUrl) {
+        var index = this.indexOf(urlArr, FileUrl)
+        if (index > -1) {
+          urlArr.splice(index, 1)
+        }
+      }
+      if (FileName) {
+        var index1 = this.indexOf(nameArr, FileName)
+        if (index1 > -1) {
+          nameArr.splice(index1, 1)
+        }
+      }
+      console.log(nameArr.join('$'), 'dada')
       _this.SubfileForm['FileName'] = nameArr.join('$')
       _this.SubfileForm['FileUrl'] = urlArr.join('$')
       _this.$axios.put('/supplier/editsubfile/' + this.SubfileForm.SupplierId, _this.SubfileForm)
@@ -1313,6 +1380,7 @@ export default {
           this.scenefile = res.data.item
           if (this.scenefile && this.scenefile != null) {
             this.scenefileurllist = this.scenefile.FileUrl.split('$')
+            console.log(this.scenefile, '说过的话')
           }
         })
       }
@@ -1325,7 +1393,7 @@ export default {
           return
         }
         this.getattachissuccess()
-        this.editSubfile()
+        this.editSubfile('', '')
         return false
       } else {
         this.$message({

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

@@ -482,6 +482,109 @@
                 </el-row>
               </el-form>
             </el-card>
+            <el-card class="box-card" style="margin-top: 10px;">
+              <div slot="header" class="clearfix">
+                <span><i class="icon icon-table2"></i> 企业资质</span>
+                <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>
+              </div>
+              <el-table size="mini" highlight-current-row :data="subfileList1" border>
+                <el-table-column label="操作" width="150" align="center" fixed>
+                  <template slot-scope="scope">
+                    <el-button type="primary" plain size="mini" title="文件变更" :disabled="formData.Status > 0" @click="openDialog(scope.row)">
+                      变更</el-button>
+                    <el-button type="danger" plain size="mini" title="文件删除" @click="delFile(scope.row)"
+                               v-if="formData.Status <= 0 && scope.row.FileType == 0 && scope.row.OldFileUrl == ''">
+                      删除</el-button>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="OldFileUrlList" label="原文件" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <!-- <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList">
+                      <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank"
+                         class="buttonText">{{scope.row.OldFileName.split('$')[index]}}</a>
+                    </div> -->
+                    <viewer :images="scope.row.OldFileUrlList">
+                      <div v-for="(tmpUrl,index) in scope.row.OldFileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
+                        <el-link :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank" type="primary"
+                                 v-if="imgFormat(scope.row.OldFileUrl, index)" >
+                          {{scope.row.OldFileName.split('$')[index]}}</el-link>
+                        <img
+                          v-else
+                          class="photoStyle" alt=""
+                          :src="'http://'+fileurlcut(scope.row.OldFileUrl, index)"
+                          :key="index">
+                      </div>
+                    </viewer>
+
+
+
+                  </template>
+                </el-table-column>
+                <el-table-column prop="OldEffectDate" label="原有效日期" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    {{ jstimehandle(scope.row.OldEffectDate+'') }}
+                  </template>
+                </el-table-column>
+                <el-table-column prop="FileUrlList" label="变更后文件" show-overflow-tooltip>
+                  <template slot-scope="scope">
+
+
+                    <el-row align="middle">
+                      <el-col :span="20">
+                        <viewer :images="scope.row.FileUrlList">
+                          <div v-for="(tmpUrl,index) in scope.row.FileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
+                            <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary"
+                                     v-if="imgFormat(scope.row.FileUrl, index)" >
+                              {{scope.row.FileName.split('$')[index]}}</el-link>
+                            <img
+                              v-else
+                              class="photoStyle" alt=""
+                              :src="'http://'+fileurlcut(scope.row.FileUrl, index)"
+                              :key="index">
+                          </div>
+                        </viewer>
+                      </el-col>
+                      <el-col :span="4" v-if="scope.row.FileUrl != '' && formData.Status <= 0 && formData.Status != -5">
+                        <i class="el-icon-close" :style="{'float': 'right', 'height': '100%','line-height': lineheight(scope.row.FileUrlList.length)  + 'px',}" @click="iconclear(scope.row)"></i>
+                      </el-col>
+                    </el-row>
+
+
+                    <!-- <el-row align="middle">
+                      <el-col :span="20">
+                        <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                          <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
+                             class="buttonText">{{scope.row.FileName.split('$')[index]}}
+                          </a>
+                        </div>
+                      </el-col>
+                      <el-col :span="4" v-if="scope.row.FileUrl != '' && formData.Status <= 0 && formData.Status != -5">
+                        <i class="el-icon-close" :style="{'float': 'right', 'height': '100%','line-height': lineheight(scope.row.FileUrlList.length)  + 'px',}" @click="iconclear(scope.row)"></i>
+                      </el-col>
+                    </el-row> -->
+
+
+
+
+                  </template>
+                </el-table-column>
+                <el-table-column prop="EffectDate" label="变更后有效日期" show-overflow-tooltip >
+                  <template slot-scope="scope">
+                    {{ jstimehandle(scope.row.EffectDate+'') }}
+                  </template>
+                </el-table-column>
+                <el-table-column prop="Remark" label="描述" show-overflow-tooltip></el-table-column>
+              </el-table>
+              <div style="float: right; margin: 20px;">
+                <el-button type="primary" size="mini" style="margin-right: 8px" @click="separateUnitSubmitClick"
+                           v-if="formData.Id !='' && formData.Status <= 0 && formData.Status != -5 && IsCompanyUser == 0">提交审核
+                </el-button>
+                <el-button type="primary" size="mini" style="margin-right: 8px" @click="comSubmitToSeparateUnitClick"
+                           v-if="formData.Id !='' && formData.Status <= 0 && formData.Status != -5 && IsCompanyUser == 1">提交
+                </el-button>
+              </div>
+            </el-card>
             <!-- 增项分类列表 -->
             <el-row :gutter="2">
               <el-col :span="12">
@@ -565,109 +668,6 @@
                 </el-card>
               </el-col>
             </el-row>
-            <el-card class="box-card" style="margin-top: 10px;">
-              <div slot="header" class="clearfix">
-                <span><i class="icon icon-table2"></i> 企业资质</span>
-                <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>
-              </div>
-              <el-table size="mini" highlight-current-row :data="subfileList1" border>
-                <el-table-column label="操作" width="150" align="center" fixed>
-                  <template slot-scope="scope">
-                    <el-button type="primary" plain size="mini" title="文件变更" :disabled="formData.Status > 0" @click="openDialog(scope.row)">
-                      变更</el-button>
-                    <el-button type="danger" plain size="mini" title="文件删除" @click="delFile(scope.row)"
-                               v-if="formData.Status <= 0 && scope.row.FileType == 0 && scope.row.OldFileUrl == ''">
-                      删除</el-button>
-                  </template>
-                </el-table-column>
-                <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
-                <el-table-column prop="OldFileUrlList" label="原文件" show-overflow-tooltip>
-                  <template slot-scope="scope">
-                    <!-- <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList">
-                      <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank"
-                         class="buttonText">{{scope.row.OldFileName.split('$')[index]}}</a>
-                    </div> -->
-                    <viewer :images="scope.row.OldFileUrlList">
-                    <div v-for="(tmpUrl,index) in scope.row.OldFileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
-                      <el-link :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank" type="primary"
-                        v-if="imgFormat(scope.row.OldFileUrl, index)" >
-                        {{scope.row.OldFileName.split('$')[index]}}</el-link>
-                      <img
-                        v-else
-                        class="photoStyle" alt=""
-                        :src="'http://'+fileurlcut(scope.row.OldFileUrl, index)"
-                        :key="index">
-                    </div>
-                    </viewer>
-
-
-
-                  </template>
-                </el-table-column>
-                <el-table-column prop="OldEffectDate" label="原有效日期" show-overflow-tooltip>
-                  <template slot-scope="scope">
-                    {{ jstimehandle(scope.row.OldEffectDate+'') }}
-                  </template>
-                </el-table-column>
-                <el-table-column prop="FileUrlList" label="变更后文件" show-overflow-tooltip>
-                  <template slot-scope="scope">
-
-
-                    <el-row align="middle">
-                    <el-col :span="20">
-                      <viewer :images="scope.row.FileUrlList">
-                      <div v-for="(tmpUrl,index) in scope.row.FileUrlList" :key="index" style="vertical-align: middle;	text-align: center;">
-                      <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary"
-                        v-if="imgFormat(scope.row.FileUrl, index)" >
-                        {{scope.row.FileName.split('$')[index]}}</el-link>
-                      <img
-                        v-else
-                        class="photoStyle" alt=""
-                        :src="'http://'+fileurlcut(scope.row.FileUrl, index)"
-                        :key="index">
-                      </div>
-                      </viewer>
-                    </el-col>
-                    <el-col :span="4" v-if="scope.row.FileUrl != '' && formData.Status <= 0 && formData.Status != -5">
-                        <i class="el-icon-close" :style="{'float': 'right', 'height': '100%','line-height': lineheight(scope.row.FileUrlList.length)  + 'px',}" @click="iconclear(scope.row)"></i>
-                      </el-col>
-                  </el-row>
-
-
-                    <!-- <el-row align="middle">
-                      <el-col :span="20">
-                        <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
-                          <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
-                             class="buttonText">{{scope.row.FileName.split('$')[index]}}
-                          </a>
-                        </div>
-                      </el-col>
-                      <el-col :span="4" v-if="scope.row.FileUrl != '' && formData.Status <= 0 && formData.Status != -5">
-                        <i class="el-icon-close" :style="{'float': 'right', 'height': '100%','line-height': lineheight(scope.row.FileUrlList.length)  + 'px',}" @click="iconclear(scope.row)"></i>
-                      </el-col>
-                    </el-row> -->
-
-
-
-
-                  </template>
-                </el-table-column>
-                <el-table-column prop="EffectDate" label="变更后有效日期" show-overflow-tooltip >
-                  <template slot-scope="scope">
-                    {{ jstimehandle(scope.row.EffectDate+'') }}
-                  </template>
-                </el-table-column>
-                <el-table-column prop="Remark" label="描述" show-overflow-tooltip></el-table-column>
-              </el-table>
-              <div style="float: right; margin: 20px;">
-                <el-button type="primary" size="mini" style="margin-right: 8px" @click="separateUnitSubmitClick"
-                           v-if="formData.Id !='' && formData.Status <= 0 && formData.Status != -5 && IsCompanyUser == 0">提交审核
-                </el-button>
-                <el-button type="primary" size="mini" style="margin-right: 8px" @click="comSubmitToSeparateUnitClick"
-                           v-if="formData.Id !='' && formData.Status <= 0 && formData.Status != -5 && IsCompanyUser == 1">提交
-                </el-button>
-              </div>
-            </el-card>
           </el-tab-pane>
         </el-tabs>
       </div>