Browse Source

auto commit

gcz 4 years ago
parent
commit
9c95bfb22b

+ 2 - 1
config/dev.env.js

@@ -6,5 +6,6 @@ module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   NODE_ENV: '"development"',
   // BASE_API: '"http://172.16.90.3:9098/forest-admin"'//邱波电脑
   // BASE_API: '"http://172.16.90.3:9098/forest-admin"'//邱波电脑
   // BASE_API: '"http://172.16.90.64:9098/forest-admin"'
   // BASE_API: '"http://172.16.90.64:9098/forest-admin"'
-  BASE_API: '"http://172.16.90.8:9098/forest-admin"'//东东
+  // BASE_API: '"http://172.16.90.8:9098/forest-admin"'//东东
+  BASE_API: '"http://172.16.90.43:9098/forest-admin"'//东东
 })
 })

+ 8 - 1
src/api/brand.js

@@ -50,4 +50,11 @@ export function updateBrand(id,data) {
     data:data
     data:data
   })
   })
 }
 }
-
+//根据供应商id查询生产地
+export function fetchOriginList(id) {
+  return request({
+    url:'/product/plOfPro/select',
+    method:'get',
+    params:id
+  })
+}

+ 7 - 0
src/api/role.js

@@ -76,3 +76,10 @@ export function allocResource(data) {
     data:data
     data:data
   })
   })
 }
 }
+//供应商下拉列表
+export function companyList(data) {
+  return request({
+    url: 'umsCompany/select/list',
+    method: 'get'
+  })
+}

+ 7 - 3
src/views/pms/product/components/ProductAttrDetail.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div style="margin-top: 50px">
   <div style="margin-top: 50px">
     <el-form :model="value" ref="productAttrForm" label-width="120px" style="width: 720px" size="small">
     <el-form :model="value" ref="productAttrForm" label-width="120px" style="width: 720px" size="small">
-      <el-form-item label="属性类型:">
+      <!-- <el-form-item label="属性类型:">
         <el-select v-model="value.productAttributeCategoryId"
         <el-select v-model="value.productAttributeCategoryId"
                    placeholder="请选择属性类型"
                    placeholder="请选择属性类型"
                    @change="handleProductAttrChange">
                    @change="handleProductAttrChange">
@@ -130,7 +130,7 @@
             <el-input v-else class="paramInput" v-model="selectProductParam[index].value"></el-input>
             <el-input v-else class="paramInput" v-model="selectProductParam[index].value"></el-input>
           </div>
           </div>
         </el-card>
         </el-card>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="商品相册:">
       <el-form-item label="商品相册:">
         <multi-upload v-model="selectProductPics"></multi-upload>
         <multi-upload v-model="selectProductPics"></multi-upload>
       </el-form-item>
       </el-form-item>
@@ -146,7 +146,8 @@
       </el-form-item>
       </el-form-item>
       <el-form-item style="text-align: center">
       <el-form-item style="text-align: center">
         <el-button size="medium" @click="handlePrev">上一步,填写商品促销</el-button>
         <el-button size="medium" @click="handlePrev">上一步,填写商品促销</el-button>
-        <el-button type="primary" size="medium" @click="handleNext">下一步,选择商品关联</el-button>
+        <!-- <el-button type="primary" size="medium" @click="handleNext">下一步,选择商品关联</el-button> -->
+        <el-button type="primary" size="medium" @click="handleFinishCommit">完成,提交商品</el-button>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
   </div>
   </div>
@@ -600,6 +601,9 @@
         this.mergeProductAttrValue();
         this.mergeProductAttrValue();
         this.mergeProductAttrPics();
         this.mergeProductAttrPics();
         this.$emit('nextStep')
         this.$emit('nextStep')
+      },
+      handleFinishCommit(){       
+        this.$emit('finishCommit',this.isEdit);
       }
       }
     }
     }
   }
   }

+ 12 - 8
src/views/pms/product/components/ProductDetail.vue

