zhaolf 3 vuotta sitten
vanhempi
commit
eb5301ad64

+ 1 - 0
.gitignore

@@ -1,2 +1,3 @@
 node_modules
 package-lock.json
+dist

+ 2 - 2
public/js/config.js

@@ -1,4 +1,4 @@
 window.global_config = {
-  // BASE_URL: 'http://221.224.53.27:20038/',
-  BASE_URL: 'http://172.16.0.28:8085/',
+  BASE_URL: 'http://221.224.53.27:20038/',
+  // BASE_URL: 'http://172.16.0.28:8085/',
 }

+ 1 - 2
src/components/tabbar.vue

@@ -8,7 +8,7 @@
                     </div>
                     <div class="mid">
                         <i :class="[pageicon, 'iconfont']"></i>
-                        <span>{{item.name}}</span>
+                        <span >{{item.name}}</span>
                         <i :class="['el-icon-close', (clickIndex==index&&index!=0)?'close':(index!=0?'closenone':'closeforever')]"
                             @click.stop="deleteTab(item,index)"></i>
                     </div>
@@ -88,7 +88,6 @@
                 padding-left: 10px;
                 padding-right: 10px;
                 font-size: 14px;
-
                 .close {
                     margin-left: 5px;
                 }

+ 55 - 52
src/components/upload.vue

@@ -1,35 +1,27 @@
 <template>
   <div>
     <div class="flex">
-      <el-upload
-        class="avatar-uploader"
-        list-type="picture-card"
-        :action="action"
-        :on-remove="handleRemove"
-        :accept="acceptType"
-        :headers="myHeaders"
-        :multiple="limitNum == 1?false:true"
-        :limit='limitNum'
-        :on-exceed="handleExceed"
-        :on-change='handleChangeUpload'
-        :on-success="handleSuccess"
-        :on-preview="handlePictureCardPreview"
-        :file-list="fileList"
-        :show-file-list="acceptType =='.jpg, .jpeg, .png'?false:true"
-        :disabled="disabled"
-        :auto-upload="autoUpload" 
-      >
+      <div v-if="acceptType =='.jpg, .jpeg, .png'" class="flex">
+        <div v-for="(item, index) in fileList" :key="index" class="file-list">
+          <img :src="item.url" />
+          <div class="mask">
+            <i class="el-icon-zoom-in" @click="view(index)"></i>
+            <i class="el-icon-delete" v-if="!disabled" @click="del(index)"></i>
+          </div>
+        </div>
+      </div>
+
+      <el-upload v-if="!disabled" class="avatar-uploader" list-type="picture-card" :action="action" :on-remove="handleRemove"
+        :accept="acceptType" :headers="myHeaders" :multiple="limitNum == 1?false:true" :limit='limitNum'
+        :on-exceed="handleExceed" :on-change='handleChangeUpload' :on-success="handleSuccess"
+        :on-preview="handlePictureCardPreview" :file-list="fileList"
+        :show-file-list="acceptType =='.jpg, .jpeg, .png'?false:true" :disabled="disabled" :auto-upload="autoUpload">
         <i class="el-icon-plus avatar-uploader-icon"></i>
       </el-upload>
     </div>
     <span class="tip" v-if="warning">{{warning}}</span>
-    <el-dialog
-      title="查看"
-      :visible.sync="dialogVisible"
-      width="500px"
-      :close-on-click-modal="false"
-    > 
-      <img :src="dialogImageUrl" style="width:100%;"/>
+    <el-dialog title="查看" :visible.sync="dialogVisible" width="500px" :close-on-click-modal="false">
+      <img :src="dialogImageUrl" style="width:100%;" />
       <span slot="footer" class="dialog-footer">
         <el-button type="info" @click="dialogVisible = false">关闭</el-button>
       </span>
@@ -38,11 +30,10 @@
 </template>
 
 <script>
