Browse Source

商品管理

zhangqiOMG 2 years ago
parent
commit
578ed25133

+ 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 @onSuccess="onSuccess"></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>

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

@@ -0,0 +1,80 @@
+<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" label-width="80px">
+            <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-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>
+export default {
+  name: "add",
+  data(){
+    return {
+      drawer:false,
+      url:null,
+      rules:{
+        brandName: [
+          { required: true, message: '品牌名称不可为空', trigger: 'blur' },
+        ],
+      },
+      form:{
+        brandName:''
+      },
+    }
+  },
+  components:{
+  },
+  methods:{
+    onShow (){
+      this.drawer = true
+    },
+    onClose () {
+      this.form = {
+         brandName:''
+      }
+    },
+    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, () => {
+          this.ownerid = res.data
+          this.drawer = false
+          this.$emit('onSuccess')
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

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

@@ -0,0 +1,35 @@
+<template>
+  <div class="inline-16">
+    <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>

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

@@ -0,0 +1,99 @@
+<template>
+  <div class="inline-16">
+    <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" label-width="80px">
+            <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="品牌logo">
+                <uploadFile ref="upload" v-if="data.attinfos.length === 0" style="margin-top:10px" :folderid="folderid" accept=".JPG,.PNG,.jpg,.png" btntype="image" :bindData="{ownertable:'sa_brand',ownerid:form.sa_brandid,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
+      this.form = this.data
+    },
+    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, () => {
+          this.ownerid = res.data
+          this.drawer = false
+          this.$emit('onSuccess')
+        })
+      })
+    },
+    uploadSuccess(res){
+      this.form.attinfos = JSON.parse(res.attinfos).data
+      this.$refs['upload'].dialogUploadVisible = false
+    },
+    clearCover () {
+      this.form.attinfos = []
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

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

@@ -0,0 +1,83 @@
+<template>
+  <div>
+    <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght">
+      <template v-slot:customcol="scope">
+        <div v-if="scope.column.columnname === 'brandLoge'">
+          <img width="70" height="70" style="margin-top:10px;border-radius:4px" :src="scope.column.data.attinfos[0]?scope.column.data.attinfos[0].url:''" alt="">
+        </div>
+        <p v-else>{{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/HDrpManagement/CommodityArchives/index.vue


+ 21 - 0
src/HDrpManagement/ProductMag/index.vue

@@ -0,0 +1,21 @@
+<template>
+  <div>
+    <selectClass></selectClass>
+    <list></list>
+  </div>
+</template>
+
+<script>
+import selectClass from './modules/Select'
+
+import list from './modules/list'
+export default {
+  components:{
+    selectClass,
+    list
+  }
+}
+
+</script>
+<style>
+</style>

+ 78 - 0
src/HDrpManagement/ProductMag/modules/Select.vue

@@ -0,0 +1,78 @@
+<template>
+  <div class="container border-bottom">
+    <div class="flex-align-center flex-between normal-margin">
+      <ul class="flex-align-center">
+        <li :class="brand_act === item.sa_brandid?'act':''" class="brand-item" v-for="item in brands" :key="item.sa_brandid" @click="clickBrand(item.sa_brandid)">{{item.brandname}}</li>
+      </ul>
+      <div class="flex-align-center">
+        <el-input size="small" v-model="value" placeholder="产品名称,编号" clearable></el-input>&nbsp;
+        <el-button type="primary" size="small">新增产品</el-button>
+      </div>
+    </div>
+    <div>
+
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      value:'',
+      brands:[],
+      brand_act:0
+    }
+  },
+  methods:{
+    async queryBrands () {
+      const res = await this.$api.requested({
+        "id": "20220922085103",
+        "version":1,
+        "content": {
+          "pageSize":1000,
+          "where":{
+            "condition":""
+          }
+        }
+      })
+      this.brands = res.data
+    },
+    async querySalerClass () {
+      const res = await this.$api.requested({
+         "id": "20220922110403",
+          "version":1,
+          "content": {
+            "sa_brandid":this.brand_act
+          }
+      })
+      this.SalerClassList = res.data
+    },
+    clickBrand (id) {
+      this.brand_act = id
+      this.querySalerClass()
+    }
+  },
+  mounted () {
+    this.queryBrands()
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.brand-item{
+  margin-right: 20px;
+  color: #768093;
+  cursor: pointer;
+  transition: .2s all linear;
+  font-size: 14px;
+}
+.act{
+  color:#000;
+}
+.border-bottom{
+  border-bottom: 1px solid #e3e5ea;
+}
+</style>

+ 154 - 0
src/HDrpManagement/ProductMag/modules/list.vue

@@ -0,0 +1,154 @@
+<template>
+<div class="container"> 
+  <div class="produtMag-panel">
+    <el-table
+      :data="tableData"
+      style="width: 100%"
+      :header-cell-style="{height:'50px',color:'#768093',fontWeight:'100'}"
+      :cell-style="{height:'50px',color:'#768093',fontWeight:'200'}">
+      <el-table-column
+        type="selection"
+        width="55">
+      </el-table-column>
+      <el-table-column
+        align="center"
+        prop="isonsale"
+        label="上架状态"
+        width="80">
+        <template slot-scope="scope">
+          <div style="margin:10px 0">
+            <el-switch
+              :disabled="scope.row.status==='审核'"
+              v-model="scope.row.isonsale"
+              active-color="#3874f6"
+              inactive-color="#999">
+            </el-switch>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="itemname"
+        label="产品名称"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        prop="itemno"
+        label="产品编号"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        label="型号/规格">
+        <template slot-scope="scope">
+          <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="unitid"
+        label="起订量/增量"
+        width="150">
+        <template slot-scope="scope">
+          <p><span>{{scope.row.orderminqty}}</span>&nbsp;/&nbsp;<span>{{scope.row.orderaddqty}}</span></p>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="unitid"
+        label="计量单位"
+        width="90">
+        <template slot-scope="scope">
+          <el-tag size="mini" type="info" effect="plain">{{scope.row.unitid}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="status"
+        label="状态"
+        width="90">
+        <template slot-scope="scope">
+          <span :style="scope.row.status === '新建'?{color:'#52C41A'}:{color:'red'}">{{scope.row.status}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column width="150">
+        <template slot-scope="scope">
+          <el-button size="mini" type="primary"  :disabled="scope.row.status==='审核'">编 辑</el-button>
+          <el-button size="mini" type="danger"  :disabled="scope.row.status==='审核'">删 除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="margin-top:16px;text-align:right">
+      <el-pagination
+        background
+        small
+        :current-page="1"
+        :page-size="10"
+        layout="total, prev, pager, next, jumper"
+        :total="100">
+      </el-pagination>
+    </div>
+  </div>
+</div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      value:0,
+      tableData: [{
+        isonsale: false,
+        itemname: '铜本色等径直通',
+        itemno: 'BM8270 0540000',
+        model:'316L德标卡压等径直通',
+        spec:'18mm',
+        orderminqty:100,
+        orderaddqty:10,
+        unitid:'个',
+        status:'新建'
+      }, {
+        isonsale: false,
+        itemname: '铜本色等径直通',
+        itemno: 'BM8270 0540000',
+        model:'316L德标卡压等径直通',
+        spec:'18mm',
+        orderminqty:100,
+        orderaddqty:10,
+        unitid:'个',
+        status:'新建'
+      }, {
+        isonsale: true,
+        itemname: '铜本色等径直通',
+        itemno: 'BM8270 0540000',
+        model:'316L德标卡压等径直通',
+        spec:'18mm',
+        orderminqty:100,
+        orderaddqty:10,
+        unitid:'个',
+        status:'新建'
+      }, {
+        isonsale: false,
+        itemname: '铜本色等径直通',
+        itemno: 'BM8270 0540000',
+        model:'316L德标卡压等径直通',
+        spec:'18mm',
+        orderminqty:100,
+        orderaddqty:10,
+        unitid:'个',
+        status:'审核'
+      }]
+    }
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.produtMag-panel{
+  /* margin: 30px; */
+  padding:0 10px 10px 10px;
+  background: #fff;
+  border-radius:5px;
+  overflow: hidden;
+  border:1px solid rgb(0 0 0 / 5%)
+  /* box-shadow: 0 5px 5px rgb(0 0 0 / 10%);
+  transform: translate3d(0,-2px,0); */
+}
+</style>

+ 3 - 1
src/HManagement/clueManage/m_activity/modules/details.vue

@@ -44,7 +44,7 @@
         </el-select>
       </el-form-item>
     </el-form>
-    <tableLayout :layout="tablecols" :data="clueList" :custom="true">
+    <tableLayout :layout="activeName === 'first'?tablecols:tablecolsSaler" :data="clueList" :custom="true">
       <template v-slot:customcol="scope">
         <p>{{scope.column.data[scope.column.columnname]}}</p>
       </template>
@@ -164,6 +164,8 @@ export default {
   },
   created () {
     this.tablecols = this.tool.tabelCol(this.$route.name)['clueTable'].tablecols
+    this.tablecolsSaler = this.tool.tabelCol(this.$route.name)['clueSalerTable'].tablecols
+    
   }
 }
 

+ 1 - 1
src/HManagement/salesForecastTemplate/index.vue

@@ -54,7 +54,7 @@ export default {
     },
     tableRowClick (row) {
       this.sa_salesforecastmodelid = row.sa_salesforecastmodelid
-      this.$refs['forecast'].listData(row.sa_salesforecastmodelid)
+      this.$refs['forecast'].listData(row.sa_salesforecastmodelid,1)
     },
   }
 }

