123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476 |
- <template>
- <div class="app-container">
- <el-page-header @back="goBack" content="订单详情"></el-page-header>
- <div class="order-main">
- <el-row style="padding: 15px 15px 10px">
- <el-col :span="24">
- <div class="order-main-title">
- <span>订单编号:{{ orderDetail.orderId }}</span>
- <span>下单时间:{{ orderDetail.createTime }}</span>
- <span>商户:{{ orderDetail.companyWechatName || '无' }}</span>
- <!-- <span>网点:{{ orderDetail.websitName || '无' }}</span> -->
- <el-tag v-if="orderDetail.isOld == 'YES'">以旧换新</el-tag>
- <div class="fr">
- <el-link type="primary" :underline="false" @click="showDialog('remark')">订单备注</el-link>
- </div>
- </div>
- </el-col>
- </el-row>
- <div style="width: 100%; padding: 10px 15px 15px 15px">
- <el-row>
- <el-col :span="10">
- <div style="display: flex;">
- <div>
- <div class="order-main-status">
- <span>{{ orderDetail.orderStatus | ORDER_CURRENT_STATUS_FILTER }}</span>
- </div>
- <div class="order-main-opt-btn">
- <template v-if="orderDetail.orderStatus === 'NOPAY'">
- <el-popconfirm title="确定收款吗?" @confirm="confirmOrder">
- <el-button slot="reference" size="small">确认收款</el-button>
- </el-popconfirm>
- <el-button size="small" @click="showDialog('price')" style="margin-left: 10px;">修改价格</el-button>
- <el-popconfirm title="确定取消订单吗?" @confirm="cancelOrder" style="margin-left: 10px;">
- <el-button slot="reference" size="small" type="danger">取消订单</el-button>
- </el-popconfirm>
- </template>
- <template v-if="orderDetail.orderStatus === 'DFH'">
- <el-button size="small" type="primary" @click="showDialog('send')">发货</el-button>
- <el-popconfirm title="确定取消订单吗?" @confirm="cancelOrder" style="margin-left: 10px;">
- <el-button slot="reference" size="small" type="danger">取消订单</el-button>
- </el-popconfirm>
- </template>
- <!-- <el-button type="primary" size="small" @click="returnOrder()" v-if="(orderDetail.orderStatus === 'YFH' || orderDetail.orderStatus === 'OVER')">发起退货</el-button> -->
- <template v-if="orderDetail.orderStatus === 'YFH' || orderDetail.orderStatus === 'OVER'">
- <el-button size="small" @click="showDialog('query')">查看物流</el-button>
- </template>
- </div>
- </div>
- <el-table
- class="specTable"
- style="margin-left: 30px;"
- height="120px"
- :data="printList"
- element-loading-text="Loading"
- border
- highlight-current-row
- stripe>
- <el-table-column align="center" label="打印人" prop="createBy" min-width="120" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="打印时间" prop="createTime" width="160"></el-table-column>
- </el-table>
- </div>
-
- </el-col>
- <el-col :span="14" style="padding-top: 10px;">
- <el-steps :active="orderDetail.orderStatus != 'CLOSE' ? curOrderStatus : -1" align-center>
- <el-step title="买家下单" :description="orderDetail.createTime"></el-step>
- <el-step title="买家付款" :description="orderDetail.payTime ? orderDetail.payTime : ''"></el-step>
- <el-step title="商家发货" :description="orderDetail.deliverTime ? orderDetail.deliverTime : ''"></el-step>
- <el-step title="交易成功" :description="orderDetail.overTime ? orderDetail.overTime : ''"></el-step>
- </el-steps>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="order-receive-info">
- <el-row :gutter="30">
- <el-col :xs="24" :sm="12" :lg="12">
- <div class="main-detail">
- <h3>订单信息</h3>
- <div class="item">
- <div class="label">收货人信息:</div>
- <div class="value">{{ orderDetail.receUserName }} ({{ orderDetail.recePhone }})</div>
- </div>
- <div class="item">
- <div class="label">收货人地址:</div>
- <div class="value">{{ orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street +
- orderDetail.receAddress + (orderDetail.houseNo || '') }}</div>
- </div>
- <div class="item">
- <div class="label">销售员信息:</div>
- <div class="value">{{ orderDetail.workerName }} ({{ orderDetail.workerPhone }})</div>
- </div>
- <div class="item">
- <div class="label">业务员信息:</div>
- <div class="value">{{ orderDetail.saleName }} ({{ orderDetail.saleMobile }})</div>
- </div>
- <div class="item">
- <div class="label">下单渠道:</div>
- <div class="value">{{ orderDetail.source }}</div>
- </div>
- <div class="item">
- <div class="label">支付方式:</div>
- <div class="value">{{ orderDetail.payType }}</div>
- </div>
- <div class="item">
- <div class="label">是否开票:</div>
- <div class="value">{{ orderDetail.tax ? '是' : '否' }}</div>
- </div>
- <div class="item" v-if="orderDetail.dispatchType">
- <div class="label">工单派单方式:</div>
- <div class="value">{{ orderDetail.dispatchType }}</div>
- </div>
- </div>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="12" v-if="orderDetail.orderStatus === 'YFH' || orderDetail.orderStatus === 'OVER'">
- <div class="main-detail">
- <h3>物流信息</h3>
- <div class="item">
- <div class="label">快递单号:</div>
- <div class="value">{{ orderDetail.logisticsNo }}</div>
- </div>
- <div class="item">
- <div class="label">快递公司:</div>
- <div class="value">{{ orderDetail.companyName }}</div>
- </div>
- <div class="item">
- <div class="label">货件仓储:</div>
- <div class="value">{{ orderDetail.storageName }}</div>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- <div v-if="orderDetail.orderOldProductDTOList && orderDetail.orderOldProductDTOList.length > 0" style="margin-bottom: 30px;">
- <h3>旧机信息</h3>
- <div class="order-detail">
- <!-- 回收 -->
- <el-table :data="orderDetail.orderOldProductDTOList" style="width: 100%;" size="small" border>
- <el-table-column prop="mainName" label="大类" align="center"></el-table-column>
- <el-table-column prop="smallName" label="小类" align="center"></el-table-column>
- <el-table-column prop="specName" label="型号" align="center"></el-table-column>
- <el-table-column prop="itemList" label="属性" align="center">
- <template slot-scope="scope">
- {{scope.row.itemList.map(o => o.dictName).join('、')}}
- </template>
- </el-table-column>
- <el-table-column prop="unit" label="单位" align="center">
- <template>台</template>
- </el-table-column>
- <el-table-column prop="num" label="数量" align="center"></el-table-column>
- <el-table-column prop="payAmount" label="旧机金额" align="center"></el-table-column>
- <el-table-column prop="yjhxDkFlag" label="支付方式" align="center">
- <template slot-scope="scope">
- {{ {1: '线上支付抵扣订单货款', 2: '仅线上展示旧机价值'}[scope.row.yjhxDkFlag] }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <div v-if="compensateList.length > 0" style="margin-bottom: 30px;">
- <h3>理赔信息</h3>
- <div class="order-detail">
- <!-- 理赔表格 -->
- <el-table :data="compensateList" style="width: 100%;" size="small" border>
- <el-table-column prop="goodsName" label="理赔商品" align="center"></el-table-column>
- <el-table-column prop="num" label="理赔数量" align="center"></el-table-column>
- <el-table-column prop="createTime" label="理赔时间" align="center"></el-table-column>
- <el-table-column prop="refundAmount" label="理赔金额" align="center"></el-table-column>
- <el-table-column prop="operatorUser" label="操作人" align="center"></el-table-column>
- <el-table-column prop="remark" label="备注" align="center"></el-table-column>
- </el-table>
- </div>
- </div>
- <h3>商品信息</h3>
- <div class="order-detail" style="margin-bottom: 30px;">
- <!-- 订单表格 -->
- <el-table :data="orderDetail.orderDetails" style="width: 100%" border>
- <el-table-column label="商品信息" min-width="200">
- <template slot-scope="scope">
- <el-row>
- <el-col :span="6">
- <el-image style="width: 40px; height: 40px" :src="scope.row.imgUrl">
- <div slot="error" class="image-slot">
- <i class="el-icon-picture-outline"></i>
- </div>
- </el-image>
- </el-col>
- <el-col :span="18">
- <div><el-tag type="danger" effect="plain" size="mini" style="margin-right: 4px" v-if="scope.row.promotionFullPieceId">满件打折</el-tag>{{ scope.row.goodsName }}</div>
- </el-col>
- </el-row>
- </template>
- </el-table-column>
- <el-table-column prop="goodsSpecValue" label="规格" align="center">
- <template slot-scope="scope">
- {{scope.row.goodsSpecName}}{{scope.row.goodsSpecValue}}
- </template>
- </el-table-column>
- <el-table-column prop="price" label="单价" align="center"></el-table-column>
- <el-table-column prop="num" label="数量" align="center"></el-table-column>
- <el-table-column prop="sendStockNum" label="已发货数量" min-width="100" align="center"></el-table-column>
- <el-table-column prop="shareAmount" label="分销金额" align="center">
- <template slot-scope="scope">
- {{ orderDetail.workerId || orderDetail.promotionGroupUserId ? scope.row.shareAmount : '0' }}
- </template>
- </el-table-column>
- <el-table-column prop="discountAmount" label="优惠金额" align="center"></el-table-column>
- <!-- <el-table-column prop="zkAmount" label="折扣优惠" align="center"></el-table-column> -->
- <el-table-column prop="applyAmount" label="优惠价格申请" align="center" min-width="110"></el-table-column>
- <el-table-column prop="profitAmount" label="实际销售金额" align="center" min-width="110">
- <template slot-scope="scope">
- {{ orderDetail.workerId || orderDetail.promotionGroupUserId ? scope.row.profitAmount : scope.row.payAmount }}
- </template>
- </el-table-column>
- <el-table-column prop="payAmount" label="商品总金额" align="center" min-width="100"></el-table-column>
- <el-table-column prop="freight" label="运费" align="center"></el-table-column>
- <el-table-column prop="userRefundNum" label="用户维权数量" align="center" min-width="110"></el-table-column>
- <el-table-column prop="userRefundAmount" label="用户维权金额" align="center" min-width="110"></el-table-column>
- <el-table-column prop="refundNum" label="退款数量" align="center"></el-table-column>
- <el-table-column prop="refundAmount" label="退款金额" align="center"></el-table-column>
- <el-table-column prop="refundBy" label="退款人" align="center"></el-table-column>
- <el-table-column prop="refundTime" label="退款时间" align="center" min-width="160"></el-table-column>
- <el-table-column label="操作" align="center" width="160" v-if="orderDetail.orderStatus != 'CLOSE' && orderDetail.payTypeId == 'WECHAT'">
- <template slot-scope="scope">
- <!-- <el-button v-if="!~['TIMEOUT', 'CLOSE'].indexOf(orderDetail.orderStatus)" size="mini" type="primary"
- @click="handleRefund(scope.row)"
- :disabled="!orderDetail.refundAble || scope.row.refundNum >= scope.row.num">退款</el-button> -->
- <!-- <el-button v-if="!~['TIMEOUT'].indexOf(orderDetail.orderStatus)" size="mini"
- @click="handleCompensate(scope.row)">理赔</el-button> -->
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="deliverList.length > 0" style="margin-bottom: 30px;">
- <h3>发货记录</h3>
- <div class="order-detail">
- <!-- 发货记录 -->
- <el-table :data="deliverList" style="width: 100%;" size="small" border>
- <el-table-column prop="deliveryId" align="center" label="发货单号" width="160"></el-table-column>
- <el-table-column prop="status" align="center" label="状态">
- <template slot-scope="scope">
- {{ {SEND: '已发货', REFUND: '已退货', PART_REFUND: '部分退货', REFUND_PRICE: '仅退款'}[scope.row.status] }}
- </template>
- </el-table-column>
- <el-table-column prop="sendNum" align="center" label="发货数量"></el-table-column>
- <el-table-column prop="refundNum" align="center" label="退货数量"></el-table-column>
- <el-table-column prop="num" align="center" label="订单数量"></el-table-column>
- <el-table-column prop="sendInsideCodeQty" align="center" label="内机数量"></el-table-column>
- <el-table-column prop="sendOutCodeQty" align="center" label="外机数量"></el-table-column>
- <el-table-column prop="sendPartsCodeQty" align="center" label="配件数量"></el-table-column>
- <el-table-column prop="storageStockName" align="center" label="发货仓库" width="100"></el-table-column>
- <el-table-column prop="pickType" align="center" label="发货方式">
- <template slot-scope="scope">
- {{scope.row.pickType == 'YES' ? '自提' : '快递物流'}}
- </template>
- </el-table-column>
- <el-table-column prop="logisticsNo" align="center" label="快递单号" width="100"></el-table-column>
- <el-table-column prop="companyName" align="center" label="物流公司" width="100"></el-table-column>
- <el-table-column prop="pickName" align="center" label="提货人"></el-table-column>
- <el-table-column prop="pickPhone" align="center" label="提货人电话" width="110"></el-table-column>
- <el-table-column align="center" prop="deliverTime" label="发货时间" min-width="160"></el-table-column>
- <el-table-column prop="createBy" align="center" label="操作人" width="140"></el-table-column>
- <el-table-column prop="createTime" align="center" label="操作时间" width="160"></el-table-column>
- <el-table-column align="center" label="操作" fixed="right">
- <template slot-scope="scope">
- <!-- <el-button v-if="!~['TIMEOUT', 'CLOSE'].indexOf(orderDetail.orderStatus)" size="mini" type="text"
- @click="handleRefund(scope.row)" :disabled="!orderDetail.refundAble || scope.row.refundNum >= scope.row.num">退款
- </el-button> -->
- <el-button type="text" size="small" @click="toDeliverDetail(scope.row.deliveryId)">详情</el-button>
- <el-button type="text" size="small" @click="returnOrder(scope.row.deliveryId)" v-if="!~['TIMEOUT', 'CLOSE'].indexOf(orderDetail.orderStatus) && scope.row.status == 'SEND'">发起退货</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <div class="order-detail">
- <div class="order-amount-info">
- <el-row>
- <el-col :span="19">
- <div style="width: 1px;height: 1px;"></div>
- </el-col>
- <el-col :span="5">
- <div style="padding-bottom: 10px;">商品总价:¥ {{ orderDetail.totalAmount }}</div>
- <div style="padding-bottom: 10px;">运费:¥ {{ orderDetail.freight }}</div>
- <div style="padding-bottom: 10px;" v-if="orderDetail.discountAmount">
- 优惠:¥ {{ orderDetail.discountAmount }}
- <span v-if="orderDetail.exchangeCode">(优惠码:{{ orderDetail.exchangeCode }})</span>
- <span v-if="orderDetail.promotionDiscountRate">({{ orderDetail.promotionDiscountRate * 10 }}折)</span>
- <span v-if="orderDetail.promotionFullPieceId">({{ orderDetail.promotionFullPieceRemark }})</span>
- </div>
- <div style="font-size: 14px;">
- <span style="padding-right: 15px;">实际收款</span><span style="color: red;font-size: 18px;">¥ {{
- orderDetail.payAmount }}</span>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="order-evaluate-info" v-if="evaluateDetail">
- <div class="title">
- <div class="left">评价信息<span>{{ evaluateDetail.createTime }}</span></div>
- <div class="right">
- <span>是否客户端展示</span>
- <el-switch v-model="evaluateDetail.isShow" @change="changeShow"></el-switch>
- </div>
- </div>
- <div class="main">
- <div class="rate-list">
- <div style="display: flex; align-items: center; margin-bottom: 5px;">商品质量:<el-rate
- :value="evaluateDetail.commentGoods" disabled disabled-void-color="#DDDDDD"></el-rate></div>
- <div style="display: flex; align-items: center; margin-bottom: 5px;">服务质量:<el-rate
- :value="evaluateDetail.commentService" disabled disabled-void-color="#DDDDDD"></el-rate></div>
- <div style="display: flex; align-items: center;">配送质量:<el-rate :value="evaluateDetail.commentExpress" disabled
- disabled-void-color="#DDDDDD"></el-rate></div>
- </div>
- <div class="tag-list" v-if="orderDetail.orderCommentTags && orderDetail.orderCommentTags.length > 0">
- <el-tag v-for="(item, index) in orderDetail.orderCommentTags" :key="index">{{ item }}</el-tag>
- </div>
- </div>
- <div class="content">{{ evaluateDetail.content }}</div>
- <div class="img-list" v-if="orderDetail.orderCommentImgs && orderDetail.orderCommentImgs.length > 0">
- <el-image v-for="(item, index) in orderDetail.orderCommentImgs" :key="index" :src="item"
- :preview-src-list="orderDetail.orderCommentImgs" fit="cover"></el-image>
- </div>
- </div>
- <el-dialog :title="dialogTitle" :visible.sync="remarkVisible" :show-close="false" :width="dialogWidth"
- :close-on-click-modal="false">
- <el-form :model="orderForm" :rules="orderFormRules" ref="orderForm" v-if="curOpenDialogType !== 'query'"
- label-width="100px" label-position="left">
- <el-form-item prop="remark" v-if="curOpenDialogType === 'remark'">
- <el-input type="textarea" :autosize="{ minRows: 8, maxRows: 16 }" placeholder="请输入备注内容" v-model="remark"
- maxlength="100" show-word-limit>
- </el-input>
- </el-form-item>
- <el-form-item prop="payAmount" v-if="curOpenDialogType === 'price'">
- <el-input v-model="orderForm.payAmount" autocomplete="off" placeholder="请输入价格"></el-input>
- </el-form-item>
- <el-form-item label="收货人" prop="receUserName" v-if="curOpenDialogType === 'info'">
- <el-input v-model="orderForm.receUserName" autocomplete="off" placeholder="请输入收货人"></el-input>
- </el-form-item>
- <el-form-item label="收货电话" prop="recePhone" v-if="curOpenDialogType === 'info'">
- <el-input v-model="orderForm.recePhone" autocomplete="off" placeholder="请输入收货电话"></el-input>
- </el-form-item>
- <el-form-item label="收货地址" prop="receAddress" v-if="curOpenDialogType === 'info'">
- <el-input v-model="orderForm.receAddress" autocomplete="off" placeholder="请输入收货地址"></el-input>
- </el-form-item>
- <template v-if="curOpenDialogType === 'send'">
- <el-row :gutter="20">
- <el-col :span="6">
- <el-form-item label="发货方式" prop="pickType">
- <el-radio-group v-model="orderForm.pickType">
- <el-radio label="YES">自提/自送</el-radio>
- <el-radio label="NO">快递物流</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item v-if="orderForm.pickType == 'YES'" label="提货人" prop="pickName" :rules="[{ required: true, message: '提货人不能为空', trigger: 'blur' }]">
- <el-input v-model="orderForm.pickName" placeholder="请输入提货人"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item v-if="orderForm.pickType == 'YES'" label="提货人电话" prop="pickPhone" :rules="[{ required: true, message: '提货人电话不能为空', trigger: 'blur' },{ pattern:/^((1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }]">
- <el-input v-model="orderForm.pickPhone" placeholder="请输入提货人电话"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item v-if="orderForm.pickType == 'NO'" label="快递单号" prop="logisticsNo">
- <el-input v-model="orderForm.logisticsNo" autocomplete="off" placeholder="请输入快递单号"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item v-if="orderForm.pickType == 'NO'" label="物流公司" prop="companyCode">
- <el-select v-model="orderForm.companyCode" placeholder="请选择物流公司" style="width: 100%;">
- <el-option :label="item.name" :value="item.code" v-for="(item, index) in companyList"
- :key="index"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="仓储" prop="storageId">
- <el-select v-model="orderForm.storageId" placeholder="请选择仓储" @change="(e)=>{
- storageName = storageList.find(item => item.storageId == e).storageName
- getDetail()
- }" style="width: 100%;">
- <el-option :label="item.storageName" :value="item.storageId" v-for="(item, index) in storageList"
- :key="index"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="是否派单" prop="workOrder">
- <el-radio-group v-model="orderForm.workOrder">
- <el-radio :label="true">是</el-radio>
- <el-radio :label="false">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-card class="box-card">
- <el-tabs v-model="typeIndex">
- <el-tab-pane v-if="orderDetail.orderStatus != 'YFH' && orderDetail.orderStatus != 'OVER'" label="发货数量" name="1"></el-tab-pane>
- <el-tab-pane v-if="joinCode == 'CODE'" label="发货条码" name="2"></el-tab-pane>
- </el-tabs>
- <br/>
- <el-button size="small" v-show="typeIndex == 2 && joinCode == 'CODE'" type="primary" @click="addCode()">新增</el-button>
- <el-button size="small" v-show="typeIndex == 1 && joinCode == 'CODE'" type="primary" @click="handleDownload('导入条码模板')">导入条码模板下载</el-button>
- <div class="table">
- <!-- 发货数量 -->
- <el-form v-show="typeIndex == 1" ref="formData1" :model="formData1" label-width="0" size="small" label-position="left">
- <el-table :data="formData1.list" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="deliverSelectionChange">
- <el-table-column type="selection" width="40"></el-table-column>
- <el-table-column prop="brandName" align="center" label="品牌"></el-table-column>
- <el-table-column prop="mainName" align="center" label="大类"></el-table-column>
- <el-table-column prop="smallName" align="center" label="小类"></el-table-column>
- <el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column>
- <el-table-column prop="goodsMaterialName" align="center" label="物料名称"></el-table-column>
- <el-table-column prop="goodsMaterialSpecsName" align="center" label="规格型号"></el-table-column>
- <el-table-column prop="goodsMaterialUnit" align="center" label="单位">
- <template slot-scope="scope">
- {{scope.row.goodsMaterialUnit == 'C'?'整套':scope.row.goodsMaterialUnit == 'I'?"单个":''}}
- </template>
- </el-table-column>
- <el-table-column prop="num" align="center" label="订单数量">
- <template slot-scope="scope">
- <el-input v-model="scope.row.num" placeholder="请输入" type="number"></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="sendStockNum" align="center" label="发货数量"></el-table-column>
- <el-table-column v-if="joinCode != 'NO'" prop="" align="center" label="发货仓库">
- <template slot-scope="scope">
- {{storageName}}
- </template>
- </el-table-column>
- <el-table-column v-if="joinCode != 'NO'" prop="stockOnQty" align="center" label="发货仓库库存" width="100"></el-table-column>
- <el-table-column v-if="joinCode != 'NO'" prop="allStockQty" align="center" label="库存总数量" width="100"></el-table-column>
- <el-table-column prop="insideNum" align="center" label="内机数量"></el-table-column>
- <el-table-column prop="outNum" align="center" label="外机数量"></el-table-column>
- <el-table-column prop="partNum" align="center" label="配件数量"></el-table-column>
- <el-table-column prop="insideCodeQty" align="center" label="导入内机条码数量" width="140"></el-table-column>
- <el-table-column prop="outCodeQty" align="center" label="导入外机条码数量" width="140"></el-table-column>
- <el-table-column prop="partsCodeQty" align="center" label="导入配件条码数量" width="140"></el-table-column>
- <el-table-column label="操作" align="center" width="140" fixed="right">
- <template slot-scope="scope" v-if="joinCode == 'CODE'">
- <el-upload
- action='_'
- :show-file-list='false'
- :http-request="importCode"
- >
- <el-button @click="orderDetailId = scope.row.orderDetailId" size="mini" type="text">导入条码</el-button>
- </el-upload>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <!-- 发货条码 -->
- <el-form ref="formData2" :model="formData2">
- <el-table v-show="typeIndex == 2" :data="formData2.list" element-loading-text="Loading" border fit highlight-current-row stripe>
- <el-table-column label="品牌" align="center">
- <template slot-scope="scope">
- <el-form-item>
- <el-input type="text" v-model="scope.row.brandName" :disabled="true" placeholder="请输入"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="商品大类" align="center">
- <template slot-scope="scope">
- <el-form-item>
- <el-input type="text" v-model="scope.row.mainName" :disabled="true" placeholder="请输入"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="商品小类" align="center">
- <template slot-scope="scope">
- <el-form-item>
- <el-input type="text" v-model="scope.row.smallName" :disabled="true" placeholder="请输入"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="" align="center" label="商品名称">
- <template slot-scope="scope">
- <el-form-item>
- <el-input type="text" v-model="scope.row.goodsMaterialName" :disabled="true" placeholder="请输入"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="规格型号" align="center">
- <template slot-scope="scope">
- <el-form-item :prop="'list.' + scope.$index + '.specs'" :rules="[{ required: true, message: `请选择规格型号`, trigger: 'blur' }]">
- <el-select v-model="scope.row.specs" @change="(e)=>{changeSpecs(e,scope.row)}" value-key="orderDetailId" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
- <el-option
- v-for="(item,ind) in formData1.list"
- :key="ind"
- :label="item.goodsMaterialSpecsName"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="物料类型" align="center">
- <template slot-scope="scope">
- <el-form-item :prop="'list.' + scope.$index + '.goodsMaterialItemType'" :rules="[{ required: true, message: `请选择物料类型`, trigger: 'blur' }]">
- <el-select v-model="scope.row.goodsMaterialItemType" @change="(e)=>{changeMaterial(e,scope.row)}"
- :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
- <el-option
- v-for="(item,ind) in [{name: '内机',id: 'INSIDE'},{name: '外机',id: 'OUT'},{name: '配件',id: 'PARTS'}]"
- :key="ind"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="物料名称" align="center">
- <template slot-scope="scope">
- <el-form-item :prop="'list.' + scope.$index + '.material'" :rules="[{ required: true, message: `请选择物料名称`, trigger: 'blur' }]">
- <el-select v-model="scope.row.material" @focus="(e)=>{
- if(!scope.row.goodsMaterialItemType){
- return $message.warning('请先选择物料类型!');
- }
- }" @change="(e)=>{
- scope.row.materialName = e.name
- scope.row.stockQty = (e.uniqueCode=='YES'?1:null)
- scope.row.uniqueCode = e.uniqueCode
- scope.row.goodsMaterialItemId = e.itemId
- }" value-key="name" :disabled="isEdit2 != scope.$index" placeholder="请选择" style="width: 100%;">
- <el-option
- v-for="(item,ind) in scope.row.materialList"
- :key="ind"
- :label="item.name"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="" align="center" label="是否一物一码" >
- <template slot-scope="scope">
- <el-form-item>
- {{scope.row.uniqueCode=='YES'?'是':scope.row.uniqueCode=='NO'?'否':''}}
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="" align="center" label="条码" >
- <template slot-scope="scope">
- <el-form-item :prop="'list.' + scope.$index + '.materialCode'" :rules="[{ required: true, message: `请输入条码`, trigger: 'blur' }]">
- <el-input type="text" v-model="scope.row.materialCode" :disabled="isEdit2 != scope.$index" placeholder="请输入"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="" align="center" label="数量">
- <template slot-scope="scope">
- <el-form-item :prop="'list.' + scope.$index + '.stockQty'" :rules="[{ required: true, message: `请输入数量`, trigger: 'blur' }]">
- <el-input type="number" v-model="scope.row.stockQty" :disabled="isEdit2 != scope.$index || scope.row.uniqueCode=='YES'" placeholder="请输入"></el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="right" width="140" fixed="right">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" v-if="scope.$index == isEdit2" @click="saveCode(scope.row)">保存</el-button>
- <el-button size="mini" type="primary" v-if="scope.$index != isEdit2" @click="isEdit2 = scope.$index">编辑</el-button>
- <el-popconfirm title="确定删除吗?" @confirm="delCode(scope.row.orderDetailCodeId,scope.$index)">
- <el-button slot="reference" size="mini" type="danger">删除</el-button>
- </el-popconfirm>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </template>
- </el-form>
- <el-table v-loading="logisticsLoading" :data="logistics" style="width: 100%" size="mini"
- v-if="curOpenDialogType === 'query'">
- <el-table-column prop="comName" label="物流公司" align="center"></el-table-column>
- <el-table-column prop="areaName" label="地区名称" align="center"></el-table-column>
- <el-table-column prop="time" label="物流时间" align="center"></el-table-column>
- <el-table-column prop="state" label="物流状态" align="center">
- <template slot-scope="scope">
- {{ scope.row.state | EXPRESS_CURRENT_STATE_FILTER }}
- </template>
- </el-table-column>
- <el-table-column prop="context" label="物流详情" align="center"></el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
-
- <el-button type="primary" @click="saveForm" v-if="curOpenDialogType !== 'query' && curOpenDialogType !== 'send'">保 存</el-button>
- <el-button type="primary" @click="deliverGoods" v-if="curOpenDialogType == 'send'">发 货</el-button>
- <el-button @click="cancelForm">{{ curOpenDialogType === 'query' ? '关 闭' : '取 消' }}</el-button>
- </div>
- </el-dialog>
- <el-dialog title="理赔" :visible.sync="compensateFormVisible" width="30%" :close-on-click-modal="false">
- <el-form ref="compensateForm" :model="compensateForm" :rules="compensateFormRules" label-position="left">
- <el-form-item label="理赔数量" prop="num">
- <el-input v-model="compensateForm.num" autocomplete="off"></el-input>
- </el-form-item>
- <el-form-item label="理赔金额" prop="amount">
- <el-input v-model="compensateForm.amount" autocomplete="off"></el-input>
- </el-form-item>
- <el-form-item label="备注" prop="remark">
- <el-input v-model="compensateForm.remark" autocomplete="off" type="textarea" :rows="3"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelCompensateForm">取 消</el-button>
- <el-button type="primary" @click="submitCompensateForm">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- cancelOrder,
- changePrice,
- changeReceiveInfo,
- confirmOrder,
- getOrderDetail, orderDeliver,
- saveRemark, orderRefund, orderCompensate, getCompensateList,
- changeShow, getCodeDetail, getMaterialList, listImport, saveCode, delCode, getPrintList, getDeliverList
- } from "@/api/order";
- import { getExpress, getCompanyList } from "@/api/common";
- import { commonTemplateDownload } from '@/api/common.js'
- import * as Storage from "@/api/storage";
- import { mapGetters } from 'vuex'
- export default {
- name: "detail",
- data() {
- return {
- orderId: '',
- orderDetail: {},
- evaluateDetail: null,
- dialogTitle: '',
- remarkVisible: false,
- remark: '',
- price: 0,
- orderForm: {
- orderId: '',
- payAmount: '',
- receAddress: '',
- receUserName: '',
- recePhone: '',
- logisticsNo: '',
- companyCode: '',
- workOrder: true,
- pickType: 'YES',
- pickName: '',
- pickPhone: ''
- },
- orderFormRules: {
- payAmount: [
- {
- validator: (rule, value, callback) => {
- if (this.curOpenDialogType !== 'price') {
- callback()
- } else {
- if (!value) {
- callback(new Error('请输入价格'))
- } else {
- if (!this.isNumber(value)) {
- callback(new Error('请输入数字值'))
- } else {
- callback()
- }
- }
- }
- }, trigger: 'blur'
- }
- ],
- receUserName: [
- { require: true, message: '请输入收货人', trigger: 'blur' }
- ],
- recePhone: [
- { require: true, message: '请输入收货电话', trigger: 'blur' }
- ],
- receAddress: [
- { require: true, message: '请输入收货地址', trigger: 'blur' }
- ],
- logisticsNo: [
- {
- validator: (rule, value, callback) => {
- if (this.curOpenDialogType !== 'send') {
- callback()
- } else {
- if (!value) {
- callback(new Error('请输入快递单号'))
- } else {
- callback()
- }
- }
- }, trigger: 'blur'
- }
- ],
- storageId: [
- {
- validator: (rule, value, callback) => {
- let joinCode = JSON.parse(localStorage.getItem('greemall_user')).joinCode;
- if (this.curOpenDialogType !== 'send' || joinCode == 'NO') {
- callback()
- } else {
- if (!value) {
- callback(new Error('请选择仓储'))
- } else {
- callback()
- }
- }
- }, trigger: 'change'
- }
- ],
- companyCode: [
- {
- validator: (rule, value, callback) => {
- if (this.curOpenDialogType !== 'send') {
- callback()
- } else {
- if (!value) {
- callback(new Error('请选择快递公司'))
- } else {
- callback()
- }
- }
- }, trigger: 'change'
- }
- ]
- },
- curOpenDialogType: 'order',
- logistics: [],
- storageList: [],
- dialogWidth: '50%',
- logisticsLoading: false,
- companyList: [],
- compensateFormVisible: false,
- compensateForm: {
- id: null,
- num: '',
- amount: '',
- remark: '',
- },
- compensateFormRules: {
- num: [
- { required: true, message: '请输入理赔数量', trigger: 'blur' },
- {
- validator: (rule, value, callback) => {
- if (value > (this.compensateItem.num - this.compensateItem.refundNum)) {
- callback(new Error('最多还可以理赔' + (this.compensateItem.num - this.compensateItem.refundNum) + '件商品'));
- } else {
- callback();
- }
- }, trigger: 'blur'
- }
- ],
- amount: [
- { required: true, message: '请输入理赔金额', trigger: 'blur' },
- ]
- },
- compensateItem: {
- num: '',
- refundNum: '',
- },
- compensateList: [],
- typeIndex: '1',
- formData1: {
- list: [],
- },
- formData2: {
- list: [],
- },
- isEdit1: 0,
- isEdit2: 0,
- joinCode: JSON.parse(localStorage.getItem('greemall_user')).joinCode,
- orderDetailId: '',
- printList: [],
- deliverList: [],
- deliverSelection: [],
- storageName: ''
- }
- },
- created() {
- this.orderId = this.$route.query.orderId
- this.getDetail();
- this.getStorageList();
- this.getCompanyList();
- this.getCompensateList();
- this.getPrintList();
- this.getDeliverList();
- },
- methods: {
- getDetail() {
- getOrderDetail({ orderId: this.orderId,storageId: this.orderForm.storageId }).then((res) => {
- this.orderDetail = res.data
- this.orderDetail.workerName = this.orderDetail.workerName ? this.orderDetail.workerName : '暂无'
- this.orderDetail.workerPhone = this.orderDetail.workerPhone ? this.orderDetail.workerPhone : ''
- this.evaluateDetail = res.data.orderComment;
- let arr = []
- res.data.orderDetails.forEach(item=>{
- arr.push(item)
- // if(item.goodsMaterialId){
- // arr.push(item)
- // }
- })
- this.formData1.list = arr
- })
- },
- getDeliverList() {
- getDeliverList({
- pageNum: 1,
- pageSize: -1,
- params: [{param: 'a.order_id', compare: '=', value: this.orderId}]
- }).then(res => {
- this.deliverList = res.data.records;
- })
- },
- getPrintList() {
- getPrintList({ orderId: this.orderId }).then(res => {
- this.printList = res.data || [];
- })
- },
- showDialog(type) {
- this.dialogWidth = type === 'query' ? '80%' : type === 'send' ? '80%': '50%'
- this.remarkVisible = true
- this.curOpenDialogType = type
- if (type === 'remark') {
- this.dialogTitle = '订单备注'
- this.remark = this.orderDetail.remark
- } else if (type === 'price') {
- this.dialogTitle = '修改价格'
- this.orderForm.payAmount = this.orderDetail.payAmount
- } else if (type === 'info') {
- this.dialogTitle = '收货人信息'
- this.orderForm.receUserName = this.orderDetail.receUserName
- this.orderForm.recePhone = this.orderDetail.recePhone
- this.orderForm.receAddress = this.orderDetail.receAddress
- } else if (type === 'send') {
- this.dialogTitle = '发货信息'
- } else if (type === 'query') {
- this.logisticsLoading = true
- this.dialogTitle = '物流信息'
- getExpress({
- logisticsNo: this.orderDetail.logisticsNo,
- companyCode: this.orderDetail.companyCode
- }).then(res => {
- this.logistics = res.data
- this.logisticsLoading = false
- })
- }
- },
- cancelForm() {
- this.remarkVisible = false
- if (this.curOpenDialogType === 'query') {
- return
- }
- this.$refs.orderForm.resetFields()
- if (this.curOpenDialogType === 'remark') {
- this.remark = ''
- } else if (this.curOpenDialogType === 'price') {
- this.price = ''
- }
- },
- saveForm() {
- const params = {
- orderId: this.orderId
- }
- if (this.curOpenDialogType === 'remark') {
- params.remark = this.remark
- saveRemark(params).then(() => {
- this.cancelForm();
- this.getDetail();
- this.$successMsg('保存成功');
- })
- } else if (this.curOpenDialogType === 'price') {
- params.price = this.orderForm.payAmount
- this.$refs.orderForm.validate((valid) => {
- if (valid) {
- changePrice(params).then(() => {
- this.cancelForm();
- this.getDetail();
- this.$successMsg('保存成功');
- })
- }
- })
- } else if (this.curOpenDialogType === 'info') {
- params.receUserName = this.orderForm.receUserName
- params.recePhone = this.orderForm.recePhone
- params.receAddress = this.orderForm.receAddress
- params.orderStatus = this.orderDetail.orderStatus
- this.$refs.orderForm.validate((valid) => {
- if (valid) {
- changeReceiveInfo(params).then(() => {
- this.cancelForm();
- this.getDetail();
- this.$successMsg('保存成功');
- })
- }
- })
- } else if (this.curOpenDialogType === 'send') {
- params.logisticsNo = this.orderForm.logisticsNo
- params.storageId = this.orderForm.storageId
- params.companyCode = this.orderForm.companyCode
- params.workOrder = this.orderForm.workOrder
- this.$refs.orderForm.validate((valid) => {
- if (valid) {
- orderDeliver(params).then(() => {
- this.cancelForm();
- this.getDetail();
- this.$successMsg('保存成功');
- })
- }
- })
- }
- },
- cancelOrder() {
- cancelOrder({ orderId: this.orderId }).then(() => {
- this.getDetail();
- this.$successMsg('取消成功');
- })
- },
- confirmOrder() {
- confirmOrder({ orderId: this.orderId }).then(() => {
- this.getDetail();
- this.$successMsg('确认收款成功');
- })
- },
- toDeliverDetail(deliveryId) {
- this.$router.push({
- name: "sales_deliver_order_list",
- query: {
- deliverId: deliveryId
- }
- })
- },
- // 发起退货
- returnOrder(deliveryId) {
- this.$router.push({
- name: "sales_return_order_list",
- query: {
- deliverId: deliveryId
- }
- })
- },
- goBack() {
- // this.$router.go(-1);
- this.$router.push({
- name:"order_list"
- })
- },
- isNumber(val) {
- const regPos = /^\d+(\.\d+)?$/
- const regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/
- if (regPos.test(val) || regNeg.test(val)) {
- return true
- } else {
- return false
- }
- },
- getStorageList() {
- Storage.getList({ pageNum: 1, pageSize: -1, type: '商品' }).then(res => {
- this.storageList = res.data.records
- })
- },
- // 获取物流公司列表
- getCompanyList() {
- getCompanyList().then(res => {
- this.companyList = res.data;
- })
- },
- // 退款
- handleRefund(row) {
- console.log(row);
- if (row.num == 1) {
- this.$confirm('此操作将退款此商品, 是否继续?', '退款', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.orderRefund(1, row.orderDetailId);
- }).catch(() => { });
- }
- else {
- this.$prompt('请输入退款数量', '退款', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- inputValidator: function (value) {
- if (!value) return '请输入退款数量';
- if (value == 0) return '退款数量不能小于1';
- if (value > (row.num - row.refundNum)) {
- return '最多还可以退款' + (row.num - row.refundNum) + '件商品'
- }
- },
- }).then(({ value }) => {
- this.orderRefund(value, row.orderDetailId);
- }).catch(() => { });
- }
- },
- // 退款
- orderRefund(num, id) {
- orderRefund({
- num: num,
- orderDetailId: id,
- }).then(res => {
- this.getDetail();
- this.$successMsg('退款成功');
- })
- },
- // 理赔
- handleCompensate(row) {
- this.compensateFormVisible = true;
- this.compensateForm.id = row.orderDetailId;
- this.compensateItem.num = row.num;
- this.compensateItem.refundNum = row.refundNum;
- },
- // 取消 理赔
- cancelCompensateForm() {
- this.compensateFormVisible = false;
- this.compensateForm = {
- id: null,
- num: '',
- amount: '',
- remark: '',
- }
- },
- // 提交 理赔
- submitCompensateForm() {
- this.$refs.compensateForm.validate((valid) => {
- if (valid) {
- let params = {
- adminUserId: this.userid,
- orderDetailId: this.compensateForm.id,
- num: this.compensateForm.num,
- refundAmount: this.compensateForm.amount,
- remark: this.compensateForm.remark,
- }
- orderCompensate(params).then(res => {
- this.cancelCompensateForm();
- this.getDetail();
- this.getCompensateList();
- this.$successMsg('理赔成功');
- })
- }
- });
- },
- // 获取理赔列表
- getCompensateList() {
- getCompensateList({ orderId: this.orderId }).then(res => {
- this.compensateList = res.data;
- })
- },
- // 切换评价信息是否显示
- changeShow() {
- changeShow({
- isShow: this.evaluateDetail.isShow,
- orderId: this.orderId,
- }).then(res => {
- this.getDetail();
- this.$successMsg();
- })
- },
-
- async getCodeDetail(){
- getCodeDetail({orderId: this.orderId}).then(async res => {
- for(var item of res.data){
- item.specs = {goodsMaterialSpecsName: item.specsName,orderDetailId: item.orderDetailId}
- item.material = {name: item.materialName}
- item.materialList = await this.getMaterialList(item.specsName,item.goodsMaterialItemType)
- }
- this.formData2.list = res.data
- })
- },
- async getMaterialList(specsName,type){
- return new Promise((resolve, reject) => {
- getMaterialList({
- pageNum: 1,
- pageSize: -1,
- specsName,
- type
- }).then(async res => {
- resolve(res.data.records)
- })
- })
-
- },
- async changeSpecs(e,row){
- row.brandName = e.brandName
- row.brandId = e.brandId
- row.mainName = e.mainName
- row.mainId = e.mainNumber
- row.smallName = e.smallName
- row.smallId = e.smallNumber
- row.specsName = e.goodsMaterialSpecsName
- row.goodsMaterialName = e.goodsName
- row.goodsMaterialId = e.goodsMaterialId
- row.material = null
- row.materialName = ''
- row.stockQty = ''
- row.uniqueCode = ''
- row.materialList = await this.getMaterialList(row.specsName,row.goodsMaterialItemType)
- row.orderDetailId = e.orderDetailId
- },
- async changeMaterial(e,row){
- if(!row.specs){
- return this.$message.warning('请先选择规格型号!');
- }
- row.material = null
- row.materialName = ''
- row.stockQty = ''
- row.uniqueCode = ''
- row.materialList = await this.getMaterialList(row.specsName,row.goodsMaterialItemType)
- },
- //发货新增条码
- addCode(){
- this.$refs.formData2.validate((valid) => {
- if (valid) {
- this.isEdit2 = 0
- this.formData2.list.unshift({
- brandId: '',
- brandName: '',
- mainId: '',
- mainName: '',
- stockQty: '',
- smallId: '',
- smallName: '',
- goodsMaterialItemType: '',
- goodsMaterialName: '',
- goodsMaterialId: '',
- materialCode: '',
- uniqueCode: '',
- specs: null,
- specsName: '',
- materialName: '',
- material: null,
- materialList: [],
- orderDetailId: '',
- goodsMaterialItemId: ''
- })
- }
- });
- },
- delCode(orderDetailCodeId,index){
- if(orderDetailCodeId){
- delCode({
- orderDetailCodeId
- }).then(res => {
- if (res.code == 200) {
- this.$message({ type: 'success', message: '删除成功!' })
- this.getOrderDetail()
- this.getCodeDetail()
- } else {
- this.$message.error(res.msg);
- }
- })
- }else{
- this.formData2.list.splice(index,1)
- }
- },
- saveCode(orderDetailCodes){
- const that = this
- let params = [{
- ...orderDetailCodes,
- orderId: this.orderId,
- }]
- delete params[0].material;
- delete params[0].specs;
- this.$refs.formData2.validate((valid, invalidFields, errLabels) => {
- if (valid) {
- saveCode(params).then(res=>{
- if(res.code == 200){
- that.$message.success('保存成功!')
- this.getOrderDetail()
- this.getCodeDetail()
- }
- })
- }
- })
- },
- deliverSelectionChange(val) {
- this.deliverSelection = val;
- },
- deliverGoods(){
- this.$refs.orderForm.validate((valid) => {
- if (valid) {
- if(this.deliverSelection.length < 1) return this.$errorMsg('请选择一个发货信息');
- for (let i = 0; i < this.deliverSelection.length; i++) {
- const item = this.deliverSelection[i];
- if(!item.num || item.num == 0) return this.$errorMsg('请填写发货数量-订单数量');
- }
- orderDeliver({
- orderId: this.orderId,
- logisticsNo: this.orderForm.pickType == 'NO' ? this.orderForm.logisticsNo : '',
- storageId: this.orderForm.storageId,
- companyCode: this.orderForm.pickType == 'NO' ? this.orderForm.companyCode : '',
- workOrder: this.orderForm.workOrder,
- pickName: this.orderForm.pickType == 'YES' ? this.orderForm.pickName : '',
- pickPhone: this.orderForm.pickType == 'YES' ? this.orderForm.pickPhone : '',
- pickType: this.orderForm.pickType,
- orderDeliveryDetailList: this.deliverSelection.map(item => {
- return {
- orderDetailId: item.orderDetailId,
- sendNum: item.num,
- sendInsideCodeQty: item.insideCodeQty,
- sendOutCodeQty: item.outCodeQty,
- sendPartsCodeQty: item.partsCodeQty,
- }
- }),
- }).then(() => {
- this.cancelForm();
- this.getDetail();
- this.getDeliverList();
- this.$successMsg('发货成功');
- })
- }
- })
- },
- importCode(data){
- const loading = this.$loading({
- lock: true,
- text: '正在导入',
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- })
- var formdata = new FormData()
- formdata.append('file', data.file)
- let params = {
- orderDetailId: this.orderDetailId
- }
- if (!!params) {
- for (const key in params) {
- if (Object.hasOwnProperty.call(params, key)) {
- formdata.append(key, params[key])
- }
- }
- }
- listImport({ formdata })
- .then(res => {
- this.getOrderDetail()
- loading.close()
- this.$message({
- type: 'success',
- message: '导入成功!'
- })
- })
- .catch(err => {
- loading.close()
- this.$message({
- type: 'error',
- message: err.message || '导入失败'
- })
- })
- },
-
- // 下载导入模版
- handleDownload(title) {
- commonTemplateDownload({ name: '导入条码.xlsx' }, title).then(res => {
- this.$message({
- message: '下载成功',
- type: 'success'
- })
- }).catch(err => {
- this.$message.error('下载失败')
- })
- },
- },
- computed: {
- ...mapGetters([
- 'userid',
- 'name'
- ]),
- curOrderStatus() {
- switch (this.orderDetail.orderStatus) {
- case 'NOPAY':
- return 1
- break;
- case 'DFH':
- return 2
- break;
- case 'YFH':
- return 3
- break;
- case 'OVER':
- return 4
- break;
- default:
- return 1
- }
- },
- totalAmountCompute() {
- if (!this.orderDetail.totalAmount) {
- return 0
- }
- const totalAmount = parseFloat(this.orderDetail.totalAmount)
- const freight = parseFloat(this.orderDetail.freight)
- return (totalAmount - freight).toFixed(2)
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .order-main {
- margin-top: 15px;
- border: 1px solid #e5e5e5;
- .order-main-title {
- font-size: 14px;
- }
- .order-main-title span {
- margin-right: 15px;
- }
- .order-main-status {
- padding: 15px 0;
- font-size: 24px;
- color: #409EFF;
- }
- .order-main-opt-btn {
- padding: 15px 0;
- }
- }
- .order-receive-info {
- margin: 15px 0 30px;
- padding: 15px;
- background: #f5f7fa;
- :first-child div span {
- padding-right: 15px;
- }
- }
- .order-detail {
- background: #f5f7fa;
- .order-amount-info {
- padding: 15px 0;
- font-size: 12px;
- font-weight: bold;
- }
- ::v-deep .el-table tr,
- ::v-deep .el-table th {
- background-color: #f5f7fa;
- }
- }
- .main-detail {
- .title {
- font-size: 16px;
- font-weight: 700;
- margin-bottom: 20px;
- }
- .item {
- display: flex;
- font-size: 14px;
- color: #666;
- padding-bottom: 12px;
- .label {
- white-space: nowrap;
- }
- }
- }
- .order-evaluate-info {
- margin: 15px 0;
- padding: 30px 15px;
- background: #f5f7fa;
- .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .left {
- font-size: 16px;
- font-weight: 700;
- span {
- font-weight: normal;
- margin-left: 20px;
- font-size: 14px;
- color: #666;
- }
- }
- .right {
- display: flex;
- align-items: center;
- font-size: 14px;
- span {
- margin-right: 10px;
- }
- }
- }
- .main {
- margin-top: 20px;
- display: flex;
- .rate-list {
- font-size: 14px;
- flex-shrink: 0;
- }
- .tag-list {
- margin-left: 30px;
- ::v-deep .el-tag {
- margin-right: 10px;
- margin-bottom: 10px;
- }
- }
- }
- .content {
- width: 400px;
- line-height: 20px;
- font-size: 14px;
- color: #333;
- margin-top: 10px;
- }
- .img-list {
- display: flex;
- flex-wrap: wrap;
- margin-top: 10px;
- width: 400px;
- ::v-deep .el-image {
- width: 100px;
- height: 100px;
- margin-right: 10px;
- margin-bottom: 10px;
- border: 1px solid #eaeaea;
- }
- }
- }
- </style>
|