|
|
@@ -0,0 +1,256 @@
|
|
|
+<template>
|
|
|
+ <view class="app-content">
|
|
|
+ <view class="ex-page">
|
|
|
+ <view class="input-wrap">
|
|
|
+ <view class="search-bar">
|
|
|
+ <input type="text" v-model="py" class="inp-input" placeholder="这里搜索" @input="searchFn"
|
|
|
+ style="border:none;font-size:30upx;color:black;background-color:#ece5e5;border-radius:50upx;height:70upx;padding:0 25upx 0 25upx;" @focus="clear()" />
|
|
|
+ </view>
|
|
|
+ </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>图片</t-th>
|
|
|
+ <t-th><view style="width:230upx;">名称</view></t-th>
|
|
|
+ <t-th>价格</t-th>
|
|
|
+ <t-th>数量</t-th>
|
|
|
+ <t-th>操作</t-th>
|
|
|
+ </t-tr>
|
|
|
+ <block v-if="!$util.isEmpty(list.data)">
|
|
|
+ <block v-for="(productItem, productIndex) in list.data" :key="productIndex">
|
|
|
+ <t-tr>
|
|
|
+ <t-td>
|
|
|
+ <image :src="productItem.smallCover" style="width:80upx;height:80upx;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})"></image>
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <view style="width:230upx;text-align:left;color:black;font-size:26upx;overflow: hidden; white-space: nowrap;font-weight:bold;"
|
|
|
+ @click="pageTo({url:'/admin/item/detail?id='+productItem.id})">
|
|
|
+ <text style="color:#3385ff;margin-right:3upx;" v-if="productItem.frontHide == 1">隐</text>
|
|
|
+ {{productItem.name}}
|
|
|
+ <view style="font-weight:normal;font-size:24upx;color:#a09999;margin-top:5upx;">剩 {{productItem.stock ? parseFloat(productItem.stock) : 0 }}</view>
|
|
|
+ </view>
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <input type="digit" v-model="productItem.price" class="inp-input" placeholder="价格" style="border:1upx solid #CCCCCC;font-size:24upx;color:black;" />
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <input type="number" v-model="productItem.bigCount" class="inp-input" placeholder="数量" style="border:1upx solid #CCCCCC;font-size:24upx;color:black;" />
|
|
|
+ </t-td>
|
|
|
+ <t-td>
|
|
|
+ <button @click="changeItem(productItem)" class="admin-button-com blue mini-btn">更换</button>
|
|
|
+ </t-td>
|
|
|
+ </t-tr>
|
|
|
+ </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 { getSimleList } from "@/api/item";
|
|
|
+import { list } from "@/mixins";
|
|
|
+import ShopSelect from "@/components/module/shopSelect";
|
|
|
+import DateSelect from "@/components/module/dateSelect";
|
|
|
+import {mapActions, mapGetters} from "vuex";
|
|
|
+import AppSearchModule from "@/components/module/app-search";
|
|
|
+import ModalModule from "@/components/plugin/modal"
|
|
|
+import { addItem,filterName,chageItem } from "@/api/order-item";
|
|
|
+import productMins from "@/mixins/product";
|
|
|
+export default {
|
|
|
+ components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,AppSearchModule,ModalModule},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getDictionariesInfo","getLoginInfo","getMyShopInfo"])
|
|
|
+ },
|
|
|
+ mixins: [productMins,list],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ selectJobType: "selectchangeitem",
|
|
|
+ py:'',
|
|
|
+ num:0,
|
|
|
+ currentInfo:{},
|
|
|
+ printLabelShow:false,
|
|
|
+ printItemId:0,
|
|
|
+ printType:0,
|
|
|
+ printNum:'',
|
|
|
+ printFocus:false,
|
|
|
+ warning:0,
|
|
|
+ posterUrl:'',
|
|
|
+ breakNum:'',
|
|
|
+ breakFocus:false,
|
|
|
+ breakShow:false,
|
|
|
+ checkStock:false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ let id = this.option.id?this.option.id:0
|
|
|
+ filterName({id:id}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.py = res.data.name ? res.data.name : ''
|
|
|
+ this.num = res.data.num ? res.data.num : 0
|
|
|
+ this.getSimpleData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onPullDownRefresh() {
|
|
|
+ this.resetList();
|
|
|
+ this.getSimpleData()
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this.getSimpleData().then((res) => {
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ changeItem(item){
|
|
|
+ let orderSn = this.option.orderSn?this.option.orderSn:''
|
|
|
+ let id = this.option.id ? this.option.id : 0
|
|
|
+ let num = item.bigCount ? item.bigCount : 0
|
|
|
+ if(Number(num)<=0){
|
|
|
+ this.$msg('请填写数量')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let price = item.price?item.price:0
|
|
|
+ let productId = item.id?item.id:0
|
|
|
+ chageItem({orderSn:orderSn,delId:id,num:num,price:price,productId:productId}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.$msg(res.msg)
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let prevPage = pages[ pages.length - 2 ];
|
|
|
+ prevPage.$vm.addSelectItem = 1
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ init(){
|
|
|
+
|
|
|
+ },
|
|
|
+ clear(){
|
|
|
+ this.py=''
|
|
|
+ this.getSimpleData()
|
|
|
+ },
|
|
|
+ searchFn(){
|
|
|
+ this.resetList()
|
|
|
+ this.getSimpleData()
|
|
|
+ },
|
|
|
+ getSimpleData(){
|
|
|
+ let that = this
|
|
|
+ return getSimleList({name:this.py,page: this.list.page,num:this.num}).then(res=>{
|
|
|
+ this.completes(res)
|
|
|
+ if (this.$util.isEmpty(res.data)){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.ex-page {
|
|
|
+ background: white;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .input-wrap {
|
|
|
+ display: flex;
|
|
|
+ padding: 22upx 20upx 22upx 13upx;
|
|
|
+ .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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .top-bar {
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ top:130upx;
|
|
|
+ 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>
|