| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('component/order-address', __DIR__);
- ComponentHelper::loadComponentView('component/order-shipping', __DIR__);
- ComponentHelper::loadComponentView('com-export-dialog');
- ?>
- <style>
- .vue-line-clamp p {
- line-height: 22px;
- }
- .demo-form-inline .el-select .el-input {
- width: 100px;
- }
- /* 订单表格 start */
- .width-pre10 {
- width: 10%;
- }
- .width-50 {
- width: 50px;
- }
- .width-400 {
- width: 350px;
- }
- .order-table {
- overflow-x: scroll;
- }
- .tab-title,
- .tab-cont {
- width: 100%;
- min-width: 1290px;
- font-size: 13px;
- }
- .tab-title {
- padding: 20px 0;
- }
- .tab-title>li {
- padding: 0 10px;
- }
- .tab-cont {
- border: 1px solid #F2F2F2;
- margin-bottom: 20px;
- }
- .tab-cont-row {
- padding: 10px 0;
- background-color: #F7F7F7;
- }
- .tab-cont-info {
- height: 100px;
- }
- .tab-cont-info>li {
- /* display: flex;
- flex-direction: column;
- justify-content: center; */
- height: 100%;
- padding: 16px 10px;
- }
- .tab-btns {
- width: 320px;
- margin-right: 20px;
- }
- .tab-goods-name {
- margin: 0 10px;
- }
- .border-right {
- border-right: 1px solid #f2f2f2;
- }
- .border-bottom {
- border-bottom: 1px solid #f2f2f2;
- }
- .no-border-bottom {
- border-bottom: none !important;
- }
- .cursor {
- cursor: pointer;
- }
- .edit-icon {
- color: #03c5ff;
- cursor: pointer;
- }
- .popover-btn {
- font-size: 12px;
- padding: 0 10px;
- border-right: 1px solid var(--primary, #03c5ff);
- cursor: pointer;
- display: inline-block;
- line-height: 1;
- color: #03c5ff;
- }
- .popover-btn:last-child {
- border-right: none;
- }
- .width-s {
- width: 250px;
- }
- .el-button--text {
- padding: 0 !important;
- }
- .com-order-refund-status {
- position: absolute;
- bottom: 18px;
- left: 0px;
- height: 20px;
- width: 50px;
- background-color: #FF7171;
- color: #fff;
- text-align: center;
- border-radius: 0 0 5px 5px;
- font-size: 12px;
- }
- .fenRunData .el-dialog__body{
- padding: 0px 10px 0 10px;
- }
- .change_price p{
- padding: 5px;
- font-size: 15px;
- width: 200px;
- }
- .change_price{
- width: 200px;
- margin: 0px 0 0px 81%;
- }
- .change_price label{
- float:left;
- width: 100px;
- text-align: right;
- padding-right: 20px;
- }
- .change_formula{
- float: left;
- width: 300px;
- color: #6c6969;
- font-size: 12px;
- }
- /* 订单表格 end */
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" v-loading="listLoading">
- <div slot="header">
- <span>订单列表</span>
- <div style="float: right; margin: -5px 0">
- <com-export-dialog
- style="float: right;margin-top: -5px"
- :field_list='export_list'
- :action_url="export_url"
- :params="search_data">
- </com-export-dialog>
- </div>
- </div>
- <div class="table-body">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane v-for="item in tabs" :key="item.value" :label="item.name" :name="item.value">
- <el-form :inline="true" :model="search_data" size="small" class="demo-form-inline">
- <el-form-item label="下单时间">
- <el-date-picker style="margin-top: 1px;" @change="changeTime" v-model="datetime" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
- </el-form-item>
- <el-form-item label="">
- <el-input placeholder="请输入订单号" v-model="search_data.order_no"></el-input>
- </el-form-item>
- <el-form-item label="">
- <el-input placeholder="请输入内容" v-model="search_data.type_value" class="input-with-select">
- <el-select v-model="search_data.type" slot="prepend" placeholder="请选择">
- <el-option label="用户ID" value="user_id"></el-option>
- <el-option label="手机号码" value="mobile"></el-option>
- </el-select>
- </el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="search">搜索</el-button>
- <el-button type="danger" @click="clearSearch" v-if="show_clear_search_btn">清除条件</el-button>
- </el-form-item>
- </el-form>
- <!-- 订单表格 start -->
- <div class="order-table">
- <ul class="tab-title" flex="dir:left cross:center">
- <li class="width-50" flex="main:center">
- <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="allSelOrder"></el-checkbox>
- </li>
- <li class="width-400">商品信息</li>
- <li class="width-pre10">价格/数量</li>
- <li class="width-pre10">实付款</li>
- <li class="width-s">收货人信息</li>
- <li class="width-s">配送方式</li>
- <li class="width-pre10">状态</li>
- <li class="">操作</li>
- </ul>
- <div class="tab-cont" v-for="(item, index) in list" :key="index">
- <div class="tab-cont-row" flex="main:justify cross:center">
- <div flex="dir:left cross:center">
- <div class="width-50" flex="main:center">
- <el-checkbox-group v-model="checkedOrder" @change="orderChange">
- <el-checkbox :label="item.id">{{''}}</el-checkbox>
- </el-checkbox-group>
- </div>
- <div style="padding-right: 20px;">订单({{ item.id }})编号:{{ item.order_no || '-' }}</div>
- <div v-if="item.base_user" style="padding-right: 20px;">用户({{item.base_user.id}}):{{ item.base_user.nickname || item.base_user.username }}</div>
- <div style="padding-right: 20px;">下单时间:{{ item.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
- <el-tag size="small" v-if="marketing_type_map[item.marketing_type]">{{marketing_type_map[item.marketing_type]}}</el-tag>
- <el-tag size="small" style="margin-left: 20px;" v-if="item.is_print == 1">已打印</el-tag>
- <el-tag size="small" type="danger" style="margin-left: 20px;" v-else>未打印</el-tag>
- </div>
- </div>
- <ul class="tab-cont-info" flex="dir:left cross:center" v-for="(it, i) in item.detail" v-if="true">
- <li class="width-50" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'"></li>
- <li class="tab-shop-info width-400" flex="dir:left" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'">
- <div style="position: relative;">
- <el-image style="width: 50px; height: 50px; border-radius: 5px;" :src="it.pic_url"></el-image>
- <span v-if="repeal_list[it.is_feedback]" class="com-order-refund-status">{{ repeal_list[it.is_feedback] }}</span>
- </div>
- <div class="tab-goods-name">
- <com-ellipsis :line="1" :text="it.goods_name+''"></com-ellipsis>
- <template >
- <el-tag style="margin-right: 2px;margin-top: 5px;" size="small">
- {{ it.goods_attr_name || '无规格' }}
- </el-tag>
- </template>
- </div>
- </li>
- <li class="width-pre10 border-right" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'">
- <div class="cursor" flex="cross:center" @mouseover="mouseOver(index, i)" @mouseleave="mouseLeave">
- <p style="padding-right: 10px;">
- {{ getOrderPrice(it) }}
- <span v-if="it.adjust_money != 0">(调价:¥{{ it.adjust_money }})</span>
- </p>
- </div>
- <p>{{ it.num }}件</p>
- </li>
- <li class="width-pre10 border-right">
- <div v-show="i == 0">
- <p>{{ item.pay_money }}</p>
- <p v-if="item.shipping_type==1">(含快递费¥{{ item.shipping_money }})</p>
- <p v-if="item.shipping_type==3">(含配送费¥{{ item.shipping_money }})</p>
- <p>
- <el-tag size="small" type="warning">{{payment_type_list[item.payment_type]}}</el-tag>
- </p>
- </div>
- </li>
- <li class="width-s border-right">
- <div v-show="i == 0">
- <p>{{ item.receiver_name | emptyFilled }}</p>
- <p>{{ item.mobile |emptyFilled}} </p>
- <p style="display: flex;align-items: center;">
- <com-ellipsis v-if="(item.region_name + item.address).trim() != 'null'" :line="1" :text="item.region_name + item.address + ''"></com-ellipsis>
- <span v-else>--</span>
- </p>
- </div>
- </li>
- <li class="width-pre10 border-right">
- <p v-show="i == 0">{{shipping_type_list[item.shipping_type]}}</p>
- </li>
- <li class="width-pre10 border-right">
- <div v-show="i == 0">
- <el-tag size="small">{{ order_status_list[item.order_status] }}</el-tag>
- </div>
- </li>
- <li v-show="i == 0">
- <el-button size="small" type="text" @click="handle('detail',item)">详情</el-button>
- <el-button v-if="item.Printer && item.Printer.is_show_printer==1" size="small" type="text" @click="handle('printer',item)">打印小票</el-button>
- <template v-for="operate_item in status_operate_list[item.order_status]['operate']">
- <el-button size="small" type="text" @click="handle(operate_item.code,item)">{{operate_item.name}}</el-button>
- </template>
- </li>
- </ul>
- </div>
- </div>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- <!-- 订单表格 end -->
- </el-tab-pane>
- </el-tabs>
- </div>
- </el-card>
- <!-- 修改价格 -->
- <el-dialog title="订单改价" :visible.sync="isShowChangePrice">
- <el-form :model="change_price_form" ref="goodsValidateForm" label-width="80px" size="small">
- <el-table :data="change_price_form.detail" :span-method="objectSpanMethod" border>
- <el-table-column prop="goods_name" label="商品" width="180"></el-table-column>
- <el-table-column width="100" prop="price" label="单价(元)">
- <template slot-scope="scope">
- <span>{{scope.row.price}}元</span>
- </template>
- </el-table-column>
- <el-table-column width="50" prop="price" label="数量">
- <template slot-scope="scope">
- <span>{{scope.row.num}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="goods_price" label="小计">
- <template slot-scope="scope">
- <span>{{scope.row.price*scope.row.num}}元</span>
- </template>
- </el-table-column>
- <el-table-column prop="discount_sum" label="优惠" >
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" content="优惠 = 会员折扣 + 优惠券 + 积分抵扣 + 会员价 + 涨减价" placement="top">
- <span>{{(scope.row.discount_sum).toFixed(2)}}元</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column prop="" label="涨价或减价">
- <template slot-scope="scope">
- <el-input type="number" size="small" v-model="scope.row.adjust_money" @input="sumChangePrice(scope,$event)"></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="" label="运费">
- <template slot-scope="scope">
- <el-input size="small" v-model="change_price_form.shipping_money" @input="sumChangeShipping($event)" onkeyup="if(value<0){value=0}else{value=toNumber(value,2)}"></el-input>
- </template>
- </el-table-column>
- </el-table>
- <div style="padding-top: 20px;" class="change_formula">
- <p> 实付总金额 = 小计 + 店铺优惠 + 小计涨减价 + 运费 </p>
- </div>
- <div style="padding-top: 20px;" class="change_price">
- <p> <label>实付总金额 </label> ¥{{change_price_form.new_pay_money}} </p>
- </div>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="isShowChangePrice = false">取 消</el-button>
- <el-button type="primary" @click="handle('change_price',change_price_form,true)" :loading="changePriceLoading">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 备注 -->
- <el-dialog title="备注" width="600px" :visible.sync="isShowRemark">
- <el-form :model="remark_form" ref="goodsValidateForm" label-width="80px" size="small">
- <el-form-item label="" prop="remark">
- <el-input type="textarea" placeholder="卖家备注" v-model="remark_form.seller_remark"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="isShowRemark = false">取 消</el-button>
- <el-button type="primary" @click="handle('remark',remark_form,true)" :loading="remarkLoading">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 修改地址 -->
- <order-address :is_show="isShowChangeAddress" :change-address-loading="changeAddressLoading" @sure="handleChangeAddress" :order_info="change_address_form" @close="isShowChangeAddress = false"></order-address>
- <!-- 发货 -->
- <order-shipping :is_show="isShowChangeShipping" :change-shipping-loading="changeShippingLoading" :order_info="shipping_form" @submit="handleShipping" @close="isShowChangeShipping = false"></order-shipping>
- <el-dialog class="fenRunData" title="分润明细" :visible.sync="dialogTableVisible_fenRun">
- <el-tabs v-model="activeNames" @tab-click="commissionHandleClick">
- <el-tab-pane label="佣金" name="commission">
- <el-table :data="fenRunData">
- <el-table-column label="用户">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.avatar_url">
- <div slot="error" class="image-slot">
- <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div>{{scope.row.nickname}}<span style="color:blue">({{scope.row.user_id}})</span></div>
- <div>{{scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column property="change_num" label="佣金" ></el-table-column>
- <el-table-column property="is_frozen" label="状态" ></el-table-column>
- <el-table-column property="capital_type_text" label="类型" ></el-table-column>
- <el-table-column property="from_type_text" label="所属插件" ></el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="积分" name="score">
- <el-table :data="fenRunData">
- <el-table-column label="用户" >
- <template slot-scope="scope">
- <image style="width: 50px;height: 50px; border-radius: 50%;" :src="scope.row.avatar_url? scope.row.avatar_url:'resources/img/mall/default_avatar_url.png'"></image>
- <div style="color:#000;">{{scope.row.nickname}}</div>
- </template>
- </el-table-column>
- <el-table-column property="change_num" label="积分" ></el-table-column>
- <el-table-column property="is_frozen" label="状态" ></el-table-column>
- <el-table-column property="capital_type_text" label="类型" ></el-table-column>
- <el-table-column property="from_type_text" label="所属插件" ></el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- </el-dialog>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- price: 0,
- visibles: false,
- hidden: false,
- current: -1,
- detailIndex: -1,
- checkAll: false,
- checked: false,
- select: '',
- input3: '',
- goods_name: '',
- goods_id: '',
- is_show_change_price: true,
- marketing_type_map: {},
- status_operate_list: {
- '0': {
- operate: [{
- 'type': 'text',
- 'name': '支付',
- 'code': 'pay'
- }, {
- 'type': 'text',
- 'name': '关闭交易',
- 'code': 'cancel'
- },
- {
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- }, ]
- },
- '1': {
- operate: [{
- 'type': 'text',
- 'name': '发货',
- 'code': 'shipping'
- }, {
- 'type': 'text',
- 'name': '修改地址',
- 'code': 'change_address'
- }, {
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '2': {
- operate: [{
- 'type': 'text',
- 'name': '确认收货',
- 'code': 'take-delivery'
- }, {
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '3': {
- operate: [{
- 'type': 'text',
- 'name': '订单完成',
- 'code': 'sales'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '4': {
- operate: [{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '6': {
- operate: [{
- 'type': 'text',
- 'name': '确认自提',
- 'code': 'shipping'
- }, {
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '7': {
- operate: [{
- 'type': 'text',
- 'name': '订单完成',
- 'code': 'sales'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '-1': {
- operate: [{
- 'type': 'text',
- 'name': '售后审核',
- 'code': 'sales_review'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '-2': {
- operate: [{
- 'type': 'text',
- 'name': '售后完成',
- 'code': 'sales_finish'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '-3': {
- operate: [{
- 'type': 'text',
- 'name': '售后完成',
- 'code': 'sales_finish'
- },{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '-4': {
- operate: [{
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- }, {
- 'type': 'text',
- 'name': '删除',
- 'code': 'destroy'
- }]
- },
- '-5': {
- operate: [{
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- }, {
- 'type': 'text',
- 'name': '删除',
- 'code': 'destroy'
- }]
- }
- },
- repeal_list: {
- '1': '售后中',
- '2': '售后完成',
- },
- tabs: [{
- name: '全部',
- value: '999'
- },
- {
- name: '未付款',
- value: '0'
- },
- {
- name: '待发货',
- value: '1'
- },
- {
- name: '待收货',
- value: '2'
- },
- {
- name: '已收货',
- value: '3'
- },
- {
- name: '已完成',
- value: '4'
- },
- {
- name: '已关闭',
- value: '-4'
- },
- ],
- order_status_list: {
- '0': "待付款",
- '1': "待发货",
- '2': "已发货",
- '3': "已收货",
- '4': "已完成",
- '6': "待自提",
- '7': "已自提",
- '-4': "已关闭",
- '-2': "退款中",
- '-1': "售后申请"
- },
- payment_type_list: {
- '0': "在线支付",
- '1': "微信",
- '2': "支付宝",
- '3': "银联卡",
- '5': "余额支付",
- '7': "汇聚支付",
- '8': "汇聚快捷支付",
- '100': "线下支付"
- },
- shipping_type_list: [],
- selectList: [{
- value: 'order_sn',
- name: '订单号'
- }, ],
- keyword_1: '1',
- activeName: '999',
- list: [],
- export_list:{},
- listLoading: false,
- page: 1,
- pageCount: 0,
- mch_id: 0, // 这个地方不知道要怎么获取
- searchCats: [],
- datetime: [],
- search_data: { // 筛选条件
- order_status: null,
- cats: [],
- start: null,
- end: null,
- goods_id: null,
- order_no: null,
- type_value: null,
- type: null,
- order_id: 0,
- r:'mch/client/order/index',
- },
- isShowChangePrice: false,
- change_price_form: {
- detail: [],
- shipping_money: 0,
- },
- isShowChangeAddress: false,
- change_address_form: {},
- isShowChangeShipping: false,
- shipping_form: {},
- isShowRemark: false,
- remark_form: {},
- user_level: {},
- // loading
- changePriceLoading: false,
- remarkLoading: false,
- changeAddressLoading: false,
- changeShippingLoading: false,
- orderUrl: 'mch/client/order/index',
- export_url: 'mch/client/order/index',
- checkedOrder: [],//选中的订单
- isIndeterminate: false,
- dialogTableVisible_fenRun: false,
- activeNames: 'commission',
- orderId: 0,
- fenRunData: [],
- changesShipping:0,
- changeprice:0,
- changeprice_status:false,
- sign:''
- };
- },
- created() {
- this.sign = getQuery('sign')
- },
- mounted: function() {
- this.search_data.order_id = getQuery('order_id');
- this.getList(this.search_data);
- },
- computed: {
- show_clear_search_btn: function() {
- return !isEmpty(this.search_data.cats) || !isEmpty(this.search_data.start) ||
- !isEmpty(this.search_data.end) || !isEmpty(this.search_data.goods_id) ||
- !isEmpty(this.search_data.order_no) || !isEmpty(this.search_data.type) ||
- !isEmpty(this.search_data.type_value);
- }
- },
- updated: function() {
- // console.log('ssssss')
- },
- methods: {
- change(e, type) {
- this.$forceUpdate();
- },
- //修改商品价格
- sumChangePrice(data,value){
- if(value && !isNaN(value)){
- if(value){
- var change_price = parseFloat(this.change_price_form.detail[data.$index].goods_price) + parseFloat(value);
- var changesShipping = this.change_price_form.shipping_money;
- if(this.changesShipping>0){ //当运费有修改时去修改的值
- changesShipping = this.changesShipping;
- }
- if(!changesShipping){
- changesShipping = 0;
- }
- var changeprice = 0;
- var new_pay_money = 0;
- for (var i=0; i<this.change_price_form.detail.length; i++){
- if(this.change_price_form.detail[i].adjust_money && !isNaN(this.change_price_form.detail[i].adjust_money)){
- var value_data = value.split(".");
- if(value_data.length>1){
- if(value_data[1].length>2){
- this.change_price_form.detail[i].adjust_money = parseFloat(value).toFixed(2);
- }
- }
- changeprice = parseFloat(changeprice) + parseFloat(this.change_price_form.detail[i].adjust_money);
- }
- new_pay_money += parseFloat(this.change_price_form.detail[i].goods_price);
- }
- if(change_price<0){
- this.change_price_form.new_pay_money = parseFloat(new_pay_money + parseFloat(changesShipping)).toFixed(2);
- this.change_price_form.detail[data.$index].new_goods_price = parseFloat(this.change_price_form.detail[data.$index].goods_price);
- this.$message.error("单个商品支付金额不可以小于零");
- }else{
- this.change_price_form.new_pay_money = (new_pay_money + parseFloat(changeprice) + parseFloat(changesShipping)).toFixed(2);
- if(this.change_price_form.new_pay_money<0.1){
- this.$message.error("实付金额不可以小于0.1");
- return false;
- }
- this.changeprice_status = true;
- this.change_price_form.detail[data.$index].new_goods_price = parseFloat(this.change_price_form.detail[data.$index].goods_price) + parseFloat(value);
- }
- }
- }
- return value;
- },
- //修改邮费
- sumChangeShipping(value){ //change_price_form.detail shipping_money
- var changeprice = 0;
- var new_pay_money = 0;
- for (var i=0; i<this.change_price_form.detail.length; i++){
- if(this.change_price_form.detail[i].adjust_money && !isNaN(this.change_price_form.detail[i].adjust_money)){
- changeprice = parseFloat(changeprice) + parseFloat(this.change_price_form.detail[i].adjust_money);
- }
- new_pay_money += parseFloat(this.change_price_form.detail[i].goods_price);
- }
- if(value &&!isNaN(value)){
- this.change_price_form.new_pay_money = (new_pay_money + parseFloat(value) + parseFloat(changeprice)).toFixed(2);
- this.changesShipping = parseFloat(value).toFixed(2);
- }
- },
- objectSpanMethod({
- row,
- column,
- rowIndex,
- columnIndex
- }) {
- if (columnIndex === 6) {
- console.log(rowIndex,'rowIndex');
- if (rowIndex === 0) {
- return {
- rowspan: this.change_price_form.detail.length,
- colspan: 1
- };
- } else {
- return {
- rowspan: 0,
- colspan: 0
- };
- }
- }
- return {
- rowspan: 1,
- colspan: 1
- };
- },
- mouseOver(index, i) {
- // console.log(i)
- this.current = index
- this.detailIndex = i
- this.hidden = true
- },
- mouseLeave() {
- this.hidden = false
- },
- printReceipt() { // 打印小票
- this.$confirm('是否打印小票?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- }).then(() => {
- }).catch(() => {});
- },
- remark() { // 备注
- },
- changeTime(e) {
- // console.log(e)
- this.search_data.start = e[0]
- this.search_data.end = e[1]
- },
- handleClick(res) { //标签页切换
- if (this.search_data.status == this.activeName) return;
- this.search_data.order_status = this.activeName;
- this.page = 1;
- this.getList(this.search_data);
- },
- search() {
- this.page = 1;
- this.getList(this.search_data);
- },
- clearSearch() {
- this.search_data.cats = [];
- this.search_data.start = null;
- this.search_data.end = null;
- this.search_data.order_status = null;
- this.search_data.order_no = null;
- this.search_data.type = null;
- this.search_data.type_value = null;
- this.datetime = [];
- this.getList();
- },
- handleChangeAddress(data) {
- this.handle('change_address', data, true);
- },
- handleShipping(data) {
- this.handle('shipping', data, true);
- },
- handle(type, data = null, submit = false) {
- console.log(type)
- let id = data ? parseInt(data.id) : '';
- let url = 'mall/order/operate'
- switch (type) {
- // 订单详情
- case 'detail':
- let params = {
- r: 'mch/client/order/detail'
- };
- if (id) params = Object.assign(params, {
- id: id,
- sign:this.sign
- });
- navigateTo(params);
- break;
- // 删除订单
- case 'destroy':
- param = {
- id: data.id,
- type
- };
- this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/client/order/del',param)
- }).catch((err) => {})
- break;
- // 取消订单
- case 'cancel':
- param = {
- id: id
- };
- this.$confirm('确定关闭订单吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/client/order/close', param)
- }).catch((err) => {})
- break;
- // 支付订单
- case 'pay':
- param = {
- id: id
- };
- this.$confirm('确定付款吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/client/order/pay', param)
- }).catch((err) => {})
- break;
- // 修改价格
- case 'change_price':
- if (submit) {
- //检测每个商品修改价格不可以小于0和商品总价不可以小于0
- for (var i=0; i<this.change_price_form.detail.length; i++){
- var change_price = (parseFloat(this.change_price_form.detail[i].goods_price) + parseFloat(this.change_price_form.detail[i].adjust_money)).toFixed(2);
- if(change_price<0){
- this.$message.error('单个商品的减价值不可以大于商品实付金额');
- return false;
- }
- }
- if(this.change_price_form.new_pay_money<0.1){
- this.$message.error("实付金额不可以小于0.1");
- return false;
- }
- this.changePriceLoading = true;
- this.send('mall/order/change-price', this.change_price_form, (resp) => {
- if (resp.code == 0) this.isShowChangePrice = false;
- });
- setTimeout(() => {
- this.changePriceLoading = false;
- }, 100);
- } else {
- this.isShowChangePrice = true;
- var objString = JSON.stringify(data);
- this.change_price_form = JSON.parse(objString);
- this.$set(this.change_price_form,'new_pay_money',this.change_price_form.pay_money);
- for (var i=0;i<this.change_price_form.detail.length;i++){
- this.$set(this.change_price_form.detail[i],'new_goods_price',this.change_price_form.detail[i].goods_price);
- this.$set(this.change_price_form.detail[i],'new_adjust_money',this.change_price_form.detail[i].adjust_money);
- //his.change_price_form.detail[i].adjust_money = 0;
- var discount_money = (parseFloat(this.change_price_form.detail[i].price)*this.change_price_form.detail[i].num) - parseFloat(this.change_price_form.detail[i].goods_price);
- this.$set(this.change_price_form.detail[i],'discount_sum',discount_money);
- }
- }
- break;
- // 修改收货地址
- case 'change_address':
- if (submit) {
- this.changeAddressLoading = true;
- this.send('mch/client/order/change-address', data, (resp) => {
- if (resp.code == 0) this.isShowChangeAddress = false;
- });
- setTimeout(() => {
- this.changeAddressLoading = false;
- }, 100);
- } else {
- this.isShowChangeAddress = true
- var objString = JSON.stringify(data);
- this.change_address_form = JSON.parse(objString);
- }
- break;
- // 备注
- case 'remark':
- if (submit) {
- this.remarkLoading = true;
- this.send('mch/client/order/remark', this.remark_form, (resp) => {
- if (resp.code == 0) this.isShowRemark = false;
- });
- setTimeout(() => {
- this.remarkLoading = false;
- }, 100);
- } else {
- this.isShowRemark = true
- var objString = JSON.stringify(data);
- this.remark_form = JSON.parse(objString);
- }
- break;
- // 物流发货
- case 'shipping':
- if (submit) {
- this.changeShippingLoading = true;
- this.send('mch/client/order/shipping', data, (resp) => {
- if (resp.code == 0) this.isShowChangeShipping = false;
- });
- setTimeout(() => {
- this.changeShippingLoading = false;
- }, 100);
- } else {
- this.isShowChangeShipping = true
- var objString = JSON.stringify(data);
- this.shipping_form = JSON.parse(objString);
- }
- break;
- // 收货
- case 'take-delivery':
- param = {
- id: id
- };
- this.$confirm('确定收货吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/client/order/take-delivery', param)
- }).catch((err) => {})
- break;
- // 订单完成
- case 'sales':
- param = {
- id: id
- };
- this.$confirm('确定完成订单吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/client/order/sales-order', param)
- }).catch((err) => {
- })
- break;
- case 'fen_run':
- this.dialogTableVisible_fenRun = true;
- this.orderId = id;
- this.getCapitalLog(id,this.activeNames)
- break;
- case 'printer':
- param = {
- order_id: id,
- print_type: 2 // 0 => 平台,1 => 门店,2 => 多商户
- };
- this.$confirm('确定打印?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/client/order/printer', param)
- }).catch((err) => {
- })
- break;
- }
- },
- send(url, params, callback) {
- let self = this;
- request({
- params: {
- r: url,
- },
- method: 'post',
- data: params
- }).then(e => {
- if (e.data.code == 0) {
- self.$message.success(e.data.msg);
- self.getList(this.search_data);
- } else {
- self.$message.error(e.data.msg);
- }
- if (callback) callback(e.data);
- }).catch(e => {
- console.log(e);
- });
- },
- searchClick() {
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList(this.search_data);
- },
- // 获取商品列表
- getList(params = {}) {
- let self = this;
- let basic_params = {
- r: 'mch/client/order/index',
- page: self.page,
- };
- params = Object.assign(basic_params, params);
- if (self.listLoading == false) {
- self.listLoading = true;
- request({
- params: params,
- method: 'get',
- }).then(e => {
- self.listLoading = false;
- if (e.data.code == 0) {
- self.list = e.data.data.list;
- self.shipping_type_list = e.data.data.shipping_type_list;
- self.payment_type_list = e.data.data.payment_type_list;
- self.marketing_type_map = e.data.data.marketing_type_map;
- this.export_list = e.data.data.export_list;
- self.pageCount = e.data.data.page_count;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.$message.error(e.data.msg);
- self.listLoading = false;
- });
- }
- },
- orderChange(val){
- let checkedCount = val.length;
- this.checkAll = checkedCount == this.list.length;
- this.isIndeterminate = checkedCount > 0 && checkedCount < this.list.length;
- },
- allSelOrder(boo){
- let ids = [];
- this.list.forEach(v => {
- ids.push(v.id);
- })
- this.checkedOrder = boo ? ids : [];
- this.isIndeterminate = false;
- },
- commissionHandleClick(tab, event){
- console.log(this.activeNames);
- this.getCapitalLog(this.orderId,this.activeNames)
- },
- getCapitalLog(orderId,wallet_type){
- request({
- params: {
- r: 'mch/client/order/commission-and-score-list',
- order_id: orderId,
- wallet_type: wallet_type,
- },
- method: 'get',
- }).then(e => {
- if (e.data.code == 0) {
- this.fenRunData = e.data.data.list;
- this.user_level = e.data.data.user_level;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- },
- getOrderPrice(data){
- let text = '';
- switch (data.marketing_type) {
- case 'ScoreMall' :
- text = data.extra_info;
- break;
- default :
- text = '¥'+data.goods_price;
- }
- return text;
- },
- }
- });
- </script>
|