| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <template>
- <view class="app-content">
- <view class="ex-page">
- <view class="input-wrap">
- <view class="search-bar">
- <app-search-module v-model="py" placeholder="输拼音首字母也可以搜" @input="searchFn"/>
- </view>
- </view>
- <scroll-view scroll-y scroll-with-animation class="main-view">
- <view class="space-view ex-table">
- <view style="line-height:55upx;" v-if="!$util.isEmpty(selectList)">
- <text v-for="(item, index) in selectList" :key="index" style="margin-right:36upx;font-size:30upx;" @click="delProduct(item)">{{ item.name }} {{ item.bigCount }} x</text>
- <button @click="confirmChange()" class="admin-button-com blue mini-btn">确认添加</button>
- </view>
- <t-table :headerBackgroundColor="'#F0F2F6'">
- <block v-if="!$util.isEmpty(list.data)">
- <block v-for="(productItem, productIndex) in list.data" :key="productIndex">
- <t-tr>
- <t-td>
- <view style="width:230upx;text-align:left;color:black;font-size:28upx;
- overflow: hidden; white-space: nowrap; text-overflow: ellipsis;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>
- </t-td>
- <t-td>
- <input type="number" v-model="productItem.bigCount" class="inp-input" style="border:1upx solid #CCCCCC;font-size:29upx;color:black;" />
- </t-td>
- <t-td>
- <button @click="tjItem(productItem)" class="admin-button-com blue middle">添加</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 { getProductDataApi,print,cancelDiscountPrice,cancelPreSell,delStatusUpdate } from "@/api/product";
- import { getSimleList } from "@/api/item";
- import { allOut } from "@/api/stock-out"
- 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 { getWeixinId } from "@/api/invite";
- import { addItem } 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: "selectitem",
- py:'',
- currentInfo:{},
- printLabelShow:false,
- getAppIdList:{},
- printItemId:0,
- printType:0,
- printNum:'',
- printFocus:false,
- warning:0,
- posterUrl:'',
- breakNum:'',
- breakFocus:false,
- breakShow:false,
- checkStock:false
- };
- },
- onLoad() {
- this.getSimpleData()
- let that = this
- getWeixinId().then(res => {
- that.getAppIdList = res.data
- })
- this.selectJobId = this.option.id ? this.option.id : 0
- },
- onPullDownRefresh() {
- this.resetList();
- this.getSimpleData()
- uni.stopPullDownRefresh()
- },
- onReachBottom() {
- if (!this.list.finished) {
- this.getSimpleData().then((res) => {
- uni.stopPullDownRefresh()
- })
- } else {
- uni.stopPullDownRefresh()
- }
- },
- methods: {
- confirmChange(){
- let that = this
- if(this.$util.isEmpty(this.selectList)){
- this.$msg('请选择花材')
- return false
- }
- let id = this.option.id ? this.option.id : 0
- that.$util.confirmModal({content:'确认提交?'},() => {
- addItem({data:JSON.stringify(that.selectList),id:id}).then(res=>{
- if(res.code == 1){
- that.removeFromSaveDirect()
- uni.navigateBack()
- }
- })
- })
- },
- delProduct(item){
- let that = this
- that.$util.confirmModal({content:'确认删除?'},() => {
- that.delSelectedItem(item)
- })
- },
- tjItem(item){
- this.customData = item
- this.customData.userPrice = 0.1
- this.confirmAddItemModel(this.customData)
- item.bigCount=''
- this.$forceUpdate()
- },
- init(){
- },
- searchFn(){
- this.resetList()
- this.getSimpleData()
- },
- getSimpleData(){
- let that = this
- getSimleList({name:this.py,page: this.list.page}).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>
|