瀏覽代碼

产品和花材

shish 2 年之前
父節點
當前提交
4ef8b1710f

+ 0 - 1
ghsApp/src/admin/changePrice/stopList.vue

@@ -57,7 +57,6 @@
 
 
       <div class="app-footer">
       <div class="app-footer">
 		<button class="admin-button-com big blue" @click="enableSelect()">恢复所选</button>
 		<button class="admin-button-com big blue" @click="enableSelect()">恢复所选</button>
-		<button class="admin-button-com big blue" @click="removeSelect()">彻底删除</button>
       </div>
       </div>
 
 
 		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
 		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">

+ 15 - 3
ghsApp/src/admin/cp/components/term.vue

@@ -5,9 +5,16 @@
         <image :src="`${constant.imgUrl}/icon/official8.png`" v-if="info.detail.auth && info.detail.auth == 1" mode="widthFix" class="official"></image>
         <image :src="`${constant.imgUrl}/icon/official8.png`" v-if="info.detail.auth && info.detail.auth == 1" mode="widthFix" class="official"></image>
 
 
 		<view class="img_bx" @click="pageTo({url: '/admin/item/detail?id='+info.detail.id})">
 		<view class="img_bx" @click="pageTo({url: '/admin/item/detail?id='+info.detail.id})">
-			<view v-if="info.detail.status == 2" class="sold-out">
-				<view class="sold-out-xj">已下架</view>
-			</view>
+			<block v-if="info.detail.delStatus == 1">
+				<view v-if="info.detail.status == 2" class="sold-out">
+					<view class="del-item">已删除</view>
+				</view>
+			</block>
+			<block v-else>
+				<view v-if="info.detail.status == 2" class="sold-out">
+					<view class="sold-out-xj">已下架</view>
+				</view>
+			</block>
 			<image :src="info.detail.cover" style="width:160upx;height:160upx;" lazy-load="true" :lazy-load-margin="0"></image>
 			<image :src="info.detail.cover" style="width:160upx;height:160upx;" lazy-load="true" :lazy-load-margin="0"></image>
 
 
 		</view>
 		</view>
@@ -145,6 +152,11 @@ export default {
 				line-height:160upx;
 				line-height:160upx;
 				font-size:28upx;
 				font-size:28upx;
 			}
 			}
