|
|
@@ -0,0 +1,285 @@
|
|
|
+<template>
|
|
|
+ <view class="app-content">
|
|
|
+ <view class="billing_box_bg">
|
|
|
+ <view class="input-wrap" style="position: fixed;z-index:99999;background-color: white;width:100%;">
|
|
|
+ <view class="search-bar">
|
|
|
+ <app-search-module v-model="py" placeholder="这里搜索产品" @input="searchFnContrapose"/>
|
|
|
+ </view>
|
|
|
+ <view style="padding:0 0upx 0 20upx;" >
|
|
|
+ <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/item/add',type:2 })">添加新产品</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="position:fixed;z-index:99999;text-align:center;top:100upx;background-color:white;width:100%;height:60upx;font-size:26upx;">
|
|
|
+ <view style="display:flex;align-items:center;justify-content:center;margin-top:12upx;">带
|
|
|
+ <image :src="`${constant.imgUrl}/icon/official8.png`" mode="widthFix"
|
|
|
+ style="width:38upx;height:38upx;display:inline-block;"></image>
|
|
|
+ 为平台认证产品,请优先采用,用后可改名称图片</view>
|
|
|
+ </view>
|
|
|
+ <view class="scroll-middle_bx">
|
|
|
+ <block v-if="!$util.isEmpty(globalClassItemListContrapose)">
|
|
|
+ <view scroll-y class="item_list_bx" style="width: 100%">
|
|
|
+ <template v-for="(productItem, productIndex) in globalClassItemListContrapose">
|
|
|
+ <view style="padding: 20upx 0">
|
|
|
+ <ptJhItemInfo
|
|
|
+ :isPrice="false"
|
|
|
+ :key="productIndex"
|
|
|
+ :info="productItem"
|
|
|
+ :isEdit="true"
|
|
|
+ :modifyStock="modifyStock"
|
|
|
+ @selectItem="selectItem"
|
|
|
+ @modifyAuth="modifyAuth"
|
|
|
+ ></ptJhItemInfo>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <view style="width: 100%">
|
|
|
+ <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(globalClassItemListContrapose)"/></view>
|
|
|
+ </block>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <script>
|
|
|
+ import AppSearchModule from "@/components/module/app-search";
|
|
|
+ import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
+ import ptJhItemInfo from "./components/ptJhItem";
|
|
|
+ import productMins from "@/mixins/product";
|
|
|
+ import productContraposeMins from "@/mixins/ptProductContrapose";
|
|
|
+ import { mapGetters } from "vuex";
|
|
|
+ import { getAllItemClass } from "@/api/item-class";
|
|
|
+ import { delStatusUpdate } from "@/api/product";
|
|
|
+ import { changeAuth } from "@/api/pt-item";
|
|
|
+ export default {
|
|
|
+ name: "ptItemList",
|
|
|
+ components: {
|
|
|
+ AppSearchModule,
|
|
|
+ AppWrapperEmpty,
|
|
|
+ ptJhItemInfo
|
|
|
+ },
|
|
|
+ mixins: [productMins, productContraposeMins],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ autoLoad: false,
|
|
|
+ selectJobType: "getPtItem",
|
|
|
+ tabIndex: 0,
|
|
|
+ modifyStock:{},
|
|
|
+ allClass:[],
|
|
|
+ form: {
|
|
|
+ id:0,
|
|
|
+ delStatus:0,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ ...mapGetters(["getMyShopInfo","getLoginInfo"]),
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.ptItemInit()
|
|
|
+ },
|
|
|
+ onReachBottom(){
|
|
|
+ this.page++
|
|
|
+ this.shopId = this.getMyShopInfo.id;
|
|
|
+ this.initDataContrapose({ type:'waring', shopId: this.shopId,status:0,delStatus:0})
|
|
|
+ },
|
|
|
+ onShow(){
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ modifyAuth(id){
|
|
|
+ this.$util.confirmModal({content:'?'},() => {
|
|
|
+ changeAuth({id:id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.$msg('success')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ ptItemInit(){
|
|
|
+ this.shopId = this.getMyShopInfo.id;
|
|
|
+ this.initDataContrapose({ type:'waring', shopId: this.shopId,status:0,delStatus:0})
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ let that = this
|
|
|
+ getAllItemClass().then(res => {
|
|
|
+ if (this.$util.isEmpty(res.data)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ that.allClass = res.data
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectItem(item){
|
|
|
+ let that = this
|
|
|
+ if(item.select == 2 && item.is_delete == 1){
|
|
|
+ that.$util.confirmModal({content:'确认恢复?'},() => {
|
|
|
+ delStatusUpdate({id: item.ghs_item_id, delStatus: 0}).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$msg("恢复成功")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ if(item.select == 2){
|
|
|
+ this.$util.confirmModal({content:'确认查看?'},() => {
|
|
|
+ this.$util.pageTo({ url: '/admin/item/detail?id='+item.ghs_item_id})
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$util.confirmModal({content:'确认采用?'},() => {
|
|
|
+ this.$util.pageTo({ url: '/admin/item/detail',type:2,query:{ptItemId:item.id}})
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ affirm(val) {
|
|
|
+ if (val.index === 0) {
|
|
|
+ this.modalCancel();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ change(e) {
|
|
|
+ if (this.tabIndex == e.index) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中"
|
|
|
+ });
|
|
|
+ this.tabIndex = e.index;
|
|
|
+ this.globalClassItemListContrapose = this.allFilterProductInfoContrapose;
|
|
|
+ uni.hideLoading();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ scrollTop() {},
|
|
|
+ initProductInfo() {
|
|
|
+ this.globalClassItemListContrapose = [];
|
|
|
+ this.page = 1;
|
|
|
+ this.isMore = true;
|
|
|
+ },
|
|
|
+ selectSussess(val) {
|
|
|
+ uni.showLoading({ title: "加载中" })
|
|
|
+ this.initProductInfo();
|
|
|
+ let type = "waring";
|
|
|
+ this.shopId = val.selectItem.id;
|
|
|
+ this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ </script>
|
|
|
+ <style lang="scss" scoped>
|
|
|
+ .billing_box_bg {
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ background: white;
|
|
|
+ flex-direction: column;
|
|
|
+ .input-wrap {
|
|
|
+ display: flex;
|
|
|
+ padding: 22upx 20upx 22upx 30upx;
|
|
|
+ .search-bar {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ .city-select {
|
|
|
+ display: flex;
|
|
|
+ flex-shrink: 0;
|
|
|
+ align-items: center;
|
|
|
+ margin-right: 15upx;
|
|
|
+ margin-left: 45upx;
|
|
|
+ background-color: #ffff;
|
|
|
+ .iconfont {
|
|
|
+ margin-left: 20upx;
|
|
|
+ font-size: 30upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .scroll-middle_bx {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-top:155upx;
|
|
|
+ }
|
|
|
+ .tab-view {
|
|
|
+ height: 100%;
|
|
|
+ width: 170upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ background-color: #f0f2f6;
|
|
|
+ .tab-bar-item {
|
|
|
+ position: relative;
|
|
|
+ width: 170upx;
|
|
|
+ height: 90upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #444;
|
|
|
+ font-weight: 400;
|
|
|
+ .tag {
|
|
|
+ display: flex;
|
|
|
+ padding: 0 20upx;
|
|
|
+ align-items: center;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ height: 32upx;
|
|
|
+ background: #ff2842;
|
|
|
+ border-radius: 16upx;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 20upx;
|
|
|
+ }
|
|
|
+ &:last-child{
|
|
|
+ margin-bottom: 110upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ position: relative;
|
|
|
+ color: $mainColor;
|
|
|
+ font-size: 26upx;
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+ .active::before {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ border-left: 8upx solid $mainColor;
|
|
|
+ height: 100%;
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .right-box {
|
|
|
+ height: 100%;
|
|
|
+ flex: 1;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .item_list_bx {
|
|
|
+ padding: 10upx 40upx;
|
|
|
+ }
|
|
|
+ .item_list_title {
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ font-size: 24upx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #666666;
|
|
|
+ }
|
|
|
+ .select-cmd_bx {
|
|
|
+ & .kc {
|
|
|
+ color: #999999;
|
|
|
+ font-size: 28upx;
|
|
|
+ font-weight: 400;
|
|
|
+ margin-bottom: 60upx;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 10upx;
|
|
|
+ }
|
|
|
+ & .num_bx {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 80upx;
|
|
|
+ & > input {
|
|
|
+ width: 212upx;
|
|
|
+ height: 80upx;
|
|
|
+ border: 1upx solid #dddddd;
|
|
|
+ border-radius: 4upx;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 24upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </style>
|