|
|
@@ -1,13 +1,412 @@
|
|
|
<template>
|
|
|
- <div>积分订单详情</div>
|
|
|
+ <div>
|
|
|
+ <basicDetails
|
|
|
+ ref="details"
|
|
|
+ :titleText="mainData.sonum"
|
|
|
+ :editData="mainData"
|
|
|
+ :mainAreaData="mainAreaData"
|
|
|
+ turnPageId="2026052510105106"
|
|
|
+ idName="sc_orderid"
|
|
|
+ ownertable="sc_order"
|
|
|
+ tags=""
|
|
|
+ :tabs="['商品明细','基本信息']"
|
|
|
+ :column="5"
|
|
|
+ @pageChange="pageChange"
|
|
|
+ @onEditSuccess="queryMainData($route.query.id)"
|
|
|
+ >
|
|
|
+ <div slot="tags"></div>
|
|
|
+ <template slot="customOperation">
|
|
|
+ <el-button v-if="tool.checkAuth($route.name, 'check')" :disabled="mainData.status !== '提交'" type="primary" size="mini" @click="onCheck">{{$t(`审 核`)}}</el-button>
|
|
|
+ <el-button v-if="tool.checkAuth($route.name, 'deliver')" type="primary" size="mini" @click="dialogVisible = true">{{$t(`发 货`)}}</el-button>
|
|
|
+ <el-button v-if="tool.checkAuth($route.name, 'close')" :disabled="mainData.status !== '审核'" style="margin-right:10px" type="primary" size="mini" @click="onClose">{{$t(`关 闭`)}}</el-button>
|
|
|
+ </template>
|
|
|
+ <template #headerBottom>
|
|
|
+ <div style="display:flex">
|
|
|
+ <div class="address_info">
|
|
|
+ <div class="reveive__panel inline-16">
|
|
|
+ <div>
|
|
|
+ <p class="normal-title" style="margin-bottom:10px;display:inline-block">{{$t(`收货信息`)}}<el-button type="text" size="small" style="margin-left:10px" @click="openAddressDialog">{{$t(`修改地址`)}}</el-button></p>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <p class="inline-16"><b>{{mainData.name}}</b></p>
|
|
|
+ <p class="inline-16"><span class="inline-16"><b>{{mainData.phonenumber}}</b></span></p>
|
|
|
+ </div>
|
|
|
+ <small>{{mainData.address?mainData.address:'--'}}</small>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div slot="slot1">
|
|
|
+ <div class="normal-margin">
|
|
|
+ <el-descriptions
|
|
|
+ :column="2"
|
|
|
+ :title="$t('收货信息')"
|
|
|
+ labelClassName="my-label"
|
|
|
+ contentClassName="my-content"
|
|
|
+ border
|
|
|
+ >
|
|
|
+ <el-descriptions-item
|
|
|
+ v-for="(item, index) in detailInfo.baseInfo"
|
|
|
+ :key="index"
|
|
|
+ :label="$t(item.label)"
|
|
|
+ >
|
|
|
+ <span :style="item.style ? item.style() : ''">{{
|
|
|
+ item.value ? $t(item.value) : '--'
|
|
|
+ }}</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </div>
|
|
|
+ <div class="normal-margin">
|
|
|
+ <el-descriptions
|
|
|
+ :column="3"
|
|
|
+ :title="$t('系统信息')"
|
|
|
+ labelClassName="my-label"
|
|
|
+ contentClassName="my-content"
|
|
|
+ border
|
|
|
+ >
|
|
|
+ <el-descriptions-item
|
|
|
+ v-for="(item, index) in detailInfo.systemInfo"
|
|
|
+ :key="index"
|
|
|
+ :label="$t(item.label)"
|
|
|
+ >
|
|
|
+ {{ item.value ? $t(item.value) : '--' }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div slot="slot0">
|
|
|
+ <el-table :data="mainData.items" border size="small">
|
|
|
+ <el-table-column v-for="(col,index) in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" ></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </basicDetails>
|
|
|
+ <el-dialog append-to-body :title="$t(`填写物流单号`)" :visible.sync="dialogVisible" width="400px">
|
|
|
+ <el-form label-width="80px">
|
|
|
+ <el-form-item :label="$t(`物流单号`)">
|
|
|
+ <el-input v-model="logisticno" :placeholder="$t(`请输入物流单号`)" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false" size="small">{{$t('取 消')}}</el-button>
|
|
|
+ <el-button type="primary" @click="onDeliver" size="small">{{$t('确 定')}}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog append-to-body :title="$t(`选择收货地址`)" :visible.sync="addressDialogVisible" width="900px">
|
|
|
+ <el-table :data="addressList" border size="small">
|
|
|
+ <el-table-column prop="name" :label="$t(`收货人`)"></el-table-column>
|
|
|
+ <el-table-column prop="phonenumber" :label="$t(`手机号`)"></el-table-column>
|
|
|
+ <el-table-column prop="address" :label="$t(`收货地址`)"></el-table-column>
|
|
|
+ <el-table-column :label="$t(`操作`)" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" size="small" @click.stop="openEditAddressDialog(scope.row)">{{$t(`修改`)}}</el-button>
|
|
|
+ <el-button type="text" size="small" @click.stop="confirmAddress(scope.row)">{{$t(`选择`)}}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog append-to-body :title="$t(`修改收货地址`)" :visible.sync="editAddressDialogVisible" width="600px">
|
|
|
+ <el-form :model="editAddressForm" label-width="100px">
|
|
|
+ <el-form-item :label="$t(`收货人`)">
|
|
|
+ <el-input v-model="editAddressForm.name" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`手机号`)">
|
|
|
+ <el-input v-model="editAddressForm.phonenumber" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`省市县`)">
|
|
|
+ <el-cascader
|
|
|
+ :placeholder="$t('请选择')"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="editAddressForm.province"
|
|
|
+ :options="basicData.data().areaData"
|
|
|
+ @change="cascaderChange"
|
|
|
+ clearable
|
|
|
+ ></el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`详细地址`)">
|
|
|
+ <el-input v-model="editAddressForm.address" type="textarea" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`是否默认`)">
|
|
|
+ <el-radio-group v-model="editAddressForm.isdefault">
|
|
|
+ <el-radio :label="1">{{$t(`是`)}}</el-radio>
|
|
|
+ <el-radio :label="0">{{$t(`否`)}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="editAddressDialogVisible = false" size="small">{{$t('取 消')}}</el-button>
|
|
|
+ <el-button type="primary" @click="onEditAddress" size="small">{{$t('确 定')}}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
+ name: "detail",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ mainData: {},
|
|
|
+ mainAreaData: {},
|
|
|
+ detailInfo: "",
|
|
|
+ logisticno: "",
|
|
|
+ dialogVisible: false,
|
|
|
+ layout:[],
|
|
|
+ addressDialogVisible: false,
|
|
|
+ addressList: [],
|
|
|
+ editAddressDialogVisible: false,
|
|
|
+ editAddressForm: {
|
|
|
+ contactsid: '',
|
|
|
+ name: '',
|
|
|
+ phonenumber: '',
|
|
|
+ province: [],
|
|
|
+ city: '',
|
|
|
+ county: '',
|
|
|
+ address: '',
|
|
|
+ isdefault: 0
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {},
|
|
|
+ methods: {
|
|
|
+ async queryMainData() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 2026052510105106,
|
|
|
+ content: {
|
|
|
+ nocache: true,
|
|
|
+ sc_orderid: this.$route.query.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.mainData = res.data;
|
|
|
+ this.changeDataStructure();
|
|
|
+ console.log("this.mainData", this.mainData);
|
|
|
+ },
|
|
|
+ changeDataStructure() {
|
|
|
+ this.mainAreaData = [
|
|
|
+ {
|
|
|
+ label: "订单号",
|
|
|
+ value: this.mainData.sonum,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "订单状态",
|
|
|
+ value: this.mainData.status,
|
|
|
+ style: () => {
|
|
|
+ let color = this.tool.getStatusColor(this.mainData.status, true);
|
|
|
+ return { color: color };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "订单类型",
|
|
|
+ value: this.mainData.type,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "创建时间",
|
|
|
+ value: this.mainData.createdate,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "购买者",
|
|
|
+ value: this.mainData.submitby,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "总积分",
|
|
|
+ value: this.mainData.totalpoints,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "总数量",
|
|
|
+ value: this.mainData.totalqty,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核时间",
|
|
|
+ value: this.mainData.checkdate,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "物流单号",
|
|
|
+ value: this.mainData.logisticno,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ value: this.mainData.remark,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.detailInfo = {
|
|
|
+ baseInfo: [
|
|
|
+ {
|
|
|
+ label: "客户姓名",
|
|
|
+ value: this.mainData.name,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户电话",
|
|
|
+ value: this.mainData.phone,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "收货地址",
|
|
|
+ value: this.mainData.address,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ systemInfo: [
|
|
|
+ { label: "创建人", value: this.mainData.createby },
|
|
|
+ { label: "创建时间", value: this.mainData.createdate },
|
|
|
+ { label: "提交人", value: this.mainData.submitby },
|
|
|
+ { label: "提交时间", value: this.mainData.submitdate },
|
|
|
+ { label: "审核人", value: this.mainData.checkby },
|
|
|
+ { label: "审核时间", value: this.mainData.checkdate },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ pageChange(id, rowindex, tabIndex) {
|
|
|
+ this.flag = false;
|
|
|
+ tabIndex = this.$route.query.tabIndex;
|
|
|
+ this.$router.replace({
|
|
|
+ path: "/pointsbasedorderDetail",
|
|
|
+ query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
|
|
|
+ });
|
|
|
+ this.queryMainData(id);
|
|
|
+ },
|
|
|
+ async onCheck() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 2026052510105406,
|
|
|
+ content: {
|
|
|
+ sc_orderid: this.$route.query.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.queryMainData();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async onClose() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 2026052510105506,
|
|
|
+ content: {
|
|
|
+ sc_orderid: this.$route.query.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.queryMainData();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async onDeliver() {
|
|
|
+ if (!this.logisticno) {
|
|
|
+ this.$message.error(this.$t("请输入物流单号"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 2026052510105306,
|
|
|
+ content: {
|
|
|
+ sc_orderid: this.$route.query.id,
|
|
|
+ logisticno: this.logisticno,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.logisticno = "";
|
|
|
+ this.queryMainData();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async openAddressDialog() {
|
|
|
+ this.addressDialogVisible = true;
|
|
|
+ await this.queryAddressList();
|
|
|
+ },
|
|
|
+ async queryAddressList() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "20221022165503",
|
|
|
+ content: {
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 99999,
|
|
|
+ where: {
|
|
|
+ createuserid: this.mainData.userid
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.addressList = res.data || [];
|
|
|
+ },
|
|
|
+ selectAddress(row) {
|
|
|
+ this.confirmAddress(row);
|
|
|
+ },
|
|
|
+ openEditAddressDialog(row) {
|
|
|
+ const province = row.province || '';
|
|
|
+ const city = row.city || '';
|
|
|
+ const county = row.county || '';
|
|
|
+ this.editAddressForm = {
|
|
|
+ contactsid: row.contactsid,
|
|
|
+ name: row.name,
|
|
|
+ phonenumber: row.phonenumber,
|
|
|
+ province: province ? [province, city, county] : [],
|
|
|
+ city: city,
|
|
|
+ county: county,
|
|
|
+ address: row.address,
|
|
|
+ isdefault: row.isdefault
|
|
|
+ };
|
|
|
+ this.editAddressDialogVisible = true;
|
|
|
+ },
|
|
|
+ cascaderChange(val) {
|
|
|
+ this.editAddressForm.province = val;
|
|
|
+ },
|
|
|
+ async onEditAddress() {
|
|
|
+ const province = this.editAddressForm.province[0] || '';
|
|
|
+ const city = this.editAddressForm.province[1] || '';
|
|
|
+ const county = this.editAddressForm.province[2] || '';
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 20221018141802,
|
|
|
+ content: {
|
|
|
+ contactsid: this.editAddressForm.contactsid,
|
|
|
+ address: this.editAddressForm.address,
|
|
|
+ name: this.editAddressForm.name,
|
|
|
+ phonenumber: this.editAddressForm.phonenumber,
|
|
|
+ province: province,
|
|
|
+ city: city,
|
|
|
+ county: county,
|
|
|
+ isdefault: this.editAddressForm.isdefault
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.editAddressDialogVisible = false;
|
|
|
+ this.queryAddressList();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async confirmAddress(row) {
|
|
|
+ this.mainData.name = row.name;
|
|
|
+ this.mainData.phonenumber = row.phonenumber;
|
|
|
+ this.mainData.address = row.address;
|
|
|
+ this.addressDialogVisible = false;
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: 2026052510105206,
|
|
|
+ content: {
|
|
|
+ sc_orderid: this.$route.query.id,
|
|
|
+ rec_contactsid: row.contactsid,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.tool.showMessage(res, () => {
|
|
|
+ this.queryMainData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.queryMainData(this.$route.query.id);
|
|
|
+ this.layout = this.tool.tabelCol(this.$route.name)['mxTable'].tablecols;
|
|
|
+ this.basicData.arealist();
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+};
|
|
|
+</script>
|
|
|
|
|
|
+<style scoped>
|
|
|
+.reveive__panel{
|
|
|
+ font-size: 16px;
|
|
|
+ line-height: 30px;
|
|
|
+ padding: 0 10px;
|
|
|
+ margin-top:10px;
|
|
|
+ background: #d9ecff;
|
|
|
+ border: 1px dashed #0676e7;
|
|
|
}
|
|
|
-</script>
|
|
|
|
|
|
-<style>
|
|
|
+.reveive__panel{
|
|
|
+ min-width:400px;
|
|
|
+}
|
|
|
|
|
|
+.address_info small{
|
|
|
+ color:#888
|
|
|
+}
|
|
|
+.normal-title{
|
|
|
+ display: flex !important;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
</style>
|