Bladeren bron

品牌管理

asxiliu 2 jaren geleden
bovenliggende
commit
55d250459f

+ 5 - 0
.idea/.gitignore

@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 6 - 0
.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="WebPackConfiguration">
+    <option name="mode" value="DISABLED" />
+  </component>
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/yos_web.iml" filepath="$PROJECT_DIR$/.idea/yos_web.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 12 - 0
.idea/yos_web.iml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/temp" />
+      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+      <excludeFolder url="file://$MODULE_DIR$/tmp" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

File diff suppressed because it is too large
+ 1 - 14785
package-lock.json


+ 42 - 0
src/HDrpManagement/BrandManage/index.vue

@@ -0,0 +1,42 @@
+<template>
+  <div>
+    <div class="container normal-panel normal-margin">
+      <add></add>
+    </div>
+    <div class="container normal-panel normal-margin">
+      <list ref="list">
+        <template v-slot:edit="scope">
+          <edit v-if="tool.checkAuth($route.name,'update')" :data="scope.data" @onSuccess="onSuccess"  :type="'text'"></edit>
+        </template>
+        <template v-slot:del="scope">
+          <brand_del v-if="tool.checkAuth($route.name,'delete')" :data="scope.data" @onSuccess="onSuccess"  :type="'text'"></brand_del>
+        </template>
+      </list>
+    </div>
+  </div>
+</template>
+
+<script>
+import list from './modules/list.vue';
+import add from './modules/add';
+import edit from './modules/edit';
+import brand_del from './modules/brand_del';
+export default {
+name: "index",
+  components:{
+    list,
+    add,
+    edit,
+    brand_del
+  },
+  methods:{
+    onSuccess () {
+      this.$refs.list.listData()
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 111 - 0
src/HDrpManagement/BrandManage/modules/add.vue

@@ -0,0 +1,111 @@
+<template>
+  <div>
+    <el-button size="small" type="primary" icon="el-icon-plus" @click="onShow" >新 建</el-button>
+    <el-dialog
+        :visible.sync="drawer"
+        width="450px"
+        @close="onClose"
+        >
+      <div>
+        <el-row :gutter="50">
+          <el-form :model="form" :rules="rules"  ref="form"  size="mini" label-position="left">
+            <el-col :span="20">
+              <el-form-item prop="brandName" label="品牌名称">
+                <el-input v-model="form.brandName" placeholder="输入品牌名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="20">
+              <el-form-item  label="LOGE">
+                <uploadFile style="margin-top:10px" :folderid="folderid" accept=".JPG,.PNG,.jpg,.png" btntype="image" :bindData="{ownertable:'sa_brand',ownerid:'',usetype:'default'}" @onSuccess="uploadSuccess"></uploadFile>
+              </el-form-item>
+            </el-col>
+
+          </el-form>
+        </el-row>
+      </div>
+      <div class="dialog-footer">
+        <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="warning" @click="onSubmit"  class="normal-btn-width btn-warning">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import uploadFile from '../../../components/upload/hw_obs_upload.vue'
+import previewImage from '@/components/previewImage/index.vue'
+export default {
+  name: "add",
+  data(){
+    return {
+      drawer:false,
+      rules:{
+        brandName: [
+          { required: true, message: '品牌名称不可为空', trigger: 'blur' },
+        ],
+      },
+      form:{
+        brandName:''
+      },
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      attachmentids:[],
+      ownerid:''
+    }
+  },
+  components:{
+    uploadFile,
+    previewImage
+  },
+  methods:{
+    onShow (){
+      this.drawer = true
+    },
+    onSubmit () {
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": "20220922085003",
+          "version": 1,
+          "content": {
+            "sa_brandid": 0,     //sa_brandid<=0时 为新增
+            "brandname": this.form.brandName
+          }
+        })
+        this.tool.showMessage(res, () => {
+          console.log(res)
+          this.ownerid = res.data
+          this.drawer = false
+          this.$emit('onSuccess')
+
+          this.bindMedia()
+        })
+      })
+    },
+    uploadSuccess(res){
+      console.log(res)
+      this.attachmentids = res.data.attachmentids
+    },
+    async bindMedia(){
+      console.log(this.attachmentids)
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "createFileLink",
+        "content": {
+          "ownertable": "sa_brand",
+          "ownerid": this.ownerid,
+          "usetype": "default",
+          "attachmentids": this.attachmentids
+        }
+      })
+    },
+    onClose () {
+      this.$refs['form'].resetFields()
+    },
+    clearCover () {}
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 35 - 0
src/HDrpManagement/BrandManage/modules/brand_del.vue

