Commit 7c7f5eed authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/dev' into dev

parents 4c879145 4e267028
...@@ -21,6 +21,7 @@ export function uploadFile(data) { ...@@ -21,6 +21,7 @@ export function uploadFile(data) {
return request({ return request({
url: '/infra/file/upload', url: '/infra/file/upload',
method: 'post', method: 'post',
timeout: 60000,
data: data data: data
}) })
} }
import request from '@/utils/request'
// 创建app版本管理
export function createVersion(data) {
return request({
url: '/system/version/create',
method: 'post',
data: data
})
}
// 更新app版本管理
export function updateVersion(data) {
return request({
url: '/system/version/update',
method: 'put',
data: data
})
}
// 删除app版本管理
export function deleteVersion(id) {
return request({
url: '/system/version/delete?id=' + id,
method: 'delete'
})
}
// 获得app版本管理
export function getVersion(id) {
return request({
url: '/system/version/get?id=' + id,
method: 'get'
})
}
// 获得app版本管理分页
export function getVersionPage(query) {
return request({
url: '/system/version/page',
method: 'get',
params: query
})
}
// 导出app版本管理 Excel
export function exportVersionExcel(query) {
return request({
url: '/system/version/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
...@@ -3560,5 +3560,31 @@ ...@@ -3560,5 +3560,31 @@
"渠道ID": "Channel ID", "渠道ID": "Channel ID",
"预计时间(天)": "Estimate Days", "预计时间(天)": "Estimate Days",
"注意:运费/清关费 方案二选一": "Note: choose one of the two freight/customs clearance schemes", "注意:运费/清关费 方案二选一": "Note: choose one of the two freight/customs clearance schemes",
"暂无优惠": "No discount" "暂无优惠": "No discount",
"客户跟进": "Customer follow-up",
"请选择跟进时间": "Please select the follow-up time",
"规则英文名称": "English name of the rule",
"请输入规则英文名称": "Please enter the English name of the rule",
"规则英文名称不能为空": "The English name of the rule cannot be empty",
"WEB端广告图片(建议尺寸长*宽": "WEB advertising image (recommended size: length * width",
"APP端广告图片(建议尺寸长*宽": "APP advertising image (recommended size: length * width",
"优惠券ID": "Coupon ID",
"发布人": "Publisher",
"更新人": "Updated by",
"是否确认删除优惠券信息编号为{couponId}的数据项?": "Are you sure to delete the data item with coupon information number {couponId}?",
"是否确认导出所有优惠券信息数据项?": "Are you sure to export all coupon information data items?",
"待回复": "To be replied",
"已回复": "Replied",
"确认修改": "Confirm modification",
"商标{index}分类": "Trademark {index} classification",
"请选择商标{index}分类": "Please select trademark {index} classification",
"商标{index}商品": "Trademark {index} commodity",
"请选择商标{index}商品": "Please select trademark {index} product",
"第{index}阶梯": "Step {index}",
"前端必须以 / 开头": "The front end must start with/",
"前端不能以 / 开头": "The front end cannot start with/",
"是否确认删除此项?": "Are you sure to delete this item?",
"父子联动": "Parent-child linkage",
"选中父节点,自动选择子节点": "Select the parent node and select the child node automatically",
"加载中,请稍后": "Loading, please wait"
} }
...@@ -67,7 +67,7 @@ export const DICT_TYPE = { ...@@ -67,7 +67,7 @@ export const DICT_TYPE = {
PAY_REFUND_ORDER_STATUS: 'pay_refund_order_status', // 退款订单状态 PAY_REFUND_ORDER_STATUS: 'pay_refund_order_status', // 退款订单状态
PAY_REFUND_ORDER_TYPE: 'pay_refund_order_type', // 退款订单类别 PAY_REFUND_ORDER_TYPE: 'pay_refund_order_type', // 退款订单类别
ECW_BANK_TYPE: 'bank_type', // 银行账号类型 ECW_BANK_TYPE: 'bank_type', // 银行账号类型
// ECW_DATA_SOURCE: 'data_source', // 数据来源 ECW_DATA_SOURCE: 'data_source', // 数据来源
ECW_REGION_TYPE: 'region_trade_type', // 区域类型 ECW_REGION_TYPE: 'region_trade_type', // 区域类型
ECW_TRANSPORT_TYPE: 'transport_type', //货运方式 ECW_TRANSPORT_TYPE: 'transport_type', //货运方式
ECW_CHARGE_TYPE: 'warehouse_charge_type', //仓储收费方式 ECW_CHARGE_TYPE: 'warehouse_charge_type', //仓储收费方式
...@@ -212,6 +212,8 @@ export const DICT_TYPE = { ...@@ -212,6 +212,8 @@ export const DICT_TYPE = {
BOX_CUSTOMS_ERROR_TYPE: "customs_error_type",// 报关异常状态 BOX_CUSTOMS_ERROR_TYPE: "customs_error_type",// 报关异常状态
BOX_SHIPPING_ERROR_TYPE: "shipping_error_type",// 起运异常状态 BOX_SHIPPING_ERROR_TYPE: "shipping_error_type",// 起运异常状态
BOX_ARRIVAL_ERROR_TYPE: "arrival_error_type",// 到港异常状态 BOX_ARRIVAL_ERROR_TYPE: "arrival_error_type",// 到港异常状态
APP_TYPE:"app_type", //系统类型
} }
/** /**
......
...@@ -38,7 +38,11 @@ ...@@ -38,7 +38,11 @@
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column :label="$t('主键')" align="center" prop="id" /> <el-table-column :label="$t('主键')" align="center" prop="id" />
<el-table-column :label="$t('规则名称')" align="center" prop="name" /> <el-table-column :label="$t('规则名称')" align="center" prop="name">
<template slot-scope="scope">
{{ isChinese ? scope.row.name : scope.row.nameEn }}
</template>
</el-table-column>
<el-table-column :label="$t('规则分类')" align="center" prop="type"> <el-table-column :label="$t('规则分类')" align="center" prop="type">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE" :value="scope.row.type" /> <dict-tag :type="DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE" :value="scope.row.type" />
...@@ -66,10 +70,13 @@ ...@@ -66,10 +70,13 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item :label="$t('规则名称')" prop="name"> <el-form-item :label="$t('规则名称')" prop="name">
<el-input v-model="form.name" :placeholder="$t('请输入规则名称')" /> <el-input v-model="form.name" :placeholder="$t('请输入规则名称')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('规则英文名称')" prop="nameEn">
<el-input v-model="form.nameEn" :placeholder="$t('请输入规则英文名称')" />
</el-form-item>
<el-form-item :label="$t('规则分类')" prop="type"> <el-form-item :label="$t('规则分类')" prop="type">
<el-select v-model="form.type" :placeholder="$t('请选择规则分类')"> <el-select v-model="form.type" :placeholder="$t('请选择规则分类')">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE)" <el-option v-for="dict in this.getDictDatas(DICT_TYPE.CUSTOMER_CREDIT_RULE_TYPE)"
...@@ -130,6 +137,7 @@ export default { ...@@ -130,6 +137,7 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
name: [{ required: true, message: this.$t('规则名称不能为空'), trigger: "blur" }], name: [{ required: true, message: this.$t('规则名称不能为空'), trigger: "blur" }],
nameEn: [{ required: true, message: this.$t('规则英文名称不能为空'), trigger: "blur" }],
type: [{ required: true, message: this.$t('规则分类不能为空'), trigger: "change" }], type: [{ required: true, message: this.$t('规则分类不能为空'), trigger: "change" }],
score: [{ required: true, message: this.$t('规则得分不能为空'), trigger: "blur" }], score: [{ required: true, message: this.$t('规则得分不能为空'), trigger: "blur" }],
} }
...@@ -244,6 +252,12 @@ export default { ...@@ -244,6 +252,12 @@ export default {
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
} }
},
computed: {
isChinese() {
return this.$i18n.locale === 'zh_CN'
},
} }
}; };
</script> </script>
...@@ -226,8 +226,12 @@ ...@@ -226,8 +226,12 @@
<el-table-column label=""> <el-table-column label="">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index+1}}. {{scope.$index+1}}.
<dict-tag :type="DICT_TYPE.ECW_COUPON_TYPE" :value="scope.row.type" /> {{getProductName(scope.row.prodId)}}
<!-- {{$l(productNames[scope.row.prodId], 'title') || $t('未知')}} --> </template>
</el-table-column>
<el-table-column label="">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_COUPON_TYPE" :value="row.type" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label=""> <el-table-column label="">
...@@ -418,6 +422,15 @@ ...@@ -418,6 +422,15 @@
}; };
}, },
computed:{ computed:{
// 根据id获取商品名称(显示优惠列表的时候用)
getProductName(){
return prodId => {
if(!this.list) return this.$t('未知')
let row = this.list.offerProdRespVOList.find(item => item.prodId == prodId)
if(!row) return this.$t('未知')
return this.$l(row, 'prodTitle')
}
},
currentcyMap(){ currentcyMap(){
let map = {} let map = {}
this.currencyList.forEach(item => { this.currencyList.forEach(item => {
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<br/> <br/>
<el-form-item :label="$t('订单类型')"> <el-form-item :label="$t('订单类型')" v-if="routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1">
<el-checkbox-group v-model="form.type"> <el-checkbox-group v-model="form.type">
<el-checkbox label="1">{{$t('集运服务')}}</el-checkbox> <el-checkbox label="1" v-if="routeOtherServices.indexOf('1') > -1">{{$t('集运服务')}}</el-checkbox>
<el-checkbox label="2">{{$t('海外仓')}}</el-checkbox> <el-checkbox label="2" v-if="routeOtherServices.indexOf('4') > -1">{{$t('海外仓')}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
...@@ -355,7 +355,7 @@ ...@@ -355,7 +355,7 @@
</el-table-column> </el-table-column>
<el-table-column label=""> <el-table-column label="">
<template slot-scope="{row}"> <template slot-scope="{row}">
-{{row.reduceTotalAmount}} -{{row.reduceAmount}}
{{currencyMap[row.reduceCurrencyId]}} {{currencyMap[row.reduceCurrencyId]}}
</template> </template>
</el-table-column> </el-table-column>
...@@ -678,6 +678,7 @@ export default { ...@@ -678,6 +678,7 @@ export default {
titleEn: it.titleEn, titleEn: it.titleEn,
endTime: it.endTime, endTime: it.endTime,
reduceTotalAmount: it.reduceTotalAmount, reduceTotalAmount: it.reduceTotalAmount,
reduceAmount: it.reduceAmount,
reduceCurrencyId: it.reduceCurrencyId reduceCurrencyId: it.reduceCurrencyId
}) })
} }
......
...@@ -109,6 +109,14 @@ ...@@ -109,6 +109,14 @@
</template> </template>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('订单类型')">
<el-tag v-if="order.type.indexOf('1') > -1">
{{ $t('集运服务') }}
</el-tag>
<el-tag v-if="order.type.indexOf('2') > -1">
{{ $t('海外仓') }}
</el-tag>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="card"> <el-card class="card">
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<el-card> <el-card>
<div slot="header" class="card-title">{{ editMode ? $t('编辑订单') + '-' + form.orderNo : $t('新建订单')}}</div> <div slot="header" class="card-title">{{ editMode ? $t('编辑订单') + '-' + form.orderNo : $t('新建订单')}}</div>
<!--默认显示类型(selectedRouter==null),如果选择路线后没开通则隐藏--> <!--默认显示类型(selectedRouter==null),如果选择路线后没开通则隐藏-->
<el-form-item :label="$t('订单类型')" v-if="!selectedRouter || routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1"> <el-form-item :label="$t('订单类型')" v-if="routeOtherServices.indexOf('1') > -1 || routeOtherServices.indexOf('4') > -1">
<el-checkbox-group v-model="form.type" :disabled="inWarehouse"> <el-checkbox-group v-model="form.type" :disabled="inWarehouse">
<el-checkbox label="1" v-if="!selectedRouter || routeOtherServices.indexOf('1') > -1">{{$t('集运服务')}}</el-checkbox> <el-checkbox label="1" v-if="routeOtherServices.indexOf('1') > -1">{{$t('集运服务')}}</el-checkbox>
<el-checkbox label="2" v-if="!selectedRouter || routeOtherServices.indexOf('2') > -1">{{$t('海外仓')}}</el-checkbox> <el-checkbox label="2" v-if="routeOtherServices.indexOf('4') > -1">{{$t('海外仓')}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
......
...@@ -495,7 +495,15 @@ export default { ...@@ -495,7 +495,15 @@ export default {
currencyList:[] currencyList:[]
}; };
}, },
watch:{
isChinese(){
this.getList()
}
},
computed: { computed: {
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
exportWarehouseList(){ exportWarehouseList(){
/* tradeType 1 进口,2出口,3进出口 */ /* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3) return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
......
<template> <template>
<div class="infoheader"> <div class="infoheader">
<el-collapse v-model="activeNames"> <el-collapse v-model="activeNames" @change="handleChange">
<div v-for="item in helpData" :key="item.id"> <div v-for="(item, index) in helpData" :key="item.id">
<el-collapse-item :title="item.titleZh" :name="item.id"> <el-collapse-item :title="(index + 1) + '. ' + (isChinese ? item.titleZh : item.titleEn)" :name="index">
<div v-html="item.contentZh" class="img">{{ item.contentZh }}</div> <div v-html="isChinese ? item.contentZh : item.contentEn" class="img"></div>
</el-collapse-item> </el-collapse-item>
</div> </div>
</el-collapse> </el-collapse>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</template> </template>
<script> <script>
import { getInternalHelpDocPage} from "@/api/system/internalHelpDoc"; import {getInternalHelpDoc, getInternalHelpDocPage} from "@/api/system/internalHelpDoc";
export default { export default {
data() { data() {
return { return {
...@@ -22,9 +22,23 @@ export default { ...@@ -22,9 +22,23 @@ export default {
created() { created() {
getInternalHelpDocPage({ pageNo: 1, pageSize: 100 }).then((r) => { getInternalHelpDocPage({ pageNo: 1, pageSize: 100 }).then((r) => {
this.helpData = r.data.list this.helpData = r.data.list
this.activeNames = this.helpData.map(m => { return m.id })
}) })
},
methods: {
handleChange(val) {
console.log(val)
if (val.length > 0 &&!this.helpData[val].contentZh && !this.helpData[val].contentEn){
getInternalHelpDoc(this.helpData[val].id).then(r => {
this.$set(this.helpData, val, r.data)
})
}
} }
},
computed:{
isChinese(){
return this.$i18n.locale === 'zh_CN'
}
},
} }
</script> </script>
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('系统类型')" prop="appType">
<el-select v-model="queryParams.appType" :placeholder="$t('请选择系统类型')" clearable="">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.ECW_DATA_SOURCE)" :key="type.value" :label="$l(type, 'label')" :value="type.value"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('强制更新')">
<el-select v-model="queryParams.forceUpdate" :placeholder="$t('请选择更新条件')" clearable="">
<el-option v-for="item in forceUpdateArray" :key="item.type" :label="$l(item, 'value')" :value="item.type"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('内部版本')" prop="versionCode">
<el-input v-model.number="queryParams.versionCode" :placeholder="$t('请输入内部版本')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:version:create']">新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['system:version:export']">导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="系统类型" align="center" prop="appType">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_DATA_SOURCE" :value="row.appType" />
</template>
</el-table-column>
<el-table-column label="版本号" align="center" prop="appVersion">
<template slot-scope="scope">
<el-link icon="el-icon-link" type="primary" :href="scope.row.appUrl">{{ scope.row.appVersion }}</el-link>
</template>
</el-table-column>
<el-table-column label="内部号" align="center" prop="versionCode" />
<el-table-column label="强制更新" align="center" prop="forceUpdate">
<template slot-scope="scope">
<span>{{ getName(scope.row.forceUpdate) }}</span>
</template>
</el-table-column>
<el-table-column label="说明" align="center" prop="desp" />
<el-table-column label="发布时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:version:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:version:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item :label="$t('系统')" prop="appType">
<el-select v-model="form.appType" :placeholder="$t('请选择系统类型')">
<el-option v-for="type in this.getDictDatas(DICT_TYPE.ECW_DATA_SOURCE)" :key="type.value" :label="type.label" :value="type.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('版本号')" prop="appVersion">
<el-input v-model="form.appVersion" :placeholder="$t('请输入版本号')" />
</el-form-item>
<el-form-item :label="$t('内部号')" prop="versionCode">
<el-input v-model.number="form.versionCode" :placeholder="$t('请输入内部号')" />
</el-form-item>
<el-form-item :label="$t('链接方式')">
<el-radio v-model="linkType" :label="1">链接</el-radio>
<el-radio v-model="linkType" :label="2">上传</el-radio>
</el-form-item>
<el-form-item v-if="linkType==2">
<el-upload action="#" :http-request="requestUpload" :show-file-list="true" :before-upload="beforeUpload">
<el-button size="small">{{ $t('上传') }}<i class="el-icon-upload el-icon--right"></i>
</el-button>
</el-upload>
</el-form-item>
<el-form-item :label="$t('版本链接')" prop="appUrl">
<el-input v-model="form.appUrl" :placeholder="$t('请输入版本链接')" :disabled="linkType==2"/>
</el-form-item>
<el-form-item :label="$t('强制更新')" prop="forceUpdate">
<el-select v-model="form.forceUpdate" :placeholder="$t('请选择更新条件')">
<el-option v-for="item in forceUpdateArray" :key="item.type" :label="$l(item, 'value')" :value="item.type"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('说明')" prop="desp">
<el-input type="textarea" v-model="form.desp" :placeholder="$t('请输入说明')" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{$t('确 定')}}</el-button>
<el-button @click="cancel">{{$t('取 消')}}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createVersion, updateVersion, deleteVersion, getVersion, getVersionPage, exportVersionExcel } from "@/api/system/version";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import { uploadFile } from "@/api/infra/file";
export default {
name: "Version",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// app版本管理列表
list: [],
linkType:1,
forceUpdateArray:[
{type:1, value:this.$t('')},
{type:0, value:this.$t('')}
],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeForceUpdate: [],
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
appUrl: null,
appType: null,
appVersion: null,
versionCode: null,
desp: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
appType: [{ required: true, message: this.$t("系统类型不能为空"), trigger: "change" }],
appVersion: [{ required: true, message: this.$t("版本号不能为空"), trigger: "blur" }],
versionCode: [{ required: true, message: this.$t("内部号不能为空"), trigger: "blur" }],
appUrl: [{ required: true, message: this.$t("版本链接不能为空"), trigger: "blur" }],
forceUpdate: [{ required: true, message: this.$t("强制更新不能为空"), trigger: "change" }],
}
};
},
computed: {
getName() {
return forceUpdate => {
for (let index in this.forceUpdateArray) {
let item = this.forceUpdateArray[index];
if (item.type == forceUpdate) {
return this.$l(item, 'value');
}
}
}
},
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeForceUpdate, 'forceUpdate');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getVersionPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.linkType = 1;
this.form = {
id: undefined,
appUrl: undefined,
appType: undefined,
appVersion: undefined,
versionCode: undefined,
forceUpdate: undefined,
desp: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeForceUpdate = [];
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
// console.log(this.form);
this.title = "添加app版本管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getVersion(id).then(response => {
this.form = response.data;
this.linkType = 1;
this.open = true;
this.title = "修改app版本管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 修改的提交
if (this.form.id != null) {
updateVersion(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createVersion(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除app版本管理编号为"' + id + '"的数据项?').then(function() {
return deleteVersion(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
// 覆盖默认的上传行为
requestUpload() {
},
// 上传预处理
beforeUpload(file) {
// if (file.type.indexOf("image/") == -1) {
// this.$modal.msgError(this.$t("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。"));
// } else {
//上传
let formData = new FormData();
// console.log(file);
formData.append("file", file);
formData.append("path", this.uuid() + "/" + file.name);
uploadFile(formData).then(response => {
this.$set(this.form, 'appUrl', response.data);
// this.form.img = response.data;
})
// }
},
uuid() {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeForceUpdate, 'forceUpdate');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm('是否确认导出所有app版本管理数据项?').then(() => {
this.exportLoading = true;
return exportVersionExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment