detailsPage_1.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div>
  3. <div class="borderless">
  4. <div class="customer-head">
  5. <div class="customer-back">
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList">
  7. 返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <el-button type="primary" size="small" @click="addnew">添加分类</el-button>
  12. <el-button type="primary" size="small" @click="editCustomer">
  13. 保存数据
  14. </el-button>
  15. </div>
  16. </div>
  17. <trade-card title="项目数据" style="margin: 60px 300px 0;">
  18. <div class="flexbox">
  19. <div class="flexImg" @click="excelBoxfun">
  20. <img v-if="outerform.url" style="width: 100%;height: 100%" :src="outerform.url" alt="">
  21. <i v-else class="el-icon-plus"></i>
  22. </div>
  23. <div class="flexText">
  24. <el-form ref="form" :model="outerform" label-width="80px">
  25. <el-form-item label="项目名称">
  26. <el-input size="small" v-model="outerform.cname"></el-input>
  27. </el-form-item>
  28. <el-form-item label="备注">
  29. <el-input type="textarea" size="small" v-model="outerform.cname"></el-input>
  30. </el-form-item>
  31. </el-form>
  32. </div>
  33. </div>
  34. </trade-card>
  35. <el-card class="box-card" style="margin: 10px 5px" v-for="item in cardData">
  36. <div class="flexbox">
  37. <div class="flexImg_subset flexImg">
  38. <i class="el-icon-plus"></i>
  39. </div>
  40. <div class="flexText_subset">
  41. <el-form ref="form" :model="outerform" label-width="80px">
  42. <el-form-item label="项目名称">
  43. <el-input size="small" v-model="outerform.cname"></el-input>
  44. </el-form-item>
  45. <el-form-item label="备注">
  46. <el-input type="textarea" size="small" v-model="outerform.remarks"></el-input>
  47. </el-form-item>
  48. </el-form>
  49. </div>
  50. </div>
  51. <div class="subset_product">
  52. <div class="addBox">新增产品</div>
  53. <div style="display: flex;flex-wrap: wrap;justify-content: space-between;">
  54. <div class="subset_productBox flexbox" v-for="item in [1,2,3,4,5]">
  55. <div class="subset_productBox_left flexImg">
  56. <i class="el-icon-plus"></i>
  57. </div>
  58. <div class="subset_productBox_right">
  59. <div class="subset_productBox_title">标题</div>
  60. <div class="subset_productBox_img flexImg">
  61. <i class="el-icon-plus"></i>
  62. </div>
  63. <div class="subset_productBox_button">
  64. <div class="productBox_view">查看</div>
  65. <div class="productBox_edit">编辑</div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </el-card>
  72. </div>
  73. <el-dialog
  74. title="上传附件"
  75. append-to-body
  76. :visible.sync="excelBox"
  77. width="555px"
  78. :close-on-click-modal="false"
  79. v-dialog-drag
  80. >
  81. <el-upload
  82. class="upload-demo"
  83. drag
  84. style="text-align: center"
  85. ref="upload"
  86. :action="action"
  87. :headers="headers"
  88. :on-success="onSuccess"
  89. multiple
  90. >
  91. <i class="el-icon-upload"></i>
  92. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  93. <div class="el-upload__tip" slot="tip">
  94. 如上传文件过大,请耐心等待上传成功
  95. </div>
  96. </el-upload>
  97. </el-dialog>
  98. <div style="height: 60px"></div>
  99. </div>
  100. </template>
  101. <script>
  102. import goodsType from '@/components/goodsType/index'
  103. import {getToken} from "@/util/auth";
  104. export default {
  105. name: "index",
  106. data() {
  107. return {
  108. // 最大的对象
  109. outerform:{},
  110. // 附件弹窗
  111. excelBox:false,
  112. action: "/api/blade-resource/oss/endpoint/put-file",
  113. headers: { "Blade-Auth": "Bearer " + getToken() },
  114. cardData:[{
  115. name:'扒台机'
  116. },{
  117. name:'纯水机'
  118. }
  119. ]
  120. };
  121. },
  122. components: {
  123. goodsType
  124. },
  125. props: {
  126. detailData: {
  127. type: Object
  128. }
  129. },
  130. async created() {
  131. // if (this.detailData.id) {
  132. // this.projectGoodsDetailfun(this.detailData.id);
  133. // }
  134. // if (this.detailData.status == 1) {
  135. // this.option.disabled = true;
  136. // }
  137. },
  138. methods: {
  139. // 添加分类
  140. addnew(){
  141. },
  142. // 保存数据
  143. editCustomer(){
  144. },
  145. excelBoxfun(){
  146. this.excelBox = true
  147. },
  148. //新增上传成功
  149. onSuccess(response, file, fileList) {
  150. console.log(response,file,fileList,315)
  151. this.excelBox = false
  152. this.outerform.url = response.data.link
  153. this.outerform.fileName = response.data.originalName
  154. // this.$refs.crud.rowCellAdd({
  155. // fileName: response.data.originalName,
  156. // url: response.data.link
  157. // });
  158. // this.uploadCount++;
  159. // if (this.uploadCount === fileList.length) {
  160. // this.$refs.upload.clearFiles();
  161. // this.excelBox = false;
  162. // this.uploadCount = 0;
  163. // }
  164. },
  165. //返回列表
  166. backToList() {
  167. this.$emit("goBack");
  168. }
  169. },
  170. };
  171. </script>
  172. <style lang="scss" scoped>
  173. .flexbox {
  174. display: flex;
  175. align-items: center;
  176. .flexImg {
  177. width: 200px;
  178. height: 200px;
  179. border: 1px dashed #d9d9d9;
  180. border-radius: 6px;
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. font-size: 30px;
  185. color: #d9d9d9;
  186. }
  187. .flexText {
  188. width: calc(100% - 200px);
  189. }
  190. .flexImg_subset {
  191. width: 160px;
  192. height: 160px;
  193. }
  194. .flexText_subset {
  195. width: calc(100% - 160px);
  196. }
  197. .subset_productBox_left {
  198. width: 140px;
  199. height: 140px;
  200. }
  201. .subset_productBox_right {
  202. margin-left: 20px;
  203. width: calc(100% - 140px);
  204. .subset_productBox_title {
  205. font-size: 18px;
  206. color: #000;
  207. }
  208. .subset_productBox_img {
  209. width: 100px;
  210. height: 100px;
  211. }
  212. .subset_productBox_button {
  213. display: flex;
  214. align-items: center;
  215. justify-content: space-around;
  216. font-size: 14px;
  217. margin-top: 10px;
  218. .productBox_view {
  219. padding: 4px 10px;
  220. border-radius: 6px;
  221. border: 1px solid #1e9fff;
  222. color: #1e9fff;
  223. }
  224. .productBox_edit {
  225. padding: 4px 10px;
  226. border-radius: 6px;
  227. border: 1px solid #1e9fff;
  228. color: #1e9fff;
  229. }
  230. }
  231. }
  232. }
  233. .subset_product {
  234. margin-top: 20px;
  235. }
  236. .subset_productBox {
  237. width: 24%;
  238. box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.2);
  239. padding: 10px 15px;
  240. box-sizing: border-box;
  241. margin-bottom: 20px;
  242. }
  243. .addBox {
  244. width: 80px;
  245. height: 30px;
  246. border-radius: 4px;
  247. background: #1e9fff;
  248. color: #fff;
  249. font-size: 14px;
  250. display: flex;
  251. align-items: center;
  252. justify-content: center;
  253. margin-bottom: 10px;
  254. }
  255. </style>