@@ -0,0 +1,35 @@
+<template>
+  <div >
+    <el-popconfirm
+        title="确定删除当前选中账号吗?"
+        @confirm="deleteRow()">
+      <el-button slot="reference" size="small" type="text">删 除</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "brand_del",
+  props:['data'],
+  methods: {
+    async deleteRow(){
+      const res = await this.$api.requested({
+        "id": "20220922085203",
+        "version":1,
+        "content": {
+          "sa_brandid": this.data.sa_brandid
+        }
+      })
+      this.tool.showMessage(res, () => {
+        console.log(res)
+        this.$emit('onSuccess')
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 114 - 0
src/HDrpManagement/BrandManage/modules/edit.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <el-button size="small" type="text" @click="onShow">编 辑</el-button>
+    <el-dialog
+        :visible.sync="drawer"
+        width="450px"
+
+    >
+      <div>
+        <el-row :gutter="50">
+          <el-form  :model="form" :rules="rules"  ref="form"  size="mini" label-position="left">
+            <el-col :span="20">
+              <el-form-item  prop="brandname" label="品牌名称">
+                <el-input v-model="form.brandname"  placeholder="输入品牌名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="20">
+              <el-form-item  label="LOGE">
+                <uploadFile v-if="data.attinfos.length === 0" style="margin-top:10px" :folderid="folderid" accept=".JPG,.PNG,.jpg,.png" btntype="image" :bindData="{ownertable:'sa_brand',ownerid:'',usetype:'default'}" @onSuccess="uploadSuccess"></uploadFile>
+                <previewImage v-else  :image="data.attinfos[0]" :deletebtn="true"
+                              @onSuccess="clearCover"></previewImage>
+                <small style="display:block;margin-top:20px" class="info">注:建议上传图片大小1024x1024,大小不超过2M,格式为JPG/PNG</small>
+              </el-form-item>
+            </el-col>
+
+          </el-form>
+        </el-row>
+      </div>
+      <div class="dialog-footer">
+        <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
+        <el-button size="small" type="warning" @click="onSubmit"   class="normal-btn-width btn-warning">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import uploadFile from '../../../components/upload/hw_obs_upload.vue'
+import previewImage from '@/components/previewImage/index.vue'
+export default {
+name: "edit",
+  props:['data'],
+  data(){
+    return {
+      drawer:false,
+      folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
+      rules:{
+        brandname: [
+          { required: true, message: '品牌名称不可为空', trigger: 'blur' },
+        ],
+      },
+      form:{
+        brandname:''
+      },
+    }
+  },
+  components:{
+    uploadFile,
+    previewImage
+  },
+  created() {
+  },
+  methods:{
+    onShow(){
+      this.drawer = true
+      console.log(this.data)
+      this.form = this.data
+      console.log(this.form)
+    },
+    onSubmit () {
+      this.$refs['form'].validate(async (valid) => {
+        if (!valid) return false
+        const res = await this.$api.requested({
+          "id": "20220922085003",
+          "version": 1,
+          "content": {
+            "sa_brandid": this.form.sa_brandid,     //sa_brandid<=0时 为新增
+            "brandname": this.form.brandname
+          }
+        })
+        this.tool.showMessage(res, () => {
+          console.log(res)
+          this.ownerid = res.data
+          this.drawer = false
+          this.$emit('onSuccess')
+
+          this.bindMedia()
+        })
+      })
+    },
+    async bindMedia(){
+      console.log(this.attachmentids)
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "createFileLink",
+        "content": {
+          "ownertable": "sa_brand",
+          "ownerid": this.ownerid,
+          "usetype": "default",
+          "attachmentids": this.attachmentids
+        }
+      })
+    },
+    uploadSuccess(res){
+      console.log(res)
+    },
+    clearCover () {}
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 80 - 0
src/HDrpManagement/BrandManage/modules/list.vue

@@ -0,0 +1,80 @@
+<template>
+  <div>
+    <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght">
+      <template v-slot:customcol="scope">
+        <p >{{scope.column.data[scope.column.columnname]}}</p>
+      </template>
+      <template v-slot:opreation="scope">
+        <slot name="edit" :data="scope.data"></slot>
+        <slot name="del" :data="scope.data"></slot>
+      </template>
+    </tableLayout>
+    <div style="margin-top:16px;text-align:right">
+      <el-pagination
+          background
+          small
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-size="params.content.pageSize"
+          layout="total, prev, pager, next, jumper"
+          :total="total">
+      </el-pagination>
+    </div>
+  </div>
+
+</template>
+
+<script>
+export default {
+name: "list",
+  data(){
+    return {
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      params:{
+        "id": "20220922085103",
+        "version":1,
+        "content": {
+          pageSize:10,
+          pageNumber:1,
+          "where":{
+            "condition":""
+          }
+        }
+      }
+
+    }
+  },
+  mounted() {
+    this.listData()
+  },
+  methods:{
+    async listData(){
+      const res=await this.$api.requested(this.params)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.params.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.params.content.pageNumber = val
+      this.listData()
+    },
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).brandTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 0 - 0
src/SDrpanagement/commdiityGroup/index.vue → src/SDrpManagement/commdiityGroup/index.vue


+ 11 - 3
src/router/HDrpManagement.js

@@ -1,4 +1,12 @@
-const DrpManagement = [
-  
+const HDrpManagement = [
+    {
+        path: '/brandmag',
+        name: 'brandmag',
+        meta: {
+            title: '品牌管理',
+            ast_nav: true
+        },
+        component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/BrandManage/index')
+    },
 ]
-export default DrpManagement
+export default HDrpManagement

+ 2 - 2
src/router/SDrpManagement.js

@@ -1,4 +1,4 @@
-const DrpManagement = [
+const SDrpManagement = [
   
 ]
-export default DrpManagement
+export default SDrpManagement

Some files were not shown because too many files changed in this diff