+			.del-item{
+				line-height:160upx;
+				font-size:28upx;
+				color:red;
+			}
 		}
 		}
 	}
 	}
 	.cmd-info_bx {
 	.cmd-info_bx {

+ 1 - 2
ghsApp/src/admin/home/apply.vue

@@ -41,8 +41,7 @@ export default {
                         {name: "加价管理",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
                         {name: "加价管理",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/add"},
                         {name: "批量排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},
                         {name: "批量排序",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/itemClass/sort"},
                         {name: "已下架",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/outList"},
                         {name: "已下架",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/outList"},
-                        {name: "已删除",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/stopList"},
-                        {name: "彻底删除",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/removeList"}
+                        {name: "已删除",img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`,url: "/admin/changePrice/stopList"}
                     ]
                     ]
                 },
                 },
                 {
                 {

+ 42 - 2
ghsApp/src/admin/item/add.vue

@@ -62,6 +62,16 @@
           </view>
           </view>
         </tui-list-cell>
         </tui-list-cell>
 
 
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">所属产品</view>
+          <view>
+            <block v-if="form.cpInfo && !$util.isEmpty(form.cpInfo)">
+              <button v-for="(cpItem, cpIndex) in form.cpInfo" class="admin-button-com blue mini-btn" style="margin-right:8upx;" @click.stop="delOneCp(cpItem,cpIndex)">{{cpItem.cpName}} ×</button>
+            </block>
+            <button class="admin-button-com default mini-btn" @click.stop="changeCp()">添加产品</button>
+          </view>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">比例类型</div>
           <div class="tui-title">比例类型</div>
           <radio-group class="tui-input" @change="ratioTypeChange">
           <radio-group class="tui-input" @change="ratioTypeChange">
@@ -230,7 +240,8 @@ export default {
         itemId:0,
         itemId:0,
         smallRatio:1,
         smallRatio:1,
         ratioType:0,
         ratioType:0,
-        inTurn:100
+        inTurn:100,
+        cpInfo:[]
       },
       },
       itemClassSelectedData:{},
       itemClassSelectedData:{},
       itemClassData:[],
       itemClassData:[],
@@ -239,12 +250,31 @@ export default {
       bigUnitSelectedData:{},
       bigUnitSelectedData:{},
       hasRequest:0,
       hasRequest:0,
       productData:{id:0},
       productData:{id:0},
-      headers:{token:''}
+      headers:{token:''},
+      backCpInfo:{cpId:0,cpName:'',needUpdate:0}
     };
     };
   },
   },
 	computed:{
 	computed:{
 		...mapGetters(["getLoginInfo","getDictionariesInfo"])
 		...mapGetters(["getLoginInfo","getDictionariesInfo"])
 	},
 	},
+  onShow(){
+    let that = this
+    if(this.backCpInfo.needUpdate == 1){
+      let needAdd = 1;
+      if (!this.$util.isEmpty(this.form.cpInfo)) {
+        that.form.cpInfo.forEach((item) => {
+          if(item.cpId == that.backCpInfo.cpId){
+            needAdd = 0
+          }
+        })
+      }
+      if(needAdd == 1){
+        that.form.cpInfo.push({cpId:that.backCpInfo.cpId,cpName:that.backCpInfo.cpName})
+        that.backCpInfo.needUpdate = 0
+        that.$forceUpdate()
+      }
+    }
+  },
   onLoad(option) {
   onLoad(option) {
     if(option.id){
     if(option.id){
       this.form.id = this.option.id
       this.form.id = this.option.id
@@ -253,6 +283,16 @@ export default {
     this.headers.token = token
     this.headers.token = token
   },
   },
   methods: {
   methods: {
+    delOneCp(info,index){
+      let that = this
+      that.$util.confirmModal({content:'确认删除'+info.cpName+'?'},() => {
+        that.form.cpInfo.splice(index,1)
+        that.$forceUpdate()
+      })
+    },
+    changeCp(item){
+      this.$util.pageTo({url: '/admin/cp/list?skip=1'})
+    },
     changeClass(item){
     changeClass(item){
       this.$refs.classRef.open('center')
       this.$refs.classRef.open('center')
     },
     },

+ 42 - 2
ghsApp/src/admin/item/copy.vue

@@ -62,6 +62,16 @@
           </view>
           </view>
         </tui-list-cell>
         </tui-list-cell>
 
 
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">所属产品</view>
+          <view>
+            <block v-if="form.cpInfo && !$util.isEmpty(form.cpInfo)">
+              <button v-for="(cpItem, cpIndex) in form.cpInfo" class="admin-button-com blue mini-btn" style="margin-right:8upx;" @click.stop="delOneCp(cpItem,cpIndex)">{{cpItem.cpName}} ×</button>
+            </block>
+            <button class="admin-button-com default mini-btn" @click.stop="changeCp()">添加产品</button>
+          </view>
+        </tui-list-cell>
+
         <tui-list-cell class="line-cell" :hover="false">
         <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">比例类型</div>
           <div class="tui-title">比例类型</div>
           <radio-group class="tui-input flex-center-between" @change="ratioTypeChange">
           <radio-group class="tui-input flex-center-between" @change="ratioTypeChange">
@@ -230,7 +240,8 @@ export default {
         status:2,
         status:2,
         itemId:0,
         itemId:0,
         smallRatio:1,
         smallRatio:1,
-        ratioType:0
+        ratioType:0,
+        cpInfo:[]
       },
       },
       itemClassData:[],
       itemClassData:[],
       unitData:[],
       unitData:[],
@@ -238,7 +249,8 @@ export default {
       bigUnitSelectedData:{},
       bigUnitSelectedData:{},
       hasRequest:0,
       hasRequest:0,
       productData:{id:0},
       productData:{id:0},
-      headers:{token:''}
+      headers:{token:''},
+      backCpInfo:{cpId:0,cpName:'',needUpdate:0}
     };
     };
   },
   },
 	computed:{
 	computed:{
@@ -251,7 +263,35 @@ export default {
     const token = uni.getStorageSync('token')
     const token = uni.getStorageSync('token')
     this.headers.token = token
     this.headers.token = token
   },
   },
+  onShow(){
+    let that = this
+    if(this.backCpInfo.needUpdate == 1){
+      let needAdd = 1;
+      if (!this.$util.isEmpty(this.form.cpInfo)) {
+        that.form.cpInfo.forEach((item) => {
+          if(item.cpId == that.backCpInfo.cpId){
+            needAdd = 0
+          }
+        })
+      }
+      if(needAdd == 1){
+        that.form.cpInfo.push({cpId:that.backCpInfo.cpId,cpName:that.backCpInfo.cpName})
+        that.backCpInfo.needUpdate = 0
+        that.$forceUpdate()
+      }
+    }
+  },
   methods: {
   methods: {
+    delOneCp(info,index){
+      let that = this
+      that.$util.confirmModal({content:'确认删除'+info.cpName+'?'},() => {
+        that.form.cpInfo.splice(index,1)
+        that.$forceUpdate()
+      })
+    },
+    changeCp(item){
+      this.$util.pageTo({url: '/admin/cp/list?skip=1'})
+    },
     changeClass(item){
     changeClass(item){
       this.$refs.classRef.open('center')
       this.$refs.classRef.open('center')
     },
     },