@@ -4,7 +4,7 @@
       <el-step title="填写商品信息"></el-step>
       <el-step title="填写商品信息"></el-step>
       <el-step title="填写商品促销"></el-step>
       <el-step title="填写商品促销"></el-step>
       <el-step title="填写商品属性"></el-step>
       <el-step title="填写商品属性"></el-step>
-      <el-step title="选择商品关联"></el-step>
+      <!-- <el-step title="选择商品关联"></el-step> -->
     </el-steps>
     </el-steps>
     <product-info-detail
     <product-info-detail
       v-show="showStatus[0]"
       v-show="showStatus[0]"
@@ -23,16 +23,16 @@
       v-show="showStatus[2]"
       v-show="showStatus[2]"
       v-model="productParam"
       v-model="productParam"
       :is-edit="isEdit"
       :is-edit="isEdit"
-      @nextStep="nextStep"
-      @prevStep="prevStep">
+      @prevStep="prevStep"
+      @finishCommit="finishCommit">
     </product-attr-detail>
     </product-attr-detail>
-    <product-relation-detail
+    <!-- <product-relation-detail
       v-show="showStatus[3]"
       v-show="showStatus[3]"
       v-model="productParam"
       v-model="productParam"
       :is-edit="isEdit"
       :is-edit="isEdit"
       @prevStep="prevStep"
       @prevStep="prevStep"
       @finishCommit="finishCommit">
       @finishCommit="finishCommit">
-    </product-relation-detail>
+    </product-relation-detail> -->
   </el-card>
   </el-card>
 </template>
 </template>
 <script>
 <script>
@@ -44,8 +44,10 @@
 
 
   const defaultProductParam = {
   const defaultProductParam = {
     albumPics: '',
     albumPics: '',
-    brandId: null,
+    brandId: null,    
     brandName: '',
     brandName: '',
+    placeOfProductionId: null,
+    placeOfProduction:'',
     deleteStatus: 0,
     deleteStatus: 0,
     description: '',
     description: '',
     detailDesc: '',
     detailDesc: '',
@@ -102,7 +104,8 @@
     unit: '',
     unit: '',
     usePointLimit: 0,
     usePointLimit: 0,
     verifyStatus: 0,
     verifyStatus: 0,
-    weight: 0
+    weight: 0,
+    spec:''//规格
   };
   };
   export default {
   export default {
     name: 'ProductDetail',
     name: 'ProductDetail',
@@ -124,6 +127,7 @@
       if(this.isEdit){
       if(this.isEdit){
         getProduct(this.$route.query.id).then(response=>{
         getProduct(this.$route.query.id).then(response=>{
           this.productParam=response.data;
           this.productParam=response.data;
+          console.log('productParam',JSON.parse(JSON.stringify(this.productParam)))
         });
         });
       }
       }
     },
     },
