| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922 |
- <template>
- <view class="app-content">
- <view v-if="!$util.isEmpty(detailInfo)" class="info-content_box">
- <view class="title"> 供货商 </view>
- <view class="address-des_bx content-box">
- <view>
- <view> {{ detailInfo.supplierName }} {{ detailInfo.supplierMobile }} </view>
- <view class="">
- {{ detailInfo.supplierAddress}}
- </view>
- </view>
- <view>
- <i @click="callUp(detailInfo.supplierMobile)" class="iconfont icondianhua1" ></i>
- </view>
- </view>
- <view class="title">
- <text>单据信息</text>
- </view>
- <view class="bills-info_box content-box">
- <view class="order-info_box">
- <view>订单日期:</view>
- <view>{{ detailInfo.addTime?detailInfo.addTime.substr(2,14):'' }}</view>
- </view>
- <view class="order-info_box">
- <view>入库日期:</view>
- <view>
- <text v-if="detailInfo.status==4">{{ detailInfo.entryTime?detailInfo.entryTime.substr(2,14):'' }}</text>
- <text v-else>待入库</text>
- </view>
- <view class="price">
- <button @click="openPicker" class="admin-button-com default" >修改</button>
- </view>
- </view>
- <view class="order-info_box">
- <view>采购人员:</view>
- <view>{{ detailInfo.cgStaffName }}</view>
- </view>
- <view class="order-info_box">
- <view>录入人员:</view>
- <view>{{ detailInfo.adminName }}</view>
- </view>
- <view class="order-info_box">
- <view>订单编码:</view>
- <view>{{ detailInfo.orderSn }}</view>
- <view class="price">
- <button @click="copy(detailInfo.orderSn)" class="admin-button-com default" > 复制 </button>
- </view>
- </view>
- <view class="order-info_box">
- <view>核销编码:</view>
- <view>{{ detailInfo.checkCode }}</view>
- </view>
- <view class="order-info_box">
- <view>入库状态:</view>
- <view>{{ detailInfo.status==1?'待确认' :detailInfo.status==2?'待发货' :detailInfo.status==3?'待入库' :detailInfo.status==4?'已入库' :'已取消' }}</view>
- </view>
- <view v-if="detailInfo.refund == 2" class="order-info_box">
- <view style="color:red;font-weight:bold;">累计退款:</view>
- <view style="color:red;font-weight:bold;font-size:30upx;">¥{{detailInfo.tkPrice?parseFloat(detailInfo.tkPrice):0}}</view>
- <view class="price" v-if="detailInfo.refund==2">
- <text @click="pageTo({url: '/pagesPurchase/refundList',query: {orderSn: detailInfo.orderSn}})" style="font-weight:normal;color:#3385FF;">售后记录</text>
- </view>
- </view>
- </view>
- <view class="bills-info_box content-box" style="margin-top:18upx;">
- <view class="order-info_box" v-if="detailInfo.debt == 1">
- <view>订单状态:</view>
- <view style="color:red;font-weight:bold;">挂账</view>
- <view class="price">
- <text @click="goToClear(detailInfo)" style="font-weight:normal;color:#3385FF;">全部挂账</text>
- </view>
- </view>
- <view class="order-info_box" v-else>
- <view>订单状态:</view>
- <view v-if="detailInfo.clearId > 0">已结清</view>
- <view class="price" v-if="detailInfo.clearId > 0">
- <button @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})" class="admin-button-com">查看结账单</button>
- </view>
- <view v-if="detailInfo.clearId == 0"></view>
- </view>
- </view>
- <view class="title">
- 商品信息
- <block v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
- <text @click="goRefund(detailInfo)" v-if="detailInfo.status == 4"
- style="float:right;font-weight:normal;color:#3385FF;margin-right:30upx;">申请售后</text>
- <text @click="printAllLabelConfirm(detailInfo,1)" style="float:right;font-weight:normal;color:#3385FF;margin-right:30upx;">
- 打全部价码
- </text>
- <text @click="printAllLabelConfirm(detailInfo,0)" style="float:right;font-weight:normal;color:#3385FF;margin-right:30upx;">
- 打全部标签
- </text>
- </block>
- </view>
- <view style="text-align: right;" v-if="detailInfo.pfLevel && detailInfo.pfLevel == 1">
- <button @tap="assignOrder()" class="admin-button-com middle blue" style="">刷新货位</button>
- <button @tap="changeView()" class="admin-button-com middle blue" style="margin-left:50upx;">{{showSeat == 0 ?'显示货位':'隐藏货位'}}</button>
- </view>
- <view class="module-com content-box">
- <view class="commodity-view">
- <view class="commodity-list">
- <view v-for="(s, idx) in detailInfo.itemInfo" :key="idx">
- <view class="commodity-item">
- <image class="item-icon" :src="s.cover" alt="" />
- <view class="item-info">
- <view class="info-line">
- <text class="item-name" @click="pageTo({ url: '/admin/item/detail?id='+s.productId })">
- <text style="font-size:22upx;border:1upx solid #3385ff;color:white;background-color:#3385ff;margin-right:5upx;padding-left:5upx;padding-right:5upx;" v-if="s.presell == 1">预售</text>
- {{ s.name }}
- </text>
- <text class="item-price">
- <text class="price">¥{{s.totalPrice ? parseFloat(s.totalPrice) : 0}}</text>
- </text>
- </view>
- <view class="info-line" style="position:relative;">
- <block v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
- <text class="item-type" style="color:#3385FF;" @click.stop="printLabel(s,0)">打标签</text>
- <text class="item-type" style="color:#3385FF;" @click.stop="printLabel(s,1)">打价码</text>
- </block>
- <text class="item-count">
- {{ parseFloat(s.itemNum) }}扎 ×
- <text style="font-weight:bold;margin-left:5upx;" v-if="s.aboutPrice==1">约</text>
- <text v-else style="margin-left:5upx;"></text>
- ¥{{ s.bigPrice ? parseFloat(s.bigPrice) : 0 }}
- </text>
- <text style="font-weight:bold;color:red;position:absolute;top:45upx;font-size:20upx;">
- <text style="font-weight:bold;color:#CCCCCC;margin-right:20upx;">{{s.ratio}}{{s.smallUnit}}装</text>
- <text v-if="s.refundNum>0">已退{{s.refundNum}}</text>
- </text>
- </view>
- </view>
- </view>
- <block v-if="showSeat == 1">
- <view v-if="Number(s.noSeatNum)>0" style="margin-bottom:7upx;margin-top:8upx;font-size:30upx;">
- 无货位 {{ s.noSeatNum }}
- </view>
- <view v-if="!$util.isEmpty(s.sendList)" style="margin-bottom:10upx;font-size:30upx;">
- <view v-for="(send, sendIndex) in s.sendList" style="margin-bottom:7upx;">
- {{ send.customName }}({{ send.seatSn }}) 数量 {{ send.num }}
- <text style="margin-left:20upx;">{{ send.status == 0 ?'待上架':send.status == 1?'已上架':'已取消' }}</text>
- </view>
- </view>
- </block>
- </view>
- </view>
- <view class="summary-bar">
- <view class="operate-view" ></view>
- <view class="describe-view">
- 共<text>{{ detailInfo.itemNum ? parseFloat(detailInfo.itemNum) : 0 }}扎</text>,
- 合计 ¥<text class="price">{{ detailInfo.price ? parseFloat(detailInfo.price) : 0 }}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="content-box price-detail" v-if="detailInfo.location == 0">
- <div class="module-com input-line-wrap">
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">运费支付</div>
- <div class="detail-price_box" style="font-size: 28upx;">{{detailInfo.yfPayWay==1?'寄付':'到付'}}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">打包费</div>
- <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.packingCharge?parseFloat(detailInfo.packingCharge):0 }}</div>
- </tui-list-cell>
- <tui-list-cell v-if="detailInfo.yfPayWay==1" class="line-cell" :hover="false">
- <div class="tui-title">短途运费</div>
- <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.shortCharge?parseFloat(detailInfo.shortCharge):0 }}</div>
- </tui-list-cell>
- <tui-list-cell v-if="detailInfo.yfPayWay==1" class="line-cell" :hover="false">
- <div class="tui-title">长途运费</div>
- <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.longCharge?parseFloat(detailInfo.longCharge):0 }}</div>
- </tui-list-cell>
- </div>
- </view>
- <view class="content-box price-detail">
- <div class="module-com input-line-wrap">
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">总金额</div>
- <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.prePrice ? parseFloat(detailInfo.prePrice) : 0 }}</div>
- </tui-list-cell>
- <tui-list-cell v-if="detailInfo.refundPrice > 0" class="line-cell" :hover="false">
- <div class="tui-title">退款金额</div>
- <div class="detail-price_box red" style="font-size:30upx">-¥{{ detailInfo.tkPrice ? parseFloat(detailInfo.tkPrice) : 0 }}</div>
- </tui-list-cell>
- <tui-list-cell v-if="detailInfo.discountAmount > 0" class="line-cell" :hover="false">
- <div class="tui-title">减免</div>
- <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.discountAmount ? parseFloat(detailInfo.discountAmount) : 0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">实际金额</div>
- <div class="detail-price_box" style="font-size:32upx;color:#3385FF;">¥{{ detailInfo.realPrice ? parseFloat(detailInfo.realPrice) : 0 }}</div>
- </tui-list-cell>
- </div>
- </view>
- <view class="content-box price-detail" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
- <div class="module-com input-line-wrap">
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">备注</div>
- <textarea style="height: 130upx;width:350upx;" v-model="detailInfo.remark" placeholder="这里写备注"/>
- <button class="admin-button-com blue mini-btn" @click="modifyRemark(item)" >修改</button>
- </tui-list-cell>
- </div>
- </view>
- <view class="content-box price-detail" v-if="detailInfo.location == 0">
- <div class="module-com input-line-wrap">
- <tui-list-cell v-if="detailInfo.yfPayWay==2" class="line-cell" :hover="false">
- <div class="tui-title">短途运费</div>
- <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.shortCharge?parseFloat(detailInfo.shortCharge):0 }}</div>
- </tui-list-cell>
- <tui-list-cell v-if="detailInfo.yfPayWay==2" class="line-cell" :hover="false">
- <div class="tui-title">长途运费</div>
- <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.longCharge?parseFloat(detailInfo.longCharge):0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">提货费</div>
- <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.pickCharge?parseFloat(detailInfo.pickCharge):0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">本地运费</div>
- <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.localCharge?parseFloat(detailInfo.localCharge):0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">合计费用</div>
- <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.totalFreight?parseFloat(detailInfo.totalFreight):0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">合计成本</div>
- <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.totalCgCost?parseFloat(detailInfo.totalCgCost):0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">总重量</div>
- <div class="detail-price_box" style="font-size: 30upx;">{{ detailInfo.totalWeight?parseFloat(detailInfo.totalWeight):0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">每公斤运费</div>
- <div class="detail-price_box" style="font-size: 30upx;">¥{{ detailInfo.avgKgWeight?parseFloat(detailInfo.avgKgWeight):0 }}</div>
- </tui-list-cell>
- <tui-list-cell class="line-cell" :hover="false">
- <div class="tui-title">物流费用</div>
- <div class="detail-price_box" style="font-size: 30upx;">{{detailInfo.isCost==0?'不算成本':'算成本'}}</div>
- </tui-list-cell>
- </div>
- </view>
- </view>
- <block v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentGhsShopId > 0">
- <view class="app-footer open_btn" v-if="detailInfo.location == 0">
- <!-- #ifdef MP-WEIXIN -->
- <button class="admin-button-com middle blue" open-type="share">分享</button>
- <!-- #endif -->
- <!-- #ifdef APP-PLUS -->
- <view @click="shareOrder()" class="admin-button-com middle blue">分享</view>
- <!-- #endif -->
- <view v-if="detailInfo.status != 3" @click="changePrice()" class="admin-button-com middle blue">修改价格</view>
- <view v-if="detailInfo.status == 2 || detailInfo.status == 3 || detailInfo.status == 4" @click="printBillFn(detailInfo)" class="admin-button-com middle blue">打印({{detailInfo.printNum}})</view>
- <view v-if="detailInfo.status == 3" @click="cancelIn()" class="admin-button-com middle blue">取消入库</view>
- <view v-if="detailInfo.status == 3" @click="changePrice()" class="admin-button-com middle blue">入库和改价</view>
- </view>
- <view class="app-footer open_btn" v-else>
- <!-- #ifdef MP-WEIXIN -->
- <button class="admin-button-com middle blue" open-type="share">分享</button>
- <!-- #endif -->
- <!-- #ifdef APP-PLUS -->
- <view @click="shareOrder()" class="admin-button-com middle blue">分享</view>
- <!-- #endif -->
- <view v-if="detailInfo.status != 3" @click="changePrice()" class="admin-button-com middle blue">修改价格</view>
- <view v-if="detailInfo.status == 2 || detailInfo.status == 3 || detailInfo.status == 4" @click="printBillFn(detailInfo)" class="admin-button-com middle blue">打印({{detailInfo.printNum}})</view>
- <view v-if="detailInfo.status == 3" @click="cancelIn()" class="admin-button-com middle blue">取消入库</view>
- <view v-if="detailInfo.status == 3" @click="changePrice()" class="admin-button-com middle blue">入库和改价</view>
- </view>
- </block>
- <modal-module :show="printLabelShow" @click="dialogInputConfirm" :maskClosable="true" :title="printType==0?'标签数量':'价码数量'" 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;" v-model="printNum" :adjust-position="false" class="inp-input" @focus="printNum=''" />
- </div>
- </div>
- <div class="inp-list-line" v-if="printType==0">
- <div class="line-input" style="justify-content: center;margin-top: 30upx;">
- <button class="admin-button-com big" :class="priceOption === 0 ? 'blue' : 'default'" @click="priceOption = 0" style="margin-right:20upx;">没价格</button>
- <button class="admin-button-com big" :class="priceOption === 1 ? 'blue' : 'default'" @click="priceOption = 1" style="margin-right:20upx;">有价格</button>
- <button class="admin-button-com big" :class="priceOption === 2 ? 'blue' : 'default'" @click="priceOption = 2">纯名字</button>
- </div>
- </div>
- </div>
- </template>
- </modal-module>
- <modal-module :show="printAllLabelShow" @click="printAllLabelConfirmFn" :maskClosable="true" title="提示" padding="30rpx 30rpx" >
- <template v-slot:content>
- <div class="app-modal-input-wrap">
- <div class="inp-list-line" style="justify-content: center;margin-top: 30upx;">
- <text style="text-align:center;color:black;font-size:38upx;">确认打全部{{printAllLabelType==0?'标签':'价码'}}?</text>
- </div>
- <div class="inp-list-line" v-if="printAllLabelType==0">
- <div class="line-input" style="justify-content: center;margin-top: 30upx;">
- <button class="admin-button-com big" :class="printAllPriceOption === 0 ? 'blue' : 'default'" @click="printAllPriceOption = 0" style="margin-right:20upx;">没价格</button>
- <button class="admin-button-com big" :class="printAllPriceOption === 1 ? 'blue' : 'default'" @click="printAllPriceOption = 1" style="margin-right:20upx;">有价格</button>
- <button class="admin-button-com big" :class="printAllPriceOption === 2 ? 'blue' : 'default'" @click="printAllPriceOption = 2">纯名字</button>
- </div>
- </div>
- </div>
- </template>
- </modal-module>
- <mx-date-picker :show="showPicker" format="yyyy-mm-dd" type="date" :value="defaultPickerDate" :show-tips="true" @confirm="confirmPicker" @cancel="showPicker = false" />
- </view>
- </template>
- <script>
- import { getPurchaseDetailApi,getCgDetail,updateRemark,printAll,confirmPutIn,cancelPutIn,printBill,assignSeat,checkSeatRemin,modifyEntryTime } from "@/api/purchase";
- import productMins from "@/mixins/product";
- import TuiListCell from "@/components/plugin/list-cell";
- import ModalModule from "@/components/plugin/modal"
- import { print } from '@/api/product';
- import { getPrint } from "@/api/shop";
- import { mapGetters } from "vuex";
- import { IMGHOST,CURRENT_ENV } from '@/config'
- import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
- export default {
- name: "info",
- components: {
- TuiListCell,
- ModalModule,
- MxDatePicker
- },
- computed: {
- ...mapGetters(["getLoginInfo"]),
- ...mapGetters({ dictInfo:"getDictionariesInfo" }),
- },
- mixins: [productMins],
- data() {
- return {
- defaultPickerDate:'',
- showPicker: false,
- selectJobType: "order_change",
- autoLoad: false,
- stepActive: 0,
- form: {
- name: ""
- },
- detailInfo: {},
- loading: false,
- printItemId:0,
- printType:0,
- printLabelShow:false,
- printNum:'',
- wcPrintNum:1,
- entryTime:'',
- T:null,
- orderSn:'',
- salt:'',
- showSeat:1,
- title:'',
- imageUrl:'',
- currentEnv:'production',
- priceOption:0,
- printAllLabelShow:false,
- printAllLabelType:0,
- printAllPriceOption:0
- };
- },
- onPullDownRefresh() {
- this.initCgData().then(res => {
- uni.stopPullDownRefresh()
- })
- },
- onLoad() {
- this.initCgData()
- let pages = getCurrentPages();
- let prevPage = pages[ pages.length - 2 ];
- if(this.option.refresh && this.option.refresh == 1){
- //采购入库之后去的详情页返回列表需要刷新
- prevPage.$vm.needRefresh = 1
- }else{
- //返回上一页时不需要刷新
- prevPage.$vm.needRefresh = 0
- }
- this.imageUrl = IMGHOST+'/custom/cg_share.jpg'
- //当前环境
- this.currentEnv = CURRENT_ENV
- },
- onUnload(){
- clearInterval(this.T)
- },
- onShareAppMessage(res) {
- console.log("pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt)
- return {
- title: this.title,
- desc: "",
- imageUrl: this.imageUrl,
- path: "pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt,
- }
- },
- methods: {
- openPicker(){
- this.showPicker = true
- },
- confirmPicker(e) {
- let that = this
- let currentDate = e.value
- that.$util.confirmModal({content:'确认修改?'},() => {
- that.showPicker = false
- modifyEntryTime({id:that.detailInfo.id,date:currentDate}).then(res=>{
- if(res.code == 1){
- that.$msg(res.msg)
- that.initCgData()
- }
- })
- })
- },
- changeView(){
- if(this.showSeat == 0){
- if(this.detailInfo.status == 4){
- this.initCgData()
- this.showSeat = 1
- }else if(this.detailInfo.status == 5){
- this.$msg('订单已取消')
- }else{
- this.assignOrder()
- }
- }else{
- this.showSeat = 0
- }
- },
- assignOrder(){
- uni.showLoading()
- assignSeat({id:this.detailInfo.id,salt:this.salt}).then(res=>{
- uni.hideLoading()
- if(res.code == 1){
- if(res.data && res.data.assign == 1){
- this.$msg(res.msg)
- this.initCgData()
- this.showSeat = 1
- }
- }
- })
- },
- printBillFn(info){
- let that = this
- if(this.wcPrintNum > 1){
- let arr = ['请选择','机器1']
- if(this.wcPrintNum == 2){
- arr = ['请选择','机器1','机器2']
- }
- if(this.wcPrintNum == 3){
- arr = ['请选择','机器1','机器2','机器3']
- }
- uni.showActionSheet({
- itemList: arr,
- success: function (res) {
- if(res.tapIndex == 0){
- return false
- }
- let order = res.tapIndex
- printBill({id:info.id,order:order}).then((res) => {
- info.printNum++
- that.$msg('打印成功')
- })
- }
- })
- }else{
- printBill({id:info.id}).then((res) => {
- info.printNum++
- that.$msg('打印成功')
- })
- }
- },
- dialogInputConfirm(val) {
- let that=this;
- if (val.index == 0) {
- that.printLabelShow = false
- return
- }
- let currentNum = this.printNum
- let itemId = this.printItemId
- if (currentNum == null) {
- that.$msg('请填写数量')
- return
- }
- if (currentNum <= 0) {
- that.$msg('数量不能小于1')
- return
- }
- if (itemId == 0) {
- that.$msg('打印的花材id出错')
- that.printLabelShow = false
- return
- }
- print({id:itemId,num:currentNum,type:this.printType,priceOption:this.priceOption}).then(res=>{
- if(res.code == 1){
- that.printLabelShow = false
- uni.showToast({ title: '操作成功', duration: 1500 })
- } else if(res.code == 0){
- that.printLabelShow = false
- that.$msg(res.msg)
- }
- })
- },
- printLabel(item,type){
- this.printType = type
- this.printItemId = item.productId
- this.printLabelShow = true
- this.priceOption = 0
- this.printNum = item.itemNum
- },
- shareOrder(){
- console.log("pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt)
- let that = this
- let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
- uni.share({
- provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo)
- scene: 'WXSceneSession', //场景,可取值参考下面说明。
- type: 5, //分享形式
- title: that.title, //分享内容的标题
- summary: '暂无', //分享内容的摘要
- imageUrl: this.imageUrl,
- miniProgram: {
- id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台账号
- path: "pagesPurchase/info?orderSn="+this.detailInfo.orderSn+'&salt='+this.detailInfo.salt,
- type: 0,// 0-正式版; 1-测试版; 2-体验版
- webUrl: 'https://www.wixhb.com'
- },
- success: function(res) {
- //console.log(res)
- },
- fail: function(err) {
- //console.log(err)
- }
- })
- },
- changePrice(){
- this.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+this.detailInfo.orderSn+"&id="+this.detailInfo.id+"&status="+this.detailInfo.status,type:2})
- },
- cancelIn(){
- let that = this
- that.$util.confirmModal({content:'确认取消入库?'},() => {
- uni.showLoading({mask:true})
- cancelPutIn({id:that.detailInfo.id}).then(res=>{
- uni.hideLoading()
- if(res.code == 1){
- that.initCgData()
- }
- })
- })
- },
- confirmIn(){
- let that = this
- that.$util.confirmModal({content:'确认现在入库?'},() => {
- uni.showLoading({mask:true})
- confirmPutIn({id:that.detailInfo.id}).then(res=>{
- uni.hideLoading()
- if(res.code == 1){
- if(res.data.status == 4){
- that.$util.pageTo({url: "/pagesPurchase/components/pageSuccess?orderSn="+res.data.orderSn+"&id="+res.data.id+"&status="+res.data.status,type:2})
- }
- }
- })
- })
- },
- goRefund(info){
- this.$util.pageTo({url:'/pagesPurchase/refund?orderSn='+info.orderSn})
- },
- printAllLabel(item,type){
- let that = this
- that.$util.confirmModal({content:'确认打印'},() => {
- printAll({orderSn:item.orderSn,type:type,priceOption:that.printAllPriceOption}).then(res=>{
- if(res.code == 1){
- that.$msg(res.msg)
- }
- })
- })
- },
- printAllLabelConfirm(item,type){
- this.printAllLabelShow = true
- this.printAllLabelType = type
- this.printAllPriceOption = 0
- },
- printAllLabelConfirmFn(val){
- let that = this
- if (val.index == 0) {
- that.printAllLabelShow = false
- return
- }
- printAll({orderSn:that.detailInfo.orderSn,type:that.printAllLabelType,priceOption:that.printAllPriceOption}).then(res=>{
- if(res.code == 1){
- that.$msg(res.msg)
- that.printAllLabelShow = false
- }
- })
- },
- goToClear (item) {
- this.pageTo({
- url: '/pagesGys/details?id='+item.ghsId
- })
- },
- modifyRemark(){
- const self = this;
- let remark = this.detailInfo.remark
- updateRemark({id:this.detailInfo.id,remark:remark}).then((res) => {
- self.$msg(res.msg);
- })
- },
- copy(val) {
- const self = this;
- uni.setClipboardData({
- data: val,
- success: function() {
- self.$msg("复制成功");
- }
- });
- },
- callUp(mobile) {
- uni.makePhoneCall({
- phoneNumber: mobile
- });
- },
- init(){
- },
- checkRemind(){
- let that = this
- if(this.T){
- clearInterval(this.T)
- }
- this.T = setInterval(function(){
- checkSeatRemin({orderSn:that.orderSn,salt:that.salt}).then(res=>{
- if(res.code == 1){
- if(res.data.need && res.data.need == 1){
- clearInterval(that.T)
- that.$util.confirmModal({content:'货位有变,请刷新',singer:true},() => {
- that.assignOrder()
- },()=>{
- that.checkRemind()
- })
- }
- }
- })
- },5000)
- },
- async initCgData() {
- let that = this
- clearInterval(that.T)
- if(that.option.orderSn){
- that.orderSn = that.option.orderSn
- that.salt = that.option.salt
- if((this.getLoginInfo && !this.$util.isEmpty(this.getLoginInfo.admin)) && this.$util.isEmpty(that.salt)){
- const { data } = await getPurchaseDetailApi(that.option.orderSn);
- that.detailInfo = data;
- if(that.detailInfo && that.detailInfo.needRemindRefreshSeat == 1){
- that.checkRemind()
- }else{
- clearInterval(that.T)
- }
- getPrint().then(res=>{
- if(res.code == 1){
- that.wcPrintNum = res.data.wcPrintNum ? Number(res.data.wcPrintNum) : 1
- }
- })
- if(that.detailInfo.pfLevel == 0){
- this.showSeat = 0
- }
- }else{
- const { data } = await getCgDetail({orderSn:that.orderSn,salt:that.salt})
- that.detailInfo = data
- if(that.detailInfo && that.detailInfo.needRemindRefreshSeat == 1){
- that.checkRemind()
- }else{
- clearInterval(that.T)
- }
- }
- }else{
- if(that.option.q){
- let currentUrl = decodeURIComponent(that.option.q)
- let str = currentUrl.substring(currentUrl.lastIndexOf("?") + 1)
- var sceneItem = str.split("&");
- var arr, name, value;
- var sceneArray = new Array();
- for (var i = 0, l = sceneItem.length; i < l; i++) {
- arr = sceneItem[i].split("=");
- name = arr[0];
- value = arr[1];
- sceneArray[name] = value;
- }
- if(sceneArray.orderSn && sceneArray.salt){
- that.orderSn = sceneArray.orderSn
- that.salt = sceneArray.salt
- const { data } = await getCgDetail({orderSn:sceneArray.orderSn,salt:sceneArray.salt})
- that.detailInfo = data
- if(that.detailInfo && that.detailInfo.needRemindRefreshSeat == 1){
- that.checkRemind()
- }else{
- clearInterval(that.T)
- }
- }
- }
- }
- //如果在预订中分享的图片是不一样的
- if(that.detailInfo && that.detailInfo.onBooking == 1){
- this.imageUrl = IMGHOST+'/custom/cg_share_seat_sn.jpg'
- }
- let ghsName = this.detailInfo.ghsName ? this.detailInfo.ghsName : ''
- let actPrice = this.detailInfo.actPrice ? parseFloat(this.detailInfo.actPrice) : 0
- this.title = ghsName+' '+this.detailInfo.entryTime.substr(5,11)+' ¥'+actPrice
- if(this.detailInfo.tkPrice && Number(this.detailInfo.tkPrice)>0){
- this.title = this.title+' 已退¥'+parseFloat(this.detailInfo.tkPrice)
- }
- this.title = this.title+' 核销码'+this.detailInfo.checkCode
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .info-content_box {
- padding: 0 20upx 100upx;
- & > .title {
- color: #666666;
- font-size: 28upx;
- font-weight: 600;
- padding: 30upx 3upx;
- }
- & .address-des_bx {
- display: flex;
- padding: 20upx 10upx 20upx 20upx;
- & > view:nth-child(1) {
- flex: 1;
- margin-top: 10upx;
- & > view:nth-child(1) {
- color: #333333;
- font-size: 32upx;
- font-weight: bold;
- }
- & > view:nth-child(2) {
- color: #666666;
- font-size: 28upx;
- font-weight: 400;
- margin-top: 20upx;
- }
- }
- & > view:nth-child(2) {
- display: flex;
- & .icondianhua1 {
- font-size: 50upx;
- color: #3385ff;
- margin-left: 0upx;
- margin-right:30upx;
- }
- }
- }
- .bills-info_box {
- padding: 30upx 20upx 30upx;
- // border-bottom: 1upx solid #EEEEEE;
- & > .order-info_box {
- display: flex;
- align-items: center;
- font-size: 26upx;
- font-weight: 400;
- margin-bottom: 5upx;
- & > view:nth-child(1) {
- color: #999999;
- width: 135upx;
- text-align: right;
- }
- & > view:nth-child(2) {
- color: #333333;
- }
- & > .price {
- flex: 1;
- font-size: 30upx;
- color: #333333;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- & .iconxiangyou {
- color: #999999;
- font-size: 25upx;
- margin-left: 12upx;
- }
- }
- }
- }
- .content-box {
- background-color: #ffffff;
- border-radius: 10upx;
- }
- .commodity-view {
- display: flex;
- flex-direction: column;
- .commodity-list {
- padding: 20upx;
- .commodity-item {
- display: flex;
- margin-bottom:10upx;
- .item-icon {
- flex-shrink: 0;
- width: 140upx;
- height: 140upx;
- }
- .item-info {
- display: flex;
- flex-direction: column;
- justify-content: center;
- flex: 1;
- margin-left: 20upx;
- .info-line {
- margin-bottom: 20upx;
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
- .item-name {
- color: #333333;
- font-size:32upx;
- font-weight: bold;
- }
- .item-price {
- color: #333;
- font-size: 22upx;
- .price {
- font-size: 30upx;
- font-weight: bold;
- }
- }
- .item-type {
- color: #999;
- font-size: 24upx;
- }
- .item-count {
- color: #333333;
- font-size: 28upx;
- }
- }
- }
- }
- }
- .summary-bar {
- padding: 0 20upx;
- height: 90upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-top: 1upx solid #eeeeee;
- .operate-view {
- display: flex;
- align-items: center;
- color: #3385ff;
- font-size: 26upx;
- .iconfont {
- margin-right: 20upx;
- font-size: 40upx;
- }
- }
- .describe-view {
- display: flex;
- align-items: center;
- color: #333;
- font-size: 26upx;
- .price {
- font-weight: bold;
- }
- }
- }
- }
- .shipping-address {
- display: flex;
- align-items: center;
- margin-top: 20upx;
- & > view:nth-child(1) {
- color: #999999;
- font-size: 28upx;
- font-weight: 400;
- display: inline-block;
- padding: 30upx 0 30upx 20upx;
- flex: 1;
- & > text {
- color: #333333;
- font-weight: 600;
- }
- }
- & > view:nth-child(2) {
- font-size: 60upx;
- color: #d6e7ff;
- margin-right: 10upx;
- }
- }
- .price-detail {
- margin-top: 20upx;
- margin-bottom: 20upx;
- }
- .detail-price_box {
- color: #333333;
- font-size: 22upx;
- text-align: right;
- flex: 1;
- font-weight: 600;
- &.red {
- color: #ff2842;
- }
- }
- }
- </style>
|