30 changed files with 1546 additions and 20110 deletions
			
			
		@ -0,0 +1,4 @@ | 
				
			|||||
 | 
					NODE_ENV=production | 
				
			||||
 | 
					VUE_APP_API_SERVER =  https://epdc-shibei.elinkservice.cn/api | 
				
			||||
 | 
					VUE_APP_NODE_ENV=shibei_prod | 
				
			||||
 | 
					VUE_APP_PUBLIC_PATH=epmet-oper | 
				
			||||
								
									
										File diff suppressed because it is too large
									
								
							
						
					@ -0,0 +1,66 @@ | 
				
			|||||
 | 
					.div_search { | 
				
			||||
 | 
					  display: flex; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  .resi-cell { | 
				
			||||
 | 
					    display: flex; | 
				
			||||
 | 
					    align-items: center; | 
				
			||||
 | 
					    .resi-cell-label { | 
				
			||||
 | 
					      width: 70px; | 
				
			||||
 | 
					      box-sizing: border-box; | 
				
			||||
 | 
					      margin-right: 15px; | 
				
			||||
 | 
					      text-align: right; | 
				
			||||
 | 
					      // line-height: 32; | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    .resi-cell-input { | 
				
			||||
 | 
					      width: 180px; | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					.div_table { | 
				
			||||
 | 
					  margin-top: 20px; | 
				
			||||
 | 
					  position: relative; | 
				
			||||
 | 
					} | 
				
			||||
 | 
					.div_del { | 
				
			||||
 | 
					  position: absolute; | 
				
			||||
 | 
					  left: 10px; | 
				
			||||
 | 
					  bottom: 0; | 
				
			||||
 | 
					} | 
				
			||||
 | 
					.div_search { | 
				
			||||
 | 
					  display: flex; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  .resi-cell { | 
				
			||||
 | 
					    display: flex; | 
				
			||||
 | 
					    align-items: center; | 
				
			||||
 | 
					    .resi-cell-label { | 
				
			||||
 | 
					      width: 70px; | 
				
			||||
 | 
					      box-sizing: border-box; | 
				
			||||
 | 
					      margin-right: 15px; | 
				
			||||
 | 
					      text-align: right; | 
				
			||||
 | 
					      // line-height: 32; | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    .resi-cell-input { | 
				
			||||
 | 
					      width: 180px; | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					.div_btn { | 
				
			||||
 | 
					  display: flex; | 
				
			||||
 | 
					  margin-top: 20px; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  .btn_upload { | 
				
			||||
 | 
					    margin-left: 10px; | 
				
			||||
 | 
					    display: flex; | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					.el-row { | 
				
			||||
 | 
					  /* margin-bottom: 20px; */ | 
				
			||||
 | 
					  display: flex; | 
				
			||||
 | 
					  flex-wrap: wrap; | 
				
			||||
 | 
					  margin-top: 10px; | 
				
			||||
 | 
					  margin-right: 50px; | 
				
			||||
 | 
					} | 
				
			||||
@ -0,0 +1,90 @@ | 
				
			|||||
 | 
					/*--------------------------------------------------------------- | 
				
			||||
 | 
					 |                           请求接口封装                           | | 
				
			||||
 | 
					 ---------------------------------------------------------------*/ | 
				
			||||
 | 
					import axios from "axios"; | 
				
			||||
 | 
					import curry from "dai-js/tools/curry"; | 
				
			||||
 | 
					import { Message } from "element-ui"; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					const request = curry( | 
				
			||||
 | 
					  (method, url, data = {}, headers = {}, progress = () => {}) => { | 
				
			||||
 | 
					    return new Promise((reslove) => { | 
				
			||||
 | 
					      let returnIniData = { | 
				
			||||
 | 
					        httpCode: "", | 
				
			||||
 | 
					        data: {}, | 
				
			||||
 | 
					        msg: "", | 
				
			||||
 | 
					        code: "", | 
				
			||||
 | 
					      }; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      // 添加服务器端URL
 | 
				
			||||
 | 
					      function processUrl(url) { | 
				
			||||
 | 
					        if (url.indexOf("http://") > -1 || url.indexOf("https://") > -1) { | 
				
			||||
 | 
					          return url; | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        return process.env.VUE_APP_API_SERVER + url; | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      url = processUrl(url); | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      const succFn = (res) => { | 
				
			||||
 | 
					        // log(`[request成功] ${url}`, data, res);
 | 
				
			||||
 | 
					        let retData = { | 
				
			||||
 | 
					          ...returnIniData, | 
				
			||||
 | 
					          ...res.data, | 
				
			||||
 | 
					          httpCode: res.statusCode, | 
				
			||||
 | 
					        }; | 
				
			||||
 | 
					        // if(typeof Vue.$afterRequestHook == 'function'){
 | 
				
			||||
 | 
					        // 	retData = Vue.$afterRequestHook(retData);
 | 
				
			||||
 | 
					        // }
 | 
				
			||||
 | 
					        if (res.data.code > 8000 && res.data.code < 10000) { | 
				
			||||
 | 
					          Message.error(res.data.msg); | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        reslove(retData); | 
				
			||||
 | 
					      }; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      const failFn = (err) => { | 
				
			||||
 | 
					        // log(`[request失败] ${url}`, data, err);
 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        reslove( | 
				
			||||
 | 
					          Object.assign({}, returnIniData, { | 
				
			||||
 | 
					            httpCode: "9999", //访问出现意外
 | 
				
			||||
 | 
					            msg: "网络错误", | 
				
			||||
 | 
					          }) | 
				
			||||
 | 
					        ); | 
				
			||||
 | 
					      }; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      if (method.toUpperCase() == "POST") { | 
				
			||||
 | 
					        axios | 
				
			||||
 | 
					          .post(url, data, { | 
				
			||||
 | 
					            headers, | 
				
			||||
 | 
					            responseType: "json", | 
				
			||||
 | 
					            // progress,
 | 
				
			||||
 | 
					            // credentials: false,
 | 
				
			||||
 | 
					          }) | 
				
			||||
 | 
					          .then(succFn) | 
				
			||||
 | 
					          .catch(failFn); | 
				
			||||
 | 
					      } else { | 
				
			||||
 | 
					        axios | 
				
			||||
 | 
					          .get(url, { | 
				
			||||
 | 
					            params: data, | 
				
			||||
 | 
					            headers, | 
				
			||||
 | 
					            responseType: "json", | 
				
			||||
 | 
					            // credentials: true,
 | 
				
			||||
 | 
					          }) | 
				
			||||
 | 
					          .then(succFn) | 
				
			||||
 | 
					          .catch(failFn); | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					    }); | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					); | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					export const requestGet = request("get"); | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					export const requestPost = request("post"); | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					export default { | 
				
			||||
 | 
					  install(Vue) { | 
				
			||||
 | 
					    Vue.prototype.$requestGet = requestGet; | 
				
			||||
 | 
					    Vue.prototype.$requestPost = requestPost; | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					}; | 
				
			||||
@ -0,0 +1,286 @@ | 
				
			|||||
 | 
					<template> | 
				
			||||
 | 
					  <div class="resi-container"> | 
				
			||||
 | 
					    <el-card class="resi-card-table"> | 
				
			||||
 | 
					      <div class="mod-sys__menu"> | 
				
			||||
 | 
					        <div class="resi-row-btn"> | 
				
			||||
 | 
					          <el-button class="" | 
				
			||||
 | 
					                    type="success" | 
				
			||||
 | 
					                    @click="addShow()">新增</el-button> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					        <el-table v-loading="dataListLoading" | 
				
			||||
 | 
					                  :data="dataList" | 
				
			||||
 | 
					                  :default-expand-all="false" | 
				
			||||
 | 
					                  row-key="categoryId" | 
				
			||||
 | 
					                  :cell-style="cellStyle" | 
				
			||||
 | 
					                  border | 
				
			||||
 | 
					                  style="width: 100%;" class="resi-table"> | 
				
			||||
 | 
					          <el-table-column prop="categoryName" | 
				
			||||
 | 
					                          label="分类名称" | 
				
			||||
 | 
					                          header-align="center" | 
				
			||||
 | 
					                          min-width="150"></el-table-column> | 
				
			||||
 | 
					          <el-table-column prop="stateShow" | 
				
			||||
 | 
					                          label="状态" | 
				
			||||
 | 
					                          header-align="center" | 
				
			||||
 | 
					                          min-width="150"></el-table-column> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					          <!-- <el-table-column prop="sort" | 
				
			||||
 | 
					                            :label="$t('menu.sort')" | 
				
			||||
 | 
					                            header-align="center" | 
				
			||||
 | 
					                            align="center"></el-table-column> --> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					          <el-table-column label="操作" | 
				
			||||
 | 
					                          fixed="right" | 
				
			||||
 | 
					                          header-align="center" | 
				
			||||
 | 
					                          align="left" | 
				
			||||
 | 
					                          width="350"> | 
				
			||||
 | 
					            <template slot-scope="scope"> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					              <el-button type="text" | 
				
			||||
 | 
					                        size="small" | 
				
			||||
 | 
					                         class="btn-color-look" | 
				
			||||
 | 
					                        @click="disableCategory(scope.row)">{{ scope.row.btnShow}}</el-button> | 
				
			||||
 | 
					              <el-button type="text" | 
				
			||||
 | 
					                        size="small" | 
				
			||||
 | 
					                        class="btn-color-edit" | 
				
			||||
 | 
					                        @click="editShow(scope.row)">修改</el-button> | 
				
			||||
 | 
					              <el-button type="text" | 
				
			||||
 | 
					                        size="small" | 
				
			||||
 | 
					                        class="btn-color-del" | 
				
			||||
 | 
					                        @click="deleteCategory(scope.row)">删除</el-button> | 
				
			||||
 | 
					            </template> | 
				
			||||
 | 
					          </el-table-column> | 
				
			||||
 | 
					        </el-table> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      </div> | 
				
			||||
 | 
					    </el-card> | 
				
			||||
 | 
					     | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    <elegant-edit ref="ref_edit" | 
				
			||||
 | 
					                   @editDiaOK="editDiaOK"> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    </elegant-edit> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  </div> | 
				
			||||
 | 
					</template> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<script> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					import { requestPost } from '@/js/dai/request' | 
				
			||||
 | 
					import elegantEdit from './elegantEdit.vue' | 
				
			||||
 | 
					export default { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  data () { | 
				
			||||
 | 
					    return { | 
				
			||||
 | 
					      customerId: '', // 客户id,父组件传 | 
				
			||||
 | 
					      customerName: '', // 客户名称,父组件传 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      tableParams: { | 
				
			||||
 | 
					        customerId: '' | 
				
			||||
 | 
					      }, | 
				
			||||
 | 
					      search: '', | 
				
			||||
 | 
					      dataList: [], | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      dataListLoading: false | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  computed: { | 
				
			||||
 | 
					    tables () { | 
				
			||||
 | 
					      const search = this.search | 
				
			||||
 | 
					      if (search) { | 
				
			||||
 | 
					        console.log('this.dataList', this.dataList) | 
				
			||||
 | 
					        return this.dataList.filter(dataNews => { | 
				
			||||
 | 
					          return Object.keys(dataNews).some(key => { | 
				
			||||
 | 
					            return String(dataNews[key]).toLowerCase().indexOf(search) > -1 | 
				
			||||
 | 
					          }) | 
				
			||||
 | 
					        }) | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					      console.log('this.dataList', this.dataList) | 
				
			||||
 | 
					      return this.dataList | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					  components: { | 
				
			||||
 | 
					    elegantEdit | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					  created() { | 
				
			||||
 | 
					    const { user } = this.$store.state | 
				
			||||
 | 
					    console.log('user----', user) | 
				
			||||
 | 
					    this.initData(user.customerId, user.customerName) | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					  methods: { | 
				
			||||
 | 
					    cellStyle ({ row, column, rowIndex, columnIndex }) { | 
				
			||||
 | 
					      // 状态列字体颜色 | 
				
			||||
 | 
					      if (row.state === 'enable' && columnIndex === 1) { | 
				
			||||
 | 
					        return 'color: #EA1B29' | 
				
			||||
 | 
					      } else if (row.state === 'disable' && columnIndex === 1) { | 
				
			||||
 | 
					        return 'color: #0CB618' | 
				
			||||
 | 
					      } else { | 
				
			||||
 | 
					        return 'color: #1a1a1b' | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    initData (customerId, customerName) { | 
				
			||||
 | 
					      this.customerId = customerId | 
				
			||||
 | 
					      this.customerName = customerName | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      this.loadData() | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    // 加载列表数据 | 
				
			||||
 | 
					    async loadData () { | 
				
			||||
 | 
					      this.dataListLoading = true | 
				
			||||
 | 
					      // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/customercategorylist' | 
				
			||||
 | 
					      const url = '/resi/partymember/stylecategorydict/list' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      this.tableParams.customerId = this.customerId | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      const { data, code, msg } = await requestPost(url, this.tableParams) | 
				
			||||
 | 
					      this.dataListLoading = false | 
				
			||||
 | 
					      if (code === 0) { | 
				
			||||
 | 
					        this.dataList = data | 
				
			||||
 | 
					        this.dataList.forEach(element => { | 
				
			||||
 | 
					          element.state = element.beDisabled ? 'enable' : 'disable' | 
				
			||||
 | 
					          element.btnShow = element.beDisabled ? '启用' : '禁用' | 
				
			||||
 | 
					          element.stateShow = element.beDisabled ? '禁用' : '启用' | 
				
			||||
 | 
					          element.level = 'l1' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					          // if (element.children.length > 0) { | 
				
			||||
 | 
					          //   element.children.forEach(child => { | 
				
			||||
 | 
					          //     child.state = child.isDisable === 'enable' ? 'disable' : 'enable' | 
				
			||||
 | 
					          //     child.btnShow = child.isDisable === 'enable' ? '禁用' : '启用' | 
				
			||||
 | 
					          //     child.stateShow = child.isDisable === 'enable' ? '启用' : '禁用' | 
				
			||||
 | 
					          //     child.level = 'l2' | 
				
			||||
 | 
					          //     child.parentCategoryId = element.categoryId | 
				
			||||
 | 
					          //   }) | 
				
			||||
 | 
					          // } | 
				
			||||
 | 
					        }) | 
				
			||||
 | 
					      } else { | 
				
			||||
 | 
					        // this.$message.error(msg ) | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    // 开启/启用 | 
				
			||||
 | 
					    disableCategory (row) { | 
				
			||||
 | 
					      this.$confirm('确认' + row.btnShow + '当前分类?', '提示', { | 
				
			||||
 | 
					        confirmButtonText: '确定', | 
				
			||||
 | 
					        cancelButtonText: '取消', | 
				
			||||
 | 
					        type: 'warning' | 
				
			||||
 | 
					      }).then(() => { | 
				
			||||
 | 
					        const url = '/resi/partymember/stylecategorydict/updatestatus' | 
				
			||||
 | 
					        // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/isdisablecategory' | 
				
			||||
 | 
					        const param = { | 
				
			||||
 | 
					          customerId: this.customerId, | 
				
			||||
 | 
					          categoryId: row.categoryId, | 
				
			||||
 | 
					          beDisabled: row.state !== 'enable' | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        window.app.ajax.post(url, param, | 
				
			||||
 | 
					          (data, rspMsg) => { | 
				
			||||
 | 
					            this.$message.success('操作成功') | 
				
			||||
 | 
					            this.loadData() | 
				
			||||
 | 
					          }, | 
				
			||||
 | 
					          (rspMsg, data) => { | 
				
			||||
 | 
					            this.$message.error(rspMsg) | 
				
			||||
 | 
					          }) | 
				
			||||
 | 
					      }).catch(() => { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      }) | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    // 删除 | 
				
			||||
 | 
					    deleteCategory (row) { | 
				
			||||
 | 
					      this.$confirm('确认删除当前分类?', '提示', { | 
				
			||||
 | 
					        confirmButtonText: '确定', | 
				
			||||
 | 
					        cancelButtonText: '取消', | 
				
			||||
 | 
					        type: 'warning' | 
				
			||||
 | 
					      }).then(() => { | 
				
			||||
 | 
					        const url = '/resi/partymember/stylecategorydict/delete' | 
				
			||||
 | 
					        // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/gov/issue/issueprojectcategorydict/delcategory' | 
				
			||||
 | 
					        const param = { | 
				
			||||
 | 
					          customerId: this.customerId, | 
				
			||||
 | 
					          categoryId: row.categoryId | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					        window.app.ajax.post(url, param, | 
				
			||||
 | 
					          (data, rspMsg) => { | 
				
			||||
 | 
					            this.$message.success('操作成功') | 
				
			||||
 | 
					            this.loadData() | 
				
			||||
 | 
					          }, | 
				
			||||
 | 
					          (rspMsg, data) => { | 
				
			||||
 | 
					            this.$message.error(rspMsg) | 
				
			||||
 | 
					          }) | 
				
			||||
 | 
					      }).catch(() => { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      }) | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    // 新增  customerId,parentCategoryId,categoryId,type,level,num | 
				
			||||
 | 
					    addShow () { | 
				
			||||
 | 
					      const sort = this.dataList.length + 1 | 
				
			||||
 | 
					      this.$refs['ref_edit'].initAdd(this.customerId, '', 'l1', sort) | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    // 新增二级分类  customerId,parentCategoryId,categoryId,type,level,num | 
				
			||||
 | 
					    showAddLevel2 (row) { | 
				
			||||
 | 
					      const sort = row.children.length + 1 | 
				
			||||
 | 
					      this.$refs['ref_edit'].initAdd(this.customerId, row.categoryId, 'l2', sort) | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    // 编辑 customerId,parentCategoryId,dateform | 
				
			||||
 | 
					    editShow (row) { | 
				
			||||
 | 
					      this.$refs['ref_edit'].initEdit(this.customerId, row.categoryId, row) | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    // 取消 | 
				
			||||
 | 
					    diaCancel () { | 
				
			||||
 | 
					      this.$emit('cancleBack') | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    editDiaOK () { | 
				
			||||
 | 
					      this.loadData() | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					</script> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<style lang="scss" scoped> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					.resi-container .resi-card-table { | 
				
			||||
 | 
					  ::v-deep .el-table { | 
				
			||||
 | 
					    th  { | 
				
			||||
 | 
					      color: #fff; | 
				
			||||
 | 
					      background-color: rgba(33, 149, 254, 1); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					     | 
				
			||||
 | 
					    .cell { | 
				
			||||
 | 
					       | 
				
			||||
 | 
					      span:nth-of-type(3) { | 
				
			||||
 | 
					        display: inline-block; | 
				
			||||
 | 
					        width: 90%; | 
				
			||||
 | 
					        word-break: break-all; | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					.resi-row-btn { | 
				
			||||
 | 
					  display: flex; | 
				
			||||
 | 
					  margin-bottom: 13px; | 
				
			||||
 | 
					  ::v-deep .el-button { | 
				
			||||
 | 
					    // margin-left: 10px; | 
				
			||||
 | 
					    border: 0; | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					  ::v-deep .el-select { | 
				
			||||
 | 
					    margin-right: 10px; | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					  .el-button--success { | 
				
			||||
 | 
					    background: rgba(34, 193, 195, 1); | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					.resi-table { | 
				
			||||
 | 
					  ::v-deep .el-button--text { | 
				
			||||
 | 
					    text-decoration: underline; | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					  ::v-deep .btn-color-del { | 
				
			||||
 | 
					    margin-left: 10px; | 
				
			||||
 | 
					    color: rgba(213, 16, 16, 1); | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					  ::v-deep .btn-color-edit { | 
				
			||||
 | 
					    color: rgba(0, 167, 169, 1); | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					</style> | 
				
			||||
@ -0,0 +1,169 @@ | 
				
			|||||
 | 
					<template> | 
				
			||||
 | 
					  <el-dialog :visible.sync="visible" | 
				
			||||
 | 
					             :title="title" | 
				
			||||
 | 
					             :width="diaWidth+'%'" | 
				
			||||
 | 
					             :close-on-click-modal="false" | 
				
			||||
 | 
					             :before-close="handleClose" | 
				
			||||
 | 
					             :close-on-press-escape="false"> | 
				
			||||
 | 
					    <el-form :inline="false" | 
				
			||||
 | 
					             :model="dataForm" | 
				
			||||
 | 
					             :rules="dataRule" | 
				
			||||
 | 
					             ref="dataForm" | 
				
			||||
 | 
					             :label-width="'120px'"> | 
				
			||||
 | 
					      <div style="margin-top:20px"> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <el-form-item label="分类名称" | 
				
			||||
 | 
					                      prop="categoryName"> | 
				
			||||
 | 
					          <el-tooltip class="item" | 
				
			||||
 | 
					                      effect="dark" | 
				
			||||
 | 
					                      content="请输入1-10个字" | 
				
			||||
 | 
					                      placement="bottom-start"> | 
				
			||||
 | 
					            <el-input class="item_width_1" | 
				
			||||
 | 
					                      :maxlength="10" | 
				
			||||
 | 
					                      :minlength="1" | 
				
			||||
 | 
					                      v-model="dataForm.categoryName" | 
				
			||||
 | 
					                      placeholder="分类名称"></el-input> | 
				
			||||
 | 
					          </el-tooltip> | 
				
			||||
 | 
					        </el-form-item> | 
				
			||||
 | 
					        <!-- <el-form-item label="排序" | 
				
			||||
 | 
					                      prop="sort"> | 
				
			||||
 | 
					          <el-input-number v-model="dataForm.sort" | 
				
			||||
 | 
					                           :min="1" | 
				
			||||
 | 
					                           label="描述文字"></el-input-number> | 
				
			||||
 | 
					        </el-form-item> --> | 
				
			||||
 | 
					      </div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    </el-form> | 
				
			||||
 | 
					    <template slot="footer"> | 
				
			||||
 | 
					      <el-button @click="visible = false;resetData()">{{ $t('cancel') }}</el-button> | 
				
			||||
 | 
					      <el-button type="primary" | 
				
			||||
 | 
					                 @click="saveForm()">{{ $t('confirm') }}</el-button> | 
				
			||||
 | 
					    </template> | 
				
			||||
 | 
					  </el-dialog> | 
				
			||||
 | 
					</template> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<script> | 
				
			||||
 | 
					import { mapGetters } from 'vuex' | 
				
			||||
 | 
					import { requestPost } from '@/js/dai/request' | 
				
			||||
 | 
					export default { | 
				
			||||
 | 
					  data () { | 
				
			||||
 | 
					    return { | 
				
			||||
 | 
					      visible: false, | 
				
			||||
 | 
					      title: '分类信息', | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      customerId: '', | 
				
			||||
 | 
					      parentCategoryId: '', // 父级分类Id | 
				
			||||
 | 
					      categoryId: '', // 当前操作分类Id | 
				
			||||
 | 
					      type: '', // 操作类型(add:新增  edit:编辑) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      dataForm: { | 
				
			||||
 | 
					        categoryName: '', // 分类名称 | 
				
			||||
 | 
					        sort: 0, | 
				
			||||
 | 
					        type: '', // 操作类型(add:新增  edit:编辑) | 
				
			||||
 | 
					        level: '' | 
				
			||||
 | 
					      }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      url: '' | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					  created () { | 
				
			||||
 | 
					    // this.queryFunctionList() | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					  computed: { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    dataRule () { | 
				
			||||
 | 
					      return { | 
				
			||||
 | 
					        categoryName: [ | 
				
			||||
 | 
					          { required: true, message: '分类名称不能为空', trigger: 'blur' }, | 
				
			||||
 | 
					          { min: 2, max: 20, message: '分类名称长度在 2 到 20 个字符', trigger: 'blur' } | 
				
			||||
 | 
					        ] | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    diaWidth () { | 
				
			||||
 | 
					      console.log(this.resolution) | 
				
			||||
 | 
					      return this.resolution === 'small' ? 70 : 50 | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    ...mapGetters(['clientHeight', 'resolution']) | 
				
			||||
 | 
					  }, | 
				
			||||
 | 
					  methods: { | 
				
			||||
 | 
					    // 初始化  customerId,parentCategoryId ,level,排序 | 
				
			||||
 | 
					    initAdd (customerId, parentCategoryId, level, sort) { | 
				
			||||
 | 
					      this.visible = true | 
				
			||||
 | 
					      this.customerId = customerId | 
				
			||||
 | 
					      this.parentCategoryId = parentCategoryId | 
				
			||||
 | 
					      this.type = 'add' | 
				
			||||
 | 
					      this.dataForm.level = level | 
				
			||||
 | 
					      this.dataForm.sort = sort | 
				
			||||
 | 
					      this.url = '/resi/partymember/stylecategorydict/addorupdate' | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    // 初始化  customerId,parentCategoryId,dateform,level | 
				
			||||
 | 
					    initEdit (customerId, parentCategoryId, dataForm) { | 
				
			||||
 | 
					      this.visible = true | 
				
			||||
 | 
					      this.customerId = customerId | 
				
			||||
 | 
					      this.parentCategoryId = parentCategoryId | 
				
			||||
 | 
					      this.type = 'edit' | 
				
			||||
 | 
					      this.dataForm = dataForm | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      this.url = '/resi/partymember/stylecategorydict/addorupdate' | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    async saveForm () { | 
				
			||||
 | 
					      await this.$refs['dataForm'].validate((valid, messageObj) => { | 
				
			||||
 | 
					        if (!valid) { | 
				
			||||
 | 
					          window.app.util.validateRule(messageObj) | 
				
			||||
 | 
					          return false | 
				
			||||
 | 
					        } | 
				
			||||
 | 
					      }) | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      let params = { | 
				
			||||
 | 
					        customerId: this.customerId, | 
				
			||||
 | 
					        categoryId: this.dataForm.categoryId, | 
				
			||||
 | 
					        categoryName: this.dataForm.categoryName | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					      const { data, code, msg } = await requestPost(this.url, params) | 
				
			||||
 | 
					      if (code === 0) { | 
				
			||||
 | 
					        this.$message({ | 
				
			||||
 | 
					          type: 'success', | 
				
			||||
 | 
					          message: '保存成功' | 
				
			||||
 | 
					        }) | 
				
			||||
 | 
					        this.resetData() | 
				
			||||
 | 
					        this.visible = false | 
				
			||||
 | 
					        this.$emit('editDiaOK') | 
				
			||||
 | 
					      } else { | 
				
			||||
 | 
					        // this.$message.error(msg) | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    handleClose () { | 
				
			||||
 | 
					      this.visible = false | 
				
			||||
 | 
					    }, | 
				
			||||
 | 
					    resetData () { | 
				
			||||
 | 
					      this.dataForm = { | 
				
			||||
 | 
					        categoryName: '', // 分类名称 | 
				
			||||
 | 
					        sort: 0, | 
				
			||||
 | 
					        type: ''// 操作类型(add:新增  edit:编辑) | 
				
			||||
 | 
					      } | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					  } | 
				
			||||
 | 
					} | 
				
			||||
 | 
					</script> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<style scoped> | 
				
			||||
 | 
					.item_width_1 { | 
				
			||||
 | 
					  width: 400px; | 
				
			||||
 | 
					} | 
				
			||||
 | 
					.item_width_2 { | 
				
			||||
 | 
					  width: 700px; | 
				
			||||
 | 
					} | 
				
			||||
 | 
					.block { | 
				
			||||
 | 
					  display: block; | 
				
			||||
 | 
					} | 
				
			||||
 | 
					.btn_reset { | 
				
			||||
 | 
					  vertical-align: bottom; | 
				
			||||
 | 
					  margin-left: 10px; | 
				
			||||
 | 
					} | 
				
			||||
 | 
					</style> | 
				
			||||
					Loading…
					
					
				
		Reference in new issue