| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <template>
- <view class="app-content">
- <view class="ex-page">
- <view class="input-wrap">
- <view style="padding:0 0upx 0 20upx;" >
- <button class="admin-button-com middle blue" style="background-color:green;border:1upx solid green;margin-right:20upx;" @click="allShow()">全部取消隐藏</button>
- </view>
- </view>
- <view style="margin-left:30upx;padding-top:10upx;padding-bottom:10upx;font-size:32upx;">点击红色的成本,可以将相应花材取消隐藏</view>
- <scroll-view scroll-y scroll-with-animation class="main-view">
- <view class="space-view ex-table">
- <t-table :headerBackgroundColor="'#F0F2F6'">
- <t-tr header>
- <t-th><view style="width:200upx;text-align:left;">花材</view></t-th>
- <t-th>库存</t-th>
- <t-th>路上</t-th>
- <t-th>大客</t-th>
- <t-th>批发</t-th>
- <t-th>零售</t-th>
- <t-th><view>成本</view></t-th>
- </t-tr>
- <block v-if="!$util.isEmpty(classItemData)">
- <block v-for="(classItem,classIndex) in classItemData" :key="classIndex">
- <block v-if="classItem.child && !$util.isEmpty(classItem.child)">
- <t-tr>
- <t-td>
- <text style="color:#3385FF;font-weight:bold;width:200upx;text-align:left;font-size:30upx;">
- {{ classItem.className }}
- </text>
- </t-td>
- <t-td>
- <text style="margin-left:30upx;color:green;font-weight:bold;font-size:30upx;" @click="cancelClassHide(classItem)">取消隐藏</text>
- </t-td>
- <t-td></t-td>
- </t-tr>
- <template v-if="classItem.child && !$util.isEmpty(classItem.child)">
- <block v-for="(productItem, productIndex) in classItem.child" :key="productIndex">
- <t-tr>
- <t-td>
- <view v-if="productItem.stock>0" style="width:200upx;text-align:left;color:black;font-size:29upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})">
- {{productItem.name}}
- </view>
- <view v-else style="width:200upx;text-align:left;color:#b5b3b3;font-size:29upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})">
- {{productItem.name}}
- </view>
- </t-td>
- <t-td>
- <view v-if="productItem.stock>0" style="color:#333333;font-weight:bold;font-size:29upx;">
- {{productItem.stock?parseFloat(productItem.stock):0}}
- </view>
- <view v-else style="color:#b5b3b3;font-weight:bold;font-size:29upx;">
- {{productItem.stock?parseFloat(productItem.stock):0}}
- </view>
- </t-td>
- <t-td>
- <text v-if="Number(productItem.onStock)>0" style="color:#0a97a9;font-size:30upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
- {{productItem.onStock}}
- </text>
- <text v-else style="color:#0a97a9;font-size:30upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
- -
- </text>
- </t-td>
- <t-td>
- <view style="font-size:28upx;">
- ¥{{productItem.hjPrice?parseFloat(productItem.hjPrice):0}}
- </view>
- </t-td>
- <t-td>
- <view style="color:#3385FF;font-size:30upx;">
- ¥{{productItem.price?parseFloat(productItem.price):0}}
- </view>
- </t-td>
- <t-td>
- <view style="font-size:28upx;">
- ¥{{productItem.skPrice?parseFloat(productItem.skPrice):0}}
- </view>
- </t-td>
- <t-td>
- <view style="font-size:28upx;color:red;" @click="showCurrentItme(productItem)">
- ¥{{productItem.avCost?parseFloat(productItem.avCost):0}}
- </view>
- </t-td>
- </t-tr>
- </block>
- </template>
- </block>
- </block>
- </block>
- </t-table>
- </view>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import AppWrapperEmpty from "@/components/app-wrapper-empty";
- import SelectList from "@/components/plugin/selectList";
- import { getProductDataApi } from "@/api/product";
- import { cancelAllItemHide,cancelClassItemHide,changeFrontHide } from "@/api/item";
- import { list } from "@/mixins";
- import ShopSelect from "@/components/module/shopSelect";
- import DateSelect from "@/components/module/dateSelect";
- import {mapGetters} from "vuex";
- import AppSearchModule from "@/components/module/app-search";
- export default {
- components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,AppSearchModule},
- mixins: [list],
- computed: {
- ...mapGetters(["getDictionariesInfo","getLoginInfo","getMyShopInfo"])
- },
- data() {
- return {
- isShow:false,
- customizationTime:'',
- shopId:'',
- itemId:'',
- nowTime: "",
- showTimeDropdown: false,
- nowShop: "",
- showShopDropdown: false,
- dataList: [],
- profile:[],
- storageData:[],
- searchContent:'',
- shopId:0,
- classItemData:[],
- form:{shopId:0,shopName:'',hasSelect:0},
- confirmIn:0
- };
- },
- onLoad() {
- this.showHideItem()
- },
- methods: {
- init(){
- },
- cancelClassHide(classInfo){
- this.$util.confirmModal({content:'确认此分类下花材取消隐藏?'},() => {
- cancelClassItemHide({classId:classInfo.classId}).then(res=>{
- this.$msg('操作成功')
- this.showHideItem()
- })
- })
- },
- showCurrentItme(item){
- this.$util.confirmModal({content:'确认此花材取消隐藏?'},() => {
- changeFrontHide({id:item.id,status:0}).then(res=>{
- if(res.code == 1){
- this.$msg('操作成功')
- this.showHideItem()
- }
- })
- })
- },
- allShow(){
- this.$util.confirmModal({content:'确认所有花材取消隐藏?'},() => {
- cancelAllItemHide().then(res=>{
- if(res.code == 1){
- this.$msg('操作成功')
- this.showHideItem()
- }
- })
- })
- },
- showHideItem(){
- this.shopId = this.getMyShopInfo.id;
- let type = '';
- let that = this
- uni.showLoading()
- getProductDataApi({ type, shopId: this.shopId,status:0,requestType:'hideItem'}).then(res=>{
- uni.hideLoading()
- if(res.code == 1){
- that.classItemData = res.data.classItem ? res.data.classItem : []
- }
- })
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .ex-page {
- background: white;
- padding-top:20upx;
- height: 100%;
- display: flex;
- flex-direction: column;
- .input-wrap {
- display: flex;
- padding: 0upx 20upx 0upx 13upx;
- .search-bar {
- flex: 1;
- }
- }
- .top-bar {
- width: 100%;
- z-index: 20;
- .bar{
- width: 50%;
- height: 100%;
- text-align: center;
- &:nth-child(1){
- border-right: 1upx solid #eeeeec;
- }
- }
- }
- .main-view {
- margin-top:10upx;
- flex: 1;
- background-color: #f9fbfc;
- .space-view {
- background-color: #fff;
- }
- .ex-info {
- padding: 30upx;
- .info-cell {
- display: flex;
- align-items: center;
- font-size: 28upx;
- &:not(:first-child) {
- margin-top: 20upx;
- }
- .cell-label {
- width: 110upx;
- color: #666666;
- }
- .cell-value {
- margin-left: 40upx;
- color: #333;
- &.warning {
- color: #ffaf1d;
- }
- &.success {
- color: #27c325;
- }
- }
- }
- }
- .ex-table {
- ::v-deep.icon-info {
- color: #333333;
- }
- }
- }
- .bar-view {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 30upx;
- width: 100%;
- height: 100upx;
- box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
- .info-view {
- font-size: 26upx;
- }
- .btn-view {
- display: flex;
- .admin-button-com {
- margin: 0 10upx;
- }
- }
- }
- }
- </style>
|