+ 5 - 4
src/HManagement/salesForecastTemplate/modules/forecastList.vue

@@ -4,7 +4,7 @@
     <p class="normal-title normal-margin">销售预测记录</p>
     <div class="flex-align-center  search-panel normal-margin">
       <p>搜索:</p>
-      <el-input style="width:200px" size="small" placeholder="模板名称" @keyup.native.enter="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" v-model="params.content.where.condition" prefix-icon="el-icon-search" clearable></el-input>
+      <el-input style="width:200px" size="small" placeholder="单号" @keyup.native.enter="listData(null,1)" @clear="listData(null,1)" v-model="params.content.where.condition" prefix-icon="el-icon-search" clearable></el-input>
     </div>
     <!-- 表格主题 -->
     <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :fixedName="'operation'" height="300px" @rowClick="rowClick">
@@ -67,7 +67,8 @@ export default {
     }
   },
   methods:{
-    async listData (sa_salesforecastmodelid) {
+    async listData (sa_salesforecastmodelid,pageNumber) {
+      this.params.content.pageNumber = pageNumber
       this.params.content.sa_salesforecastmodelid = sa_salesforecastmodelid?sa_salesforecastmodelid:this.params.content.sa_salesforecastmodelid
       const res = await this.$api.requested(this.params)
       this.list = res.data
@@ -77,12 +78,12 @@ export default {
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.params.content.pageSize = val
-      this.listData()
+      this.listData(null,this.params.content.pageNumber)
     },
     handleCurrentChange(val) {
       // console.log(`当前页: ${val}`);
       this.params.content.pageNumber = val
-      this.listData()
+      this.listData(null,val)
     },
     rowClick (row) {
       this.$emit('tableRowClick',row)

+ 5 - 2
src/components/upload/hw_obs_upload.vue

@@ -119,7 +119,7 @@ export default {
     },
 
     // 上传成功以后生成附件记录
-    async createFileRecord (obsfilename) {
+    async createFileRecord (obsfilename,attinfos) {
       let obj = {
          "serialfilename": obsfilename
       }
@@ -130,7 +130,9 @@ export default {
         "content":obj
       }
       const res = await this.$api.requested(param)
-      this.$emit('onSuccess',res)
+      if (res.code ===  1) {
+        this.$emit('onSuccess',res)
+      }
     },
 
     clearFiles () {
@@ -144,6 +146,7 @@ export default {
       this.dialogUploadVisible = false
     },
     onBindSuccess (res) {
+      console.log(res)
       this.$emit('onSuccess',res)
     }
   }

+ 19 - 0
src/router/HDrpManagement.js

@@ -1,4 +1,13 @@
 const HDrpManagement = [
+  {
+      path: '/brandmag',
+      name: 'brandmag',
+      meta: {
+          title: '品牌管理',
+          ast_nav: true
+      },
+      component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/BrandManage/index')
+  },
   {
     path: '/sm_unit',
     name: 'unit',
@@ -8,6 +17,16 @@ const HDrpManagement = [
       keeproute: true
     },
     component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/unit/index')
+  },
+  {
+    path: '/productmag',
+    name: 'productmag',
+    meta: {
+      title: '商品管理',
+      ast_nav: true,
+      keeproute: true
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/ProductMag/index')
   }
 ]
 export default HDrpManagement

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