landydb 2 долоо хоног өмнө
parent
commit
755f1f235e

+ 19 - 17
src/views/modules/tech/ctafts-add-or-detail-v2.vue

@@ -58,8 +58,8 @@
           placeholder="请输入介绍信息"
         ></el-input>
       </el-form-item>
-      <el-form-item label="" label-width="0px">
-        <upload-component
+      <el-form-item label="产品主图">
+        <!-- <upload-component
           :display="display"
           :display-star="false"
           :title="'产品主图'"
@@ -67,7 +67,8 @@
           :limit="1"
           :file-obj-list="fileList"
           @uploadSuccess="uploadSuccess"
-        />
+        /> -->
+        <upload-component :accept="'*'" v-model="dataForm.attachList" :file-obj-list="fileList" />
       </el-form-item>
       <el-form-item label="工艺步骤" prop="nodeList"> </el-form-item>
       <el-row class="my-row" style="height: 350px; background-color: #efefef">
@@ -94,7 +95,7 @@
 
 <script>
 import { getInfo, getWorkType } from '@/api/crafts'
-import UploadComponent from '../common/upload-component'
+import UploadComponent from '../common/upload-component-v2'
 import WorkFlow from '@/components/work-flow/home'
 // import data from "@/components/work-flow/config/data.json";
 import { GenNonDuplicateID } from '@/components/work-flow/until'
@@ -229,11 +230,12 @@ export default {
             }
 
             if (item.proWorkTypeList != null) {
-              first.children.push({ name: '结束', typeId: '', type: 'end' })
+              // first.children.push({ name: '结束', typeId: '', type: 'end' })
               for (var subItem of item.proWorkTypeList) {
                 let second = {
                   name: subItem.name,
-                  typeId: subItem.typeId
+                  typeId: subItem.typeId,
+                  type: subItem.type
                 }
 
                 first.children.push(second)
@@ -257,7 +259,7 @@ export default {
           if (data.data.attachList) {
             data.data.attachList.forEach((item) => {
               this.fileList.push({
-                name: item.fileName,
+                fileName: item.fileName,
                 url: item.url,
                 id: item.url
               })
@@ -321,16 +323,16 @@ export default {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           // 填充附件
-          let fList = this.fileList
-          if (fList.length > 0) {
-            this.dataForm.attachList = []
-            for (let i = 0; i < fList.length; i++) {
-              this.dataForm.attachList.push({
-                fileName: fList[i].name,
-                url: fList[i].url
-              })
-            }
-          }
+          // let fList = this.fileList
+          // if (fList.length > 0) {
+          //   this.dataForm.attachList = []
+          //   for (let i = 0; i < fList.length; i++) {
+          //     this.dataForm.attachList.push({
+          //       fileName: fList[i].name,
+          //       url: fList[i].url
+          //     })
+          //   }
+          // }
 
           let url = `/biz-service/technology/submit`
           if (this.isResubmit) {