@@ -148,7 +152,7 @@
         }
         }
       },
       },
       finishCommit(isEdit) {
       finishCommit(isEdit) {
-        // console.log('this.productParam',JSON.parse(JSON.stringify(this.productParam)));
+        console.log('this.productParam',JSON.parse(JSON.stringify(this.productParam)));
         this.$confirm('是否要提交该产品', '提示', {
         this.$confirm('是否要提交该产品', '提示', {
           confirmButtonText: '确定',
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           cancelButtonText: '取消',

+ 41 - 1
src/views/pms/product/components/ProductInfoDetail.vue

@@ -26,6 +26,19 @@
           </el-option>
           </el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
+      <el-form-item label="生产地:" prop="placeOfProductionId">
+        <el-select
+          v-model="value.placeOfProductionId"
+          @change="handleOriginChange"
+          placeholder="请选择生产地">
+          <el-option
+            v-for="item in originOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="商品介绍:">
       <el-form-item label="商品介绍:">
         <el-input
         <el-input
           :autoSize="true"
           :autoSize="true"
@@ -48,6 +61,9 @@
       <el-form-item label="计量单位:">
       <el-form-item label="计量单位:">
         <el-input v-model="value.unit"></el-input>
         <el-input v-model="value.unit"></el-input>
       </el-form-item>
       </el-form-item>
+      <el-form-item label="规格:">
+        <el-input v-model="value.spec"></el-input>
+      </el-form-item>
       <el-form-item label="商品重量:">
       <el-form-item label="商品重量:">
         <el-input v-model="value.weight" style="width: 300px"></el-input>
         <el-input v-model="value.weight" style="width: 300px"></el-input>
         <span style="margin-left: 20px">克</span>
         <span style="margin-left: 20px">克</span>
@@ -64,7 +80,7 @@
 
 
 <script>
 <script>
   import {fetchListWithChildren} from '@/api/productCate'
   import {fetchListWithChildren} from '@/api/productCate'
-  import {fetchList as fetchBrandList} from '@/api/brand'
+  import {fetchList as fetchBrandList,fetchOriginList} from '@/api/brand'
   import {getProduct} from '@/api/product';
   import {getProduct} from '@/api/product';
 
 
   export default {
   export default {
@@ -83,6 +99,7 @@
         selectProductCateValue: [],
         selectProductCateValue: [],
         productCateOptions: [],
         productCateOptions: [],
         brandOptions: [],
         brandOptions: [],
+        originOptions:[],
         rules: {
         rules: {
           name: [
           name: [
             {required: true, message: '请输入商品名称', trigger: 'blur'},
             {required: true, message: '请输入商品名称', trigger: 'blur'},
@@ -91,6 +108,7 @@
           subTitle: [{required: true, message: '请输入商品副标题', trigger: 'blur'}],
           subTitle: [{required: true, message: '请输入商品副标题', trigger: 'blur'}],
           productCategoryId: [{required: true, message: '请选择商品分类', trigger: 'blur'}],
           productCategoryId: [{required: true, message: '请选择商品分类', trigger: 'blur'}],
           brandId: [{required: true, message: '请选择商品品牌', trigger: 'blur'}],
           brandId: [{required: true, message: '请选择商品品牌', trigger: 'blur'}],
+          placeOfProductionId: [{required: true, message: '请选择生产地', trigger: 'blur'}],
           description: [{required: true, message: '请输入商品介绍', trigger: 'blur'}],
           description: [{required: true, message: '请输入商品介绍', trigger: 'blur'}],
           requiredProp: [{required: true, message: '该项为必填项', trigger: 'blur'}]
           requiredProp: [{required: true, message: '该项为必填项', trigger: 'blur'}]
         }
         }
@@ -99,6 +117,7 @@
     created() {
     created() {
       this.getProductCateList();
       this.getProductCateList();
       this.getBrandList();
       this.getBrandList();
+      this.getOriginList();
     },
     },
     computed:{
     computed:{
       //商品的编号
       //商品的编号
@@ -139,6 +158,7 @@
       },
       },
       getProductCateList() {
       getProductCateList() {
         fetchListWithChildren().then(response => {
         fetchListWithChildren().then(response => {
+          // console.log('getProductCateList',JSON.parse(JSON.stringify(response)))
           let list = response.data;
           let list = response.data;
           this.productCateOptions = [];
           this.productCateOptions = [];
           for (let i = 0; i < list.length; i++) {
           for (let i = 0; i < list.length; i++) {
@@ -161,6 +181,16 @@
           }
           }
         });
         });
       },
       },
+      getOriginList() {
+        fetchOriginList({pageNum: 1, pageSize: 100}).then(response => {
+          console.log('getOriginList',response);
+          this.originOptions = [];
+          let originList = response.data;
+          for (let i = 0; i < originList.length; i++) {
+            this.originOptions.push({label: originList[i].text, value: originList[i].lable});
+          }
+        });
+      },
       getCateNameById(id){
       getCateNameById(id){
         let name=null;
         let name=null;
         for(let i=0;i<this.productCateOptions.length;i++){
         for(let i=0;i<this.productCateOptions.length;i++){
@@ -197,6 +227,16 @@
           }
           }
         }
         }
         this.value.brandName = brandName;
         this.value.brandName = brandName;
+      },
+      handleOriginChange(val) {
+        let placeOfProduction = '';
+        for (let i = 0; i < this.originOptions.length; i++) {
+          if (this.originOptions[i].value === val) {
+            placeOfProduction = this.originOptions[i].label;
+            break;
+          }
+        }
+        this.value.placeOfProduction = placeOfProduction;
       }
       }
     }
     }
   }
   }

+ 2 - 2
src/views/pms/product/components/ProductSaleDetail.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div style="margin-top: 50px">
   <div style="margin-top: 50px">
     <el-form :model="value" ref="productSaleForm" label-width="120px" style="width: 600px" size="small">
     <el-form :model="value" ref="productSaleForm" label-width="120px" style="width: 600px" size="small">
-      <el-form-item label="赠送积分:">
+      <!-- <el-form-item label="赠送积分:">
         <el-input v-model="value.giftPoint"></el-input>
         <el-input v-model="value.giftPoint"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="赠送成长值:">
       <el-form-item label="赠送成长值:">
@@ -16,7 +16,7 @@
           :active-value="1"
           :active-value="1"
           :inactive-value="0">
           :inactive-value="0">
         </el-switch>
         </el-switch>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="商品上架:">
       <el-form-item label="商品上架:">
         <el-switch
         <el-switch
           v-model="value.publishStatus"
           v-model="value.publishStatus"

+ 30 - 3
src/views/ums/admin/index.vue

@@ -114,6 +114,16 @@
         <el-form-item label="密码:">
         <el-form-item label="密码:">
           <el-input v-model="admin.password"  type="password" style="width: 250px"></el-input>
           <el-input v-model="admin.password"  type="password" style="width: 250px"></el-input>
         </el-form-item>
         </el-form-item>
+        <el-form-item label="供应商:">
+          <el-select v-model="admin.compName" @change="companyChange($event)" filterable placeholder="请选择">
+            <el-option
+              v-for="item in companyList"              
+              :key="item.lable"
+              :label="item.text"
+              :value="item.text">
+            </el-option>
+          </el-select>          
+        </el-form-item>
         <el-form-item label="备注:">
         <el-form-item label="备注:">
           <el-input v-model="admin.note"
           <el-input v-model="admin.note"
                     type="textarea"
                     type="textarea"
@@ -153,7 +163,7 @@
 </template>
 </template>
 <script>
 <script>
   import {fetchList,createAdmin,updateAdmin,updateStatus,deleteAdmin,getRoleByAdmin,allocRole} from '@/api/login';
   import {fetchList,createAdmin,updateAdmin,updateStatus,deleteAdmin,getRoleByAdmin,allocRole} from '@/api/login';
-  import {fetchAllRoleList} from '@/api/role';
+  import {fetchAllRoleList,companyList} from '@/api/role';
   import {formatDate} from '@/utils/date';
   import {formatDate} from '@/utils/date';
 
 
   const defaultListQuery = {
   const defaultListQuery = {
@@ -184,12 +194,17 @@
         allocDialogVisible: false,
         allocDialogVisible: false,
         allocRoleIds:[],
         allocRoleIds:[],
         allRoleList:[],
         allRoleList:[],
-        allocAdminId:null
+        allocAdminId:null,
+        companyList:[],
       }
       }
     },
     },
     created() {
     created() {
       this.getList();
       this.getList();
       this.getAllRoleList();
       this.getAllRoleList();
+      companyList().then(response => {
+        console.log('companyList',response);
+        this.companyList = response.data;
+      });
     },
     },
     filters: {
     filters: {
       formatDateTime(time) {
       formatDateTime(time) {
@@ -260,7 +275,16 @@
       handleUpdate(index, row) {
       handleUpdate(index, row) {
         this.dialogVisible = true;
         this.dialogVisible = true;
         this.isEdit = true;
         this.isEdit = true;
-        this.admin = Object.assign({},row);
+        this.admin = Object.assign({},row);      
+        console.log('row',row);
+      },
+      companyChange(e){
+        let obj = this.companyList.filter( (item) =>{
+          return item.text == e
+        })
+        if(obj.length>0){          
+          this.admin.compId = obj[0].lable
+        }
       },
       },
       handleDialogConfirm() {
       handleDialogConfirm() {
         this.$confirm('是否要确认?', '提示', {
         this.$confirm('是否要确认?', '提示', {
@@ -269,6 +293,9 @@
           type: 'warning'
           type: 'warning'
         }).then(() => {
         }).then(() => {
           if (this.isEdit) {
           if (this.isEdit) {
+            // console.log('this.company',this.company);
+            // console.log('this.admin',this.admin);
+            // return false;
             updateAdmin(this.admin.id,this.admin).then(response => {
             updateAdmin(this.admin.id,this.admin).then(response => {
               this.$message({
               this.$message({
                 message: '修改成功!',
                 message: '修改成功!',

+ 13 - 4
src/views/ums/company/components/companyDetail.vue

@@ -35,7 +35,7 @@
         <el-input v-model="jdurl"></el-input>
         <el-input v-model="jdurl"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="自主商城地址">
       <el-form-item label="自主商城地址">
-        <el-input v-model="selfurl"></el-input>
+        <el-input v-model="ownurl"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="是否认证">
       <el-form-item label="是否认证">
         <el-switch          
         <el-switch          
@@ -182,7 +182,7 @@
         company:Object.assign({}, defaultCompany),
         company:Object.assign({}, defaultCompany),
         jdurl:'',
         jdurl:'',
         taobaourl:'',
         taobaourl:'',
-        selfurl:'',
+        ownurl:'',
         rules: {
         rules: {
           compName: [
           compName: [
             {required: true, message: '请输入品牌名称', trigger: 'blur'},
             {required: true, message: '请输入品牌名称', trigger: 'blur'},
@@ -215,6 +215,11 @@
             return item.shopType == "taobao"
             return item.shopType == "taobao"
           });
           });
           if(taobaoshop.length>0){this.taobaourl = taobaoshop[0].shopUrl;}
           if(taobaoshop.length>0){this.taobaourl = taobaoshop[0].shopUrl;}
+          
+          let ownshop =  this.company.shops.filter( (item) => {
+            return item.shopType == "own"
+          });
+          if(ownshop.length>0){this.ownurl = ownshop[0].shopUrl;}
           // 商城地址
           // 商城地址
           console.log('this.company',JSON.parse(JSON.stringify(this.company)));
           console.log('this.company',JSON.parse(JSON.stringify(this.company)));
         });
         });
@@ -261,11 +266,15 @@
         // 商城地址
         // 商城地址
         this.company.shops=[];
         this.company.shops=[];
         if(this.taobaourl.length>0){
         if(this.taobaourl.length>0){
-          this.company.shops.push({shopType:'taobao',shopUrl:this.taobaourl});
+          this.company.shops.push({shopType:'taobao',shopUrl:this.taobaourl,shopImg:'http://fqn.hongweisoft.com/taobao.jpg'});
         }
         }
 
 
         if(this.jdurl.length>0){
         if(this.jdurl.length>0){
-          this.company.shops.push({shopType:'jd',shopUrl:this.jdurl});
+          this.company.shops.push({shopType:'jd',shopUrl:this.jdurl,shopImg:'http://fqn.hongweisoft.com/jingdong.jpg'});
+        }
+
+        if(this.ownurl.length>0){
+          this.company.shops.push({shopType:'own',shopUrl:this.ownurl,shopImg:'http://bpic.588ku.com/element_pic/20/06/30/65ed28bc8f14415778c878ecca4bacc8.jpg'});
         }
         }
 
 
         // 商城地址
         // 商城地址