-import store from '@/store'
+  import store from '@/store'
   export default {
     name: "index",
-    components: {
-    },
+    components: {},
     props: {
       warning: {
         type: String,
@@ -79,15 +70,18 @@ import store from '@/store'
         dialogVisible: false,
         imgUrl: '',
         baseUrl: '',
-        dialogImageUrl:''
+        dialogImageUrl: ''
       };
     },
     computed: {
-      action(){
+      action() {
         return global_config.BASE_URL + this.uploadUrl;
       },
-      myHeaders(){
-        return {Authorization: 'Bearer ' + store.getters.getToken, 'X-Token':store.getters.getToken};
+      myHeaders() {
+        return {
+          Authorization: 'Bearer ' + store.getters.getToken,
+          'X-Token': store.getters.getToken
+        };
       }
     },
     created() {
@@ -95,13 +89,13 @@ import store from '@/store'
     },
     methods: {
       // 手动上传
-      handleChangeUpload(fileData){
-        if(!this.autoUpload){
+      handleChangeUpload(fileData) {
+        if (!this.autoUpload) {
           let event = event || window.event;
           let file = event.target.files[0];
           let reader = new FileReader();
           let that = this;
-          reader.onload = function(e) {
+          reader.onload = function (e) {
             that.baseUrl = e.target.result;
             that.$emit('changeUpload', fileData, that.baseUrl);
           }
@@ -109,7 +103,7 @@ import store from '@/store'
         }
       },
       // 上传成功
-      handleSuccess(response, file, fileList){
+      handleSuccess(response, file, fileList) {
         this.fileList.push({
           name: response.fileName,
           url: response.message
@@ -121,27 +115,27 @@ import store from '@/store'
       },
       // 上传超过限制
       handleExceed(files, fileList) {
-        if(fileList.length >= this.limitNum){
+        if (fileList.length >= this.limitNum) {
           this.$message.closeAll();
           this.$message.warning(`当前限制选择${this.limitNum}个文件`);
         }
       },
-      handlePictureCardPreview(file){
+      handlePictureCardPreview(file) {
         this.dialogImageUrl = file.url;
         this.dialogVisible = true;
       },
-      view(index){
+      view(index) {
         this.dialogVisible = true;
-        this.imgUrl = this.fileList[index].url;
+        this.dialogImageUrl = this.fileList[index].url;
       },
-      del(index){
+      del(index) {
         this.fileList.splice(index, 1);
       }
     }
   };
 </script>
 <style lang="less" scoped>
-  .file-list{
+  .file-list {
     margin-right: 5px;
     position: relative;
     width: 150px;
@@ -151,12 +145,14 @@ import store from '@/store'
     align-items: center;
     border: 1px dashed #d9d9d9;
     border-radius: 6px;
-    &:hover{
-      .mask{
+
+    &:hover {
+      .mask {
         opacity: 1;
       }
     }
-    .mask{
+
+    .mask {
       opacity: 0;
       position: absolute;
       top: 0;
@@ -169,17 +165,20 @@ import store from '@/store'
       align-items: center;
       justify-content: center;
       font-size: 18px;
-      i{
-        cursor:pointer;
+
+      i {
+        cursor: pointer;
         margin: 0 10px;
       }
     }
-    img{
+
+    img {
       max-width: 150px;
       max-height: 150px;
       display: block;
     }
   }
+
   // .avatar-uploader{
   //   line-height: initial;
   //   width: 150px;
@@ -191,9 +190,11 @@ import store from '@/store'
     position: relative;
     overflow: hidden;
   }
+
   .avatar-uploader /deep/.el-upload:hover {
     border-color: #409EFF;
   }
+
   .avatar-uploader-icon {
     font-size: 28px;
     color: #8c939d;
@@ -202,13 +203,15 @@ import store from '@/store'
     line-height: 148px;
     text-align: center;
   }
+
   .avatar {
     width: 148px;
     height: 148px;
     display: block;
   }
-  .tip{
-    color:#f56c6c;
-    font-size:14px;
+
+  .tip {
+    color: #f56c6c;
+    font-size: 14px;
   }
-</style>
+</style>

+ 6 - 6
src/pages/brand/addBrand/index.vue

@@ -56,22 +56,22 @@
                     </el-date-picker>
                 </el-form-item>
                 <el-form-item class="single" label="营业执照或组织机构代码证:" required>
-                    <upload v-if="updatePic" :file="org_code_certificateList" limitNum="10"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="org_code_certificateList" limitNum="10"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="销售授权书(如商持人为自然人,还需提供:">
-                    <upload v-if="updatePic" :file="authorizationList" limitNum="10"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="authorizationList" limitNum="10"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="商标注册证书:">
-                    <upload v-if="updatePic" :file="registration_certificateList" limitNum="10"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="registration_certificateList" limitNum="10"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="商标变更证明:">
-                    <upload v-if="updatePic" :file="change_certificateList" limitNum="10"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="change_certificateList" limitNum="10"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="商标注册申请受理通知书:">
-                    <upload v-if="updatePic" :file="registration_applicationList" limitNum="10"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="registration_applicationList" limitNum="10"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="中华人民共和国海关进口货物报关单:">
-                    <upload v-if="updatePic" :file="goods_formList" limitNum="10"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="goods_formList" limitNum="10"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="备注:">
                     <el-input placeholder="请输入" v-model="form.remark" maxlength="25">

+ 6 - 6
src/pages/brand/brandDetail/index.vue

@@ -69,26 +69,26 @@
                     </el-date-picker>
                 </el-form-item>
                 <el-form-item class="single" label="营业执照或组织机构代码证:">
-                    <upload v-if="updatePic" :file="org_code_certificateList" :disabled="isdisable" limitNum="10">
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="org_code_certificateList" :disabled="isdisable" limitNum="10">
                     </upload>
                 </el-form-item>
                 <el-form-item class="single" label="销售授权书(如商持人为自然人,还需提供:">
-                    <upload v-if="updatePic" :file="authorizationList" :disabled="isdisable" limitNum="10"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="authorizationList" :disabled="isdisable" limitNum="10"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="商标注册证书:">
-                    <upload v-if="updatePic" :file="registration_certificateList" :disabled="isdisable" limitNum="10">
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="registration_certificateList" :disabled="isdisable" limitNum="10">
                     </upload>
                 </el-form-item>
                 <el-form-item class="single" label="商标变更证明:">
-                    <upload v-if="updatePic" :file="change_certificateList" :disabled="isdisable" limitNum="10">
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="change_certificateList" :disabled="isdisable" limitNum="10">
                     </upload>
                 </el-form-item>
                 <el-form-item class="single" label="商标注册申请受理通知书:">
-                    <upload v-if="updatePic" :file="registration_applicationList" :disabled="isdisable" limitNum="10">
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="registration_applicationList" :disabled="isdisable" limitNum="10">
                     </upload>
                 </el-form-item>
                 <el-form-item class="single" label="中华人民共和国海关进口货物报关单:">
-                    <upload v-if="updatePic" :file="goods_formList" limitNum="10" :disabled="isdisable"></upload>
+                    <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :file="goods_formList" limitNum="10" :disabled="isdisable"></upload>
                 </el-form-item>
                 <el-form-item class="single" label="备注:">
                     <el-input placeholder="请输入" :disabled="isdisable" v-model="form.remark" maxlength="25">

+ 52 - 36
src/pages/goods/addGoods/index.vue

@@ -1,13 +1,13 @@
 <template>
     <div class="wrapper">
-        <div class="title">新增商品</div>
+        <div class="title">{{title}}</div>
         <el-form class="form" ref="form" :model="form" label-width="80px" :rules="rules">
-            <el-form-item class="single" label="商品名:" label-width="100px" prop="title">
+            <el-form-item class="single" label="商品名:" label-width="120px" prop="title">
                 <el-input class="pr-50" placeholder="请输入" v-model="form.title" maxlength="60" :disabled="isdisable"
                     show-word-limit>
                 </el-input>
             </el-form-item>
-            <el-form-item label="类目:" label-width="100px" prop="third_cat_id">
+            <el-form-item label="类目:" label-width="120px" prop="third_cat_id">
                 <el-select v-model="form.third_cat_id" placeholder="请选择" :disabled="isdisable" clearable filterable>
                     <el-option v-for="item in categoryList" :key="item.level3" :label="item.level3_name"
                         :value="item.level3">
@@ -19,7 +19,7 @@
                 <el-input placeholder="请输入" :disabled="isdisable" type='number' v-model="form.out_product_id" maxlength="25">
                 </el-input>
             </el-form-item>
-            <el-form-item label="品牌:" label-width="100px" prop="brand_id">
+            <el-form-item label="品牌:" label-width="120px" prop="brand_id">
                 <el-select v-model="form.brand_id" :disabled="isdisable" placeholder="请选择" clearable filterable>
                     <el-option v-for="item in brandList" :key="item.brand_info_id" :label="item.trademark_registrant"
                         :value="item.brand_info_id">
@@ -31,17 +31,17 @@
                 <el-input placeholder="请输入" :disabled="isdisable" type='number' maxlength="25" v-model="form.stock_num">
                 </el-input>
             </el-form-item>
-            <el-form-item label="售卖价格:" label-width="100px" prop="sale_price">
+            <el-form-item label="售卖价格(分):" label-width="120px" prop="sale_price">
                 <el-input placeholder="请输入" :disabled="isdisable" type='number' maxlength="25"
                     v-model="form.sale_price">
                 </el-input>
             </el-form-item>
-            <el-form-item label="市场价格:" label-width="100px" prop="market_price">
+            <el-form-item label="市场价格(分):" label-width="120px" prop="market_price">
                 <el-input placeholder="请输入" :disabled="isdisable" type='number' maxlength="25"
                     v-model="form.market_price">
                 </el-input>
             </el-form-item>
-            <el-form-item class="single" label="小程序链接:" label-width="100px" prop="path">
+            <el-form-item class="single" label="小程序链接:" label-width="120px" prop="path">
                 <el-input class="pr-50" :disabled="isdisable" placeholder="请输入" v-model="form.path" maxlength="100">
                 </el-input>
             </el-form-item>
@@ -53,24 +53,23 @@
                 <el-input placeholder="请输入" :disabled="isdisable" maxlength="25">
                 </el-input>
             </el-form-item>
-            <el-form-item label="三级类目:" v-if="form.third_cat_id=='-1'" label-width="100px"
+            <el-form-item label="三级类目:" v-if="form.third_cat_id=='-1'" label-width="120px"
                 :rules="[{ required: form.third_cat_id=='-1', message: '请输入必填项', trigger: 'blur' }]">
                 <el-input placeholder="请输入" :disabled="isdisable" type='number' maxlength="25" v-model="form.third">
                 </el-input>
             </el-form-item>
-            <el-form-item class="single" label="商品图片:" label-width="100px" required>
-                <upload v-if="updatePic" :disabled="isdisable" ref="upload_goods" :file="goodsList" limitNum="1">
+            <el-form-item class="single" label="商品图片:" label-width="120px" required>
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :disabled="isdisable" ref="upload_goods" :file="goodsList" limitNum="1">
                 </upload>
             </el-form-item>
-            <el-form-item class="single" label="商品类目图片:" label-width="100px">
-                <upload v-if="updatePic" :disabled="isdisable" ref="upload_zizhi" :file="goodszizhiList" limitNum="10">
+            <el-form-item class="single" label="商品资质图片:" label-width="120px">
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' :disabled="isdisable" ref="upload_zizhi" :file="goodszizhiList" limitNum="10">
                 </upload>
             </el-form-item>
             <el-form-item class="commit" v-if="!isdisable">
                 <el-button class="blackbtn" :loading="loading" @click.native.prevent="commit">提交
                 </el-button>
             </el-form-item>
-
         </el-form>
     </div>
 </template>
@@ -102,6 +101,7 @@
         props: {},
         data() {
             return {
+                title:'新增商品',
                 categoryList: [],
                 brandList: [],
                 goodsList: [],
@@ -201,7 +201,7 @@
                         if (this.outProductId == 0) { //新增
                             add(params).then(() => {
                                 this.$message.success('添加成功');
-                                store.commit('REMOVETAB', '新增商品')
+                                store.commit('REMOVETAB', '商品信息')
                                 this.$router.go(-1)
                             }).catch(() => {
                                 this.loading = false
@@ -210,7 +210,7 @@
                             params.commodity_id = this.commodity_id
                             edit(params).then(() => {
                                 this.$message.success('修改成功');
-                                store.commit('REMOVETAB', '新增商品')
+                                store.commit('REMOVETAB', '商品信息')
                                 store.commit('REMOVETAB', '商品详情')
                                 this.$router.push('/goods')
                             }).catch(() => {
@@ -220,7 +220,6 @@
 
                     }
                 })
-
             },
             getDetail() {
                 if (this.outProductId != 0) {
@@ -228,21 +227,20 @@
                         outProductId: this.outProductId
                     }).then(res => {
                         this.form.title = res.data.title
-                        this.form.third_cat_audit = res.data.third_cat_audit==0?-1:1
                         this.form.out_product_id = res.data.out_product_id
-                        this.form.has_brand = res.data.has_brand==0?-1:1
                         this.form.stock_num = res.data.stock_num
                         this.form.sale_price = res.data.sale_price
                         this.form.market_price = res.data.market_price
                         this.form.path = res.data.path
+                        this.form.brand_id=res.data.has_brand==0?'-1':res.data.has_brand
                         this.form.third=res.data.third_cat_audit==0?res.data.third_cat_id:''
-                        this.form.third_cat_id =res.data.third_cat_id
+                        this.form.third_cat_id =res.data.third_cat_audit==0?'-1':res.data.third_cat_id
                         this.commodity_id = res.data.commodity_id
                         this.goodsList = [{
                             url: res.data.thumb_img
                         }]
                         this.goodszizhiList = []
-                        if (res.data.qualificationImgs.length > 0) {
+                        if (res.data?.qualificationImgs?.length > 0) {
                             res.data.qualificationImgs.forEach(element => {
                                 this.goodszizhiList.push({
                                     url: element
@@ -274,28 +272,46 @@
                 this.$refs.form.clearValidate()
                 if (this.$route.params.outProductId) { //新增获取详情
                     this.outProductId = this.$route.params.outProductId
+                    this.title='修改商品'
                     this.getDetail()
                     if (this.$route.params.isDisable) {
+                        this.title='商品详情'
                         this.isdisable = true
                     }
                 }
                 if (this.$route.params.isNew) { //新增清空
+                    this.title='新增商品'
                     this.outProductId = 0
-                    this.form = {
-                        title: '',
-                        third_cat_audit: '',
-                        out_product_id: '',
-                        has_brand: '',
-                        stock_num: '',
-                        sale_price: '',
-                        market_price: '',
-                        path: '',
-                        third_cat_id: '',
-                        third: '',
-                        brand_id: '',
+                    if(this.$route.params.data){
+                        let data=JSON.parse(this.$route.params.data)
+                        this.form.title=data.title
+                        this.form.out_product_id=data.out_product_id
+                        this.form.stock_num=data.stock_num
+                        this.form.sale_price=data.sale_price
+                        this.form.market_price=data.market_price
+                        this.form.path=data.path
+                        this.form.third_cat_id=data.third_cat_id
+                        this.form.third=data.third
+                        this.form.brand_id=data.brand_id
+                        this.goodsList=data.goodsList
+                        this.goodszizhiList=data.goodszizhiList
+                    }else{
+                        this.form = {
+                            title: '',
+                            third_cat_audit: '',
+                            out_product_id: '',
+                            has_brand: '',
+                            stock_num: '',
+                            sale_price: '',
+                            market_price: '',
+                            path: '',
+                            third_cat_id: '',
+                            third: '',
+                            brand_id: '',
+                        }
+                        this.goodsList = []
+                        this.goodszizhiList = []
                     }
-                    this.goodsList = []
-                    this.goodszizhiList = []
                     //刷新子组件
                     this.updatePic = false
                     this.$nextTick(() => {
@@ -348,11 +364,11 @@
                 width: 100%;
 
                 .el-input {
-                    width: 875px;
+                    width: 855px;
                 }
 
                 .el-select {
-                    width: 875px;
+                    width: 855px;
                 }
             }
 

+ 45 - 17
src/pages/goods/goodsDetail/index.vue

@@ -27,9 +27,11 @@
                 </el-input>
             </el-form-item>
             <el-form-item label="类目:" label-width="100px">
-                <el-select v-model="form.third_cat_audit" placeholder="请选择" clearable disabled filterable>
-                    <el-option label="申请通过的类目" value="1"></el-option>
-                    <el-option label="无需审核类目" value="0"></el-option>
+                <el-select v-model="form.third_cat_id" placeholder="请选择" clearable disabled filterable>
+                    <el-option v-for="item in categoryList" :key="item.level3" :label="item.level3_name"
+                        :value="item.level3">
+                    </el-option>
+                    <el-option label="无需审核类目" value="-1"></el-option>
                 </el-select>
             </el-form-item>
             <el-form-item label="商品ID:" label-width="100px">
@@ -37,9 +39,11 @@
                 </el-input>
             </el-form-item>
             <el-form-item label="品牌:" label-width="100px">
-                <el-select v-model="form.has_brand" placeholder="请选择" clearable disabled filterable>
-                    <el-option label="申请通过的品牌" value="1"></el-option>
-                    <el-option label="无品牌" value="0"></el-option>
+                <el-select v-model="form.brand_id" placeholder="请选择" clearable disabled filterable>
+                     <el-option v-for="item in brandList" :key="item.brand_info_id" :label="item.trademark_registrant"
+                        :value="item.brand_info_id">
+                    </el-option>
+                    <el-option label="无品牌" value="-1"></el-option>
                 </el-select>
             </el-form-item>
             <el-form-item label="商品库存:" label-width="100px">
@@ -66,15 +70,15 @@
                 <el-input placeholder="请输入" disabled maxlength="25">
                 </el-input>
             </el-form-item>
-            <el-form-item label="三级类目:" v-if="form.third_cat_audit=='0'" label-width="100px">
-                <el-input placeholder="请输入" disabled maxlength="25" v-model="form.third_cat_id">
+            <el-form-item label="三级类目:" v-if="form.third_cat_id=='-1'" label-width="100px">
+                <el-input placeholder="请输入" disabled maxlength="25" v-model="form.third">
                 </el-input>
             </el-form-item>
             <el-form-item class="single" label="商品图片:" label-width="100px">
-                <upload v-if="updatePic" ref="upload_goods" :file="goodsList" limitNum="1" :disabled="true"></upload>
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' ref="upload_goods" :file="goodsList" limitNum="1" :disabled="true"></upload>
             </el-form-item>
             <el-form-item class="single" label="商品类目图片:" label-width="100px">
-                <upload v-if="updatePic" ref="upload_zizhi" :file="goodszizhiList" limitNum="1" :disabled="true">
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' ref="upload_zizhi" :file="goodszizhiList" limitNum="1" :disabled="true">
                 </upload>
             </el-form-item>
         </el-form>
@@ -85,6 +89,12 @@
     import store from '@/store/index'
     import upload from '@/components/upload'
     import {
+        getCategoryList
+    } from '@/api/category'
+    import {
+        getBrandList
+    } from '@/api/brand'
+    import {
         add,
         detail
     } from "@/api/goods";
@@ -96,6 +106,8 @@
         props: {},
         data() {
             return {
+                categoryList: [],
+                brandList: [],
                 goodsList: [],
                 updatePic: true,
                 goodszizhiList: [],
@@ -113,7 +125,8 @@
                     market_price: '',
                     path: '',
                     third_cat_id: '',
-                    commodity_id: null
+                    commodity_id: null,
+                    third:''
                 },
                 loading: false
             };
@@ -125,21 +138,21 @@
                 detail({
                     outProductId: this.outProductId
                 }).then(res => {
-                    if (res.data.auditInfo.status) {
+                    if (res.data?.auditInfo?.status) {
                         this.status = res.data.auditInfo.status
                     }
                     this.statusName = res.data.auditInfo.statusName
                     this.form.commodity_id = res.data.commodity_id
                     this.reject_reason = res.data.auditInfo.reject_reason
                     this.form.title = res.data.title
-                    this.form.third_cat_audit = res.data.third_cat_audit
-                    this.form.out_product_id = res.data.out_product_id
-                    this.form.has_brand = res.data.has_brand
+                    this.form.out_product_id = res.data?.auditInfo?.out_product_id
+                    this.form.brand_id=res.data.has_brand==0?'-1':res.data.has_brand
+                    this.form.third=res.data.third_cat_audit==0?res.data.third_cat_id:''
                     this.form.stock_num = res.data.stock_num
                     this.form.sale_price = res.data.sale_price
                     this.form.market_price = res.data.market_price
                     this.form.path = res.data.path
-                    this.form.third_cat_id = res.data.third_cat_id
+                    this.form.third_cat_id =res.data.third_cat_audit==0?'-1':res.data.third_cat_audit
                     this.goodsList = [{
                         url: res.data.thumb_img
                     }]
@@ -159,10 +172,13 @@
                 })
             },
             commitNew() { // 提交新审核
+                this.form.goodsList=this.goodsList
+                this.form.goodszizhiList=this.goodszizhiList
                 this.$router.push({
                     name: "addGoods",
                     params: {
-                        isNew: true
+                        isNew: true,
+                        data:JSON.stringify(this.form)
                     }
                 });
             },
@@ -175,7 +191,19 @@
                     }
                 });
             },
+            getCategoryList() { //获取类目列表
+                getCategoryList().then(res => {
+                    this.categoryList = res.data
+                })
+            },
+            getBrandList() { //获取品牌列表
+                getBrandList().then(res => {
+                    this.brandList = res.data
+                })
+            },
             initPage() {
+                this.getCategoryList()
+                this.getBrandList()
                 if (this.$route.params.outProductId) {
                     this.outProductId = this.$route.params.outProductId
                     this.getDetail()

+ 6 - 5
src/pages/login/index.vue

@@ -3,7 +3,7 @@
     <img class="left" src="../../../static/images/loginbg_left.png" />
     <div class="right flex column">
       <img class="logo" src="../../../static/images/logo.png" />
-      <span class="welcome">欢迎登</span>
+      <span class="welcome">欢迎登</span>
       <el-form class="form" ref="loginForm" :model="loginForm" label-width="80px" label-position="top"
         :rules="loginRules" hide-required-asterisk>
         <el-form-item label="账号:" prop="account">
@@ -13,7 +13,7 @@
           <el-input v-model="loginForm.password" @keyup.enter.native="handleLogin" placeholder="请输入密码" maxlength="20" show-password clearable></el-input>
         </el-form-item>
         <el-form-item>
-          <el-button class="loginbtn blackbtn" :loading="loading" @click.native.prevent="handleLogin">登</el-button>
+          <el-button class="loginbtn blackbtn" :loading="loading" @click.native.prevent="handleLogin">登</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -37,7 +37,7 @@
           account: [{
             required: true,
             trigger: "blur",
-            message: "用户名不能为空"
+            message: "账号不能为空"
           }],
           password: [{
             required: true,
@@ -87,10 +87,11 @@
 
 <style lang="less">
   .login {
-    padding: 0 0 0 0 !important;
+    padding: 0px 0px 0px 0px !important;
+    margin: 0px 0px 0px 0px !important;
     background-color: white !important;
+    height: 103.5% !important;
   }
-
   .left {
     width: 33%;
   }

+ 2 - 2
src/pages/qualification/addCategory/index.vue

@@ -19,10 +19,10 @@
                 </el-input>
             </el-form-item>
             <el-form-item class="single" label="营业执照或组织机构代码证:" required>
-                <upload v-if="updatePic" ref="upload_goods" :file="licenseImgs" limitNum="10"></upload>
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' ref="upload_goods" :file="licenseImgs" limitNum="10"></upload>
             </el-form-item>
             <el-form-item class="single" label="资质材料URL:" required>
-                <upload v-if="updatePic" ref="upload_zizhi" :file="certificateImgs" limitNum="10"></upload>
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' ref="upload_zizhi" :file="certificateImgs" limitNum="10"></upload>
             </el-form-item>
             <el-form-item class="single" label="备注:">
                 <el-input placeholder="请输入" v-model="form.remark" maxlength="25">

+ 2 - 2
src/pages/qualification/categoryDetail/index.vue

@@ -29,11 +29,11 @@
                 </el-input>
             </el-form-item>
             <el-form-item class="single" label="营业执照或组织机构代码证:">
-                <upload v-if="updatePic" ref="upload_goods" :disabled="isDisable" :file="licenseImgs" limitNum="10">
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' ref="upload_goods" :disabled="isDisable" :file="licenseImgs" limitNum="10">
                 </upload>
             </el-form-item>
             <el-form-item class="single" label="资质材料URL:">
-                <upload v-if="updatePic" ref="upload_zizhi" :disabled="isDisable" :file="certificateImgs" limitNum="10">
+                <upload v-if="updatePic" acceptType='.jpg, .jpeg, .png' ref="upload_zizhi" :disabled="isDisable" :file="certificateImgs" limitNum="10">
                 </upload>
             </el-form-item>
             <el-form-item class="single" label="备注:">

+ 1 - 1
src/router/routes.js

@@ -41,7 +41,7 @@ export const otherRouter = [
   {
     name: 'addGoods',
     path: '/goods/addGoods',
-    meta: { title: '新增商品' , keepAlive:true},
+    meta: { title: '商品信息' , keepAlive:true},
     component: () => import('@/pages/goods/addGoods/index.vue'),
   },
   {

+ 6 - 2
src/utils/validate.js

@@ -21,7 +21,7 @@ export function validUsername(str) {
 export function validnumber(rule, value, callback) {
   if (value === '' || value === undefined || value === null) {
     if(rule.required){
-      callback(new Error('请输入必填项'))
+      callback(new Error('请输入正整数'))
     }else{
       callback()
     }
@@ -30,7 +30,11 @@ export function validnumber(rule, value, callback) {
     if ((!reg.test(value)) && value !== '') {
       callback(new Error('只能是正整数'))
     } else {
-      callback()
+      if(Number.parseInt(value)==0){
+        callback(new Error('请输入大于0整数'))
+      }else{
+        callback()
+      }
     }
   }
 }