| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- <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">
- <t-table :headerBackgroundColor="'#F0F2F6'">
- <t-tr header>
- <t-th><view style="width:230upx;text-align:left;">名称</view></t-th>
- <t-th> </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>
- <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})">
- {{productItem.name}}
- </view>
- </t-td>
- <t-td>
- <view style="color:#333333;font-size:29upx;" @click.stop="doPrintLabel(productItem,1)">打价码</view>
- </t-td>
- <t-td>
- <view style="color:#333333;font-size:29upx;" @click.stop="doPrintLabel(productItem,0)">打标签</view>
- </t-td>
- <t-td>
- <view style="color:#333333;font-size:29upx;" @click="goToStockDetail(productItem)">
- 库明细
- </view>
- </t-td>
- <t-td>
- <view style="color:#333333;font-size:29upx;" @click="moreAction(productItem)">
- 更多
- </view>
- </t-td>
- </t-tr>
- </block>
- </block>
- </t-table>
- </view>
- </scroll-view>
- </view>
- <uni-popup ref="rightShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
- <view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
- <view style="width:100vw;"><button @click="costChange()">成本变动记录</button></view>
- <view style="width:100vw;margin-top:8upx;"><button @click="priceChange()">价格变动记录</button></view>
- <view style="width:100vw;margin-top:8upx;"><button @click="varietyManage()">多颜色</button></view>
- <view style="width:100vw;margin-top:8upx;"><button @click="preSell()">预售</button></view>
- <view style="width:100vw;margin-top:8upx;"><button @click="orderRecord()">下单记录</button></view>
- <view style="width:100vw;margin-top:8upx;"><button @click="copyCreate()">复制新建</button></view>
- <view style="width:100vw;margin-top:8upx;"><button @click="sendStock()">分配库存</button></view>
- <view style="width:100vw;margin-top:8upx;"><button @click="delItem()">删除</button></view>
- <view style="width:100vw;margin-top:30upx;"><button @click="closeRightShow()">取消</button></view>
- </view>
- </uni-popup>
- <modal-module :show="printLabelShow" @click="dialogInputConfirm" :maskClosable="true" title="数量" padding="30rpx 30rpx" >
- <template v-slot:content>
- <div class="app-modal-input-wrap">
- <div class="inp-list-line">
- <div class="line-input">
- <input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="blur" :focus="printFocus" v-model="printNum" :adjust-position="false" class="inp-input" />
- </div>
- </div>
- </div>
- </template>
- </modal-module>
- </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";
- export default {
- components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,AppSearchModule,ModalModule},
- mixins: [list],
- computed: {
- ...mapGetters(["getDictionariesInfo","getLoginInfo","getMyShopInfo"])
- },
- data() {
- return {
- py:'',
- currentInfo:{},
- printLabelShow:false,
- getAppIdList:{},
- printItemId:0,
- printType:0,
- printNum:'',
- printFocus:false,
- warning:0,
- posterUrl:'',
- breakNum:'',
- breakFocus:false,
- breakShow:false
- };
- },
- onLoad() {
- this.getSimpleData()
- let that = this
- getWeixinId().then(res => {
- that.getAppIdList = res.data
- })
- },
- onPullDownRefresh() {
- this.resetList();
- this.getSimpleData()
- uni.stopPullDownRefresh()
- },
- onReachBottom() {
- if (!this.list.finished) {
- this.getSimpleData().then((res) => {
- uni.stopPullDownRefresh()
- })
- } else {
- uni.stopPullDownRefresh()
- }
- },
- methods: {
- goToStockDetail(item){
- this.$util.pageTo({url: "/pagesStorehouse/stockWarn/detailed?id="+item.id+'&name='+item.name})
- },
- moreAction(item){
- this.currentInfo = item
- this.$refs.rightShowMore.open('top')
- },
- delItem(){
- let that = this
- that.$util.confirmModal({content:'确认删除?'},() => {
- delStatusUpdate({id:that.currentInfo.id,delStatus:1}).then(res=>{
- if(res.code == 1){
- that.closeRightShow()
- that.$msg('删除成功')
- }
- })
- })
- },
- sendStock(){
- this.pageTo({url: '/admin/item/sendStock?id='+this.currentInfo.id+'&price='+this.currentInfo.price+'&stock='+this.currentInfo.stock+'&name='+this.currentInfo.name})
- },
- downloadImg(){
- let that = this
- uni.downloadFile({
- url: this.posterUrl,
- success: (res) => {
- if (res.statusCode === 200) {
- uni.saveImageToPhotosAlbum({
- filePath: res.tempFilePath,
- success: function (data) {
- that.$refs.posterShow.close()
- uni.showToast({title:'保存成功'})
- }
- });
- }
- }
- });
- },
- changeClass(index){
- this.$refs.selectFlowerNumRef.close()
- this.swichClass(index)
- },
- selectFlowerNumFn(){
- this.$refs.selectFlowerNumRef.open('top')
- },
- blur() {
- this.printFocus = false
- },
- doPrintLabel(item,type){
- this.printItemId = item.id
- this.printType = type
- this.printLabelShow = true
- this.printNum = null
- setTimeout(x => {
- this.$nextTick(() => this.setFocus())
- }, 200)
- },
- setFocus() {
- this.printFocus = true
- },
- dialogInputConfirm(val) {
- let that = this
- if (val.index == 0) {
- that.printLabelShow = false
- that.printFocus = false
- return
- }
- let currentNum = this.printNum
- let itemId = this.printItemId
- if (currentNum == null) {
- that.$msg('请填写数量')
- that.printFocus = true
- return
- }
- if (currentNum <= 0) {
- that.$msg('数量不能小于1')
- that.printFocus = true
- return
- }
- if (itemId == 0) {
- that.$msg('打印的花材id出错')
- that.printLabelShow = false
- that.printFocus = false
- return
- }
- print({id:itemId,num:currentNum,type:this.printType}).then(res=>{
- if(res.code == 1){
- that.printLabelShow = false
- that.printFocus = false
- uni.showToast({ title: '操作成功', duration: 1500 })
- } else if(res.code == 0){
- that.printLabelShow = false
- that.printFocus = false
- that.$msg(res.msg)
- }
- })
- },
- closeRightShow(){
- this.$refs.rightShowMore.close()
- },
- costChange(){
- this.closeRightShow()
- this.pageTo({url: '/admin/changePrice/costChangeList?id='+this.currentInfo.id})
- },
- priceChange(){
- this.closeRightShow()
- this.pageTo({url: '/admin/changePrice/changeList?id='+this.currentInfo.id})
- },
- varietyManage(){
- this.closeRightShow()
- this.pageTo({url: "/admin/item/xjSelect?itemId="+this.currentInfo.id})
- },
- copyCreate(){
- this.closeRightShow()
- this.pageTo({url: '/admin/item/copy?id='+this.currentInfo.id})
- },
- orderRecord(){
- this.closeRightShow()
- this.pageTo({url: "/admin/order/itemOrder?productId="+this.currentInfo.id})
- },
- preSell(){
- this.closeRightShow()
- this.pageTo({url: "/admin/item/presell?id="+this.currentInfo.id})
- },
- init(){
- },
- closeRightShow(){
- this.$refs.rightShowMore.close()
- },
- 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;
- padding-top:20upx;
- 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:20upx;
- 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>
|