| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('component/order-address', __DIR__);
- ComponentHelper::loadComponentView('component/order-shipping', __DIR__);
- ComponentHelper::loadComponentView('com-export-dialog');
- ?>
- <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;display:flex;">
- <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 label="">
- <el-input placeholder="请输入商户名称/手机号" v-model="search_data.keyword"></el-input>
- </el-form-item>
- <el-form-item label="标识">
- <el-select v-model="search_data.marketing_type" clearable placeholder="请选择">
- <el-option
- v-for="item in marketingTypeOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </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-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 v-model="item.select" @change=""></el-checkbox> -->
- <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>
- </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>(含运费¥{{ 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-s border-right">
- <!-- <div> -->
- <template v-if="item.mch">
- <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="item.mch.logo_img"></com-image>
- <div style="margin-top:5px;">{{item.mch.store_name}}</div>
- <div style="margin-top:5px;">{{item.mch.shop_mobile}}</div>
- </template>
- <!-- </div> -->
- </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>
- <!-- TODO: 修改价格 (一期没有)-->
- <!-- <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> -->
- <!-- TODO:备注 (一期没有)-->
- <!-- <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> -->
- <!-- TODO: 修改地址 (一期没有)-->
- <!-- <order-address :is_show="isShowChangeAddress" :change-address-loading="changeAddressLoading" @sure="handleChangeAddress" :order_info="change_address_form" @close="isShowChangeAddress = false"></order-address> -->
- <!-- TODO: 发货 -->
- <!-- <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: {},
- // TODO: 一期操作只有 查看详情
- status_operate_list: {
- '0': {
- operate: [
- // {
- // 'type': 'text',
- // 'name': '支付',
- // 'code': 'pay'
- // },
- // {
- // 'type': 'text',
- // 'name': '关闭交易',
- // 'code': 'cancel'
- // },
- // {
- // 'type': 'text',
- // 'name': '修改价格',
- // 'code': 'change_price'
- // },
- // {
- // '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': 'change_address'
- // }, {
- // 'type': 'text',
- // 'name': '备注',
- // 'code': 'remark'
- // },
- {
- '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': "待自提",
- '-4': "已关闭",
- '-2': "退款中",
- '-1': "售后申请"
- },
- payment_type_list: {
- '0': "在线支付",
- '1': "微信",
- '2': "支付宝",
- '3': "银联卡",
- '5': "余额支付",
- '7': "汇聚支付",
- '8': "汇聚快捷支付",
- '100': "线下支付"
- },
- shipping_type_list: {
- '1': "物流配送",
- '2': "买家自提",
- '3': "货到付款",
- '4': "本地配送"
- },
- 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,
- keyword: '',
- marketing_type: undefined,
- r: 'mch/store-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/store-order/index',
- export_url: 'mch/store-order/index',
- checkedOrder: [], //选中的订单
- isIndeterminate: false,
- dialogTableVisible_fenRun: false,
- activeNames: 'commission',
- orderId: 0,
- fenRunData: [],
- changesShipping: 0,
- changeprice: 0,
- changeprice_status: false,
- marketingTypeOptions: [
- {
- value: 'GroupBuy',
- label: '拼团'
- },
- {
- value: 'Bargain',
- label: '美丽天天砍'
- },
- {
- value: 'Seckill',
- label: '秒杀'
- },
- ]
- };
- },
- 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) || !isEmpty(this.search_data.keyword) ||
- !isEmpty(this.search_data.marketing_type);
- }
- },
- 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.search_data.keyword = '';
- this.search_data.marketing_type = undefined;
- 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 = 'mch/store-order/operate';
- switch (type) {
- // 订单详情
- case 'detail':
- let params = {
- r: 'mch/store-order/detail'
- };
- if (id) params = Object.assign(params, {
- id: id
- });
- navigateTo(params);
- break;
- // 删除订单
- case 'destroy':
- param = {
- id: data.id,
- type
- };
- this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/store-order/del', param)
- }).catch((err) => {})
- break;
- // 取消订单
- case 'cancel':
- param = {
- id: id
- };
- this.$confirm('确定关闭订单吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/store-order/close', param)
- }).catch((err) => {})
- break;
- // 支付订单
- case 'pay':
- param = {
- id: id
- };
- this.$confirm('确定付款吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/store-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('mch/store-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/store-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/store-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/store-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/store-order/take-delivery', param)
- }).catch((err) => {})
- break;
- // 订单完成
- case 'sales':
- param = {
- id: id
- };
- this.$confirm('确定完成订单吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mch/store-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: data.id
- };
- this.$confirm('确定打印?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('printer/default/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/store-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.payment_type_list = e.data.data.payment_type_list;
- self.shipping_type_list = e.data.data.shipping_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/store-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>
- <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>
|