Commit 51b882e7 by wangzhihui

Merge branch 'SAAS+V5.8.0' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.8.0
2 parents 6f9abed6 eed592e0
......@@ -97,7 +97,7 @@ export function storeApprovePageQuery(data) {
export function storeApproveCreateDraft(data) {
data.method = "dj.api.oaapproval.store.approve.createDraft";
return request(data, "post");
return request(data, "post", ["file"]);
}
/**
*查询门店上架审批单详情
......@@ -124,3 +124,19 @@ export function storeApproveReSubmit(data) {
data.method = "dj.api.oaapproval.store.approve.reSubmit";
return request(data, "post");
}
/**
* 查询销售范围类型列表
*/
export function queryProductTypes (data = {}) {
data.method = "dj.api.oaapproval.store.approve.queryProductTypes";
return request(data, "post");
}
/**
* 查询销售品类列表
*/
export function queryProductCategories (data = {}) {
data.method = "dj.api.oaapproval.store.approve.queryProductCategories";
return request(data, "post");
}
......@@ -7,7 +7,6 @@
btn-ok-label="下载"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm">
<!-- <el-button v-if="isTmpl" slot="btn-end" type="primary" @click="handleSystemBill" :loading="$store.state.d2admin.loading.value">系统对账</el-button> -->
<el-form ref="accountForm"
v-loading="loading"
:model="infoForm"
......
......@@ -7,7 +7,7 @@
btn-ok-label="系统对账"
@closeDialog="handleClose"
@confirmDialog="handleSystemBill">
<!-- <el-button v-if="isTmpl" slot="btn-end" type="primary" @click="handleSystemBill" :loading="$store.state.d2admin.loading.value">系统对账</el-button> -->
<el-form ref="accountForm"
v-loading="loading"
:model="infoForm"
......@@ -34,21 +34,6 @@
</el-radio> -->
</el-radio-group>
</el-form-item>
<el-form-item v-if="infoForm.merchantType == '7'"
label="账单类型:"
prop="reportType">
<el-radio-group v-model="infoForm.reportType" @change="judgeTmpl">
<el-radio label="1">
普通对账单
</el-radio>
<el-radio label="2">
安装费对账单
</el-radio>
<el-radio label="3">
营销费对账单
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="对账商户:" prop="merchant">
<el-select v-model="infoForm.merchant"
filterable
......@@ -60,7 +45,7 @@
:value="item.merchantId" />
</el-select>
</el-form-item>
<el-form-item v-if="isTmpl && infoForm.merchantType == '7'"
<el-form-item v-if="isTmpl && infoForm.merchantType === '7'"
label="流量方:"
prop="shopMerchantId">
<el-select v-model="infoForm.shopMerchantId" style="width:400px">
......@@ -234,7 +219,6 @@ export default {
merchant: "",
payStartDate: "",
payEndDate: "",
reportType: "1",
shopMerchantId: "",
businessLine: "",
reconciliationStatus: "all",
......@@ -403,7 +387,7 @@ export default {
/**
* 商户类型 - 商户类型value - 是否有模版
* 流量方 - 2 - 是
* 服务商 - 7 - 仅“服务商对账单”(reportType = 4)时,是有模版
* 其他商户类型 - 否
* 园区店 - 6 - 否
*/
judgeTmpl() {
......@@ -568,12 +552,11 @@ export default {
params[merchantId] = item.merchantId;
});
params.merchantType = infoForm.merchantType;
if (infoForm.merchantType == "7") {
params.reportType = infoForm.reportType;
}
params.sceneType = infoForm.sceneType;
// 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus);
if (infoForm.reconciliationStatus !== "all") {
params.reconciliationStatus = infoForm.reconciliationStatus;
}
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
if (infoForm.shopMerchantId) {
params.shopMerchantId = infoForm.shopMerchantId;
......
......@@ -78,11 +78,13 @@
>查看</el-button>
<!--👇 仅系统状态=“草稿”的记录可操作 -->
<el-button
v-if="scope.scope.systemStatus == 1"
type="text"
@click="handleEdit(scope.scope)"
>编辑</el-button>
<!--👇 仅审批状态=“已驳回”“已撤销”“通过后撤销”的记录可操作 -->
<el-button
v-if="[3,4,5].includes(scope.scope.approveStatus)"
type="text"
@click="handleEdit(scope.scope,'reapply')"
>重新发起</el-button>
......@@ -106,6 +108,9 @@ import {
LISTING_TYPE_OPTIONS
} from './constant'
import { storeApprovePageQuery } from '@/api/salesManagement.js'
import {
getStaffSceneLabelList,
} from "@api/resident";
export default {
name: 'availableInStores',
components: {
......@@ -185,8 +190,8 @@ export default {
name: 'baseSceneCode',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionId: 'baseSceneCode',
optionLabel: 'name',
optionsName: 'businessSceneOptions'
}
],
......@@ -201,18 +206,17 @@ export default {
tableColumns: [
{
label: '单据编码',
prop: 'businessCode'
prop: 'businessCode',
minWidth: 120,
},
{
label: '上架类型',
prop: 'shelfTypeName',
// formatter: (cellValue) => {
// return deepClone(LISTING_TYPE_OPTIONS.find(item => item.id == cellValue.shelfType)?.label);
// },
},
{
label: '业务场景',
prop: 'sceneTypeName',
minWidth: 120,
},
{
label: '流量方信息',
......@@ -222,13 +226,12 @@ export default {
{
label: '审批类型',
prop: 'approveTypeName',
// formatter: (cellValue) => {
// return deepClone(APPROVAL_TYPE_OPTIONS.find(item => item.id == cellValue.approveType)?.label);
// },
minWidth: 120,
},
{
label: '审批编码',
prop: 'workWechatCode',
minWidth: 120,
},
{
label: '提交时间',
......@@ -241,15 +244,12 @@ export default {
{
label: '系统状态',
prop: 'systemStatusName',
// formatter: (cellValue) => {
// return deepClone(SYSTEM_STATUS_OPTIONS.find(item => item.id == cellValue.systemStatus)?.label);
// },
},
{
label: '审批状态',
prop: 'approveStatus',
formatter: (cellValue) => {
return deepClone(approveStatusOpt.find(item => item.confId == cellValue.approveStatus)?.confValue);
return deepClone(approveStatusOpt.find(item => item.confId == cellValue.approveStatus)?.confValue) || '-';
},
className: (cellValue) => {
return {
......@@ -278,16 +278,23 @@ export default {
},
mounted () {
this.getBaseData()
this.getStaffSceneLabelList()
},
methods: {
getBaseData () {
getStaffSceneLabelList () {
getStaffSceneLabelList().then(res => {
this.getBaseData('businessSceneOptions', res)
})
},
getBaseData (key, val) {
this.baseData = {
approvalTypeOptions: deepClone(APPROVAL_TYPE_OPTIONS),
systemStatusOptions: deepClone(SYSTEM_STATUS_OPTIONS),
approveStatusOpt: deepClone(approveStatusOpt),
listingTypeOptions: deepClone(LISTING_TYPE_OPTIONS)
listingTypeOptions: deepClone(LISTING_TYPE_OPTIONS),
businessSceneOptions: deepClone(val)
}
this.showFormData.forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]) {
......@@ -325,18 +332,22 @@ export default {
})
},
// 根据审批类型跳转到对应页面
navigateToApprovalPage (query) {
navigateToApprovalPage (params) {
const routeMap = {
1: 'tigaListingAndSalesContract',
2: 'addAndModifyTheListing'
}
const routeName = routeMap[query.approveType]
const routeName = routeMap[params.approveType]
if (!routeName) {
this.$message.warning('未知的审批类型')
return
}
const query = {
approveType: params.approveType
}
if (params.businessCode) query.businessCode = params.businessCode
if (params.pageType) query.pageType = params.pageType
this.$router.push({
name: routeName,
query
......
......@@ -149,10 +149,10 @@
:style="{ width: '530px' }"
>
<el-option
v-for="subItem in options.sceneType"
:key="subItem.confId"
:label="subItem.confValue"
:value="subItem.confId"
v-for="subItem in options.sceneTypeOpts"
:key="subItem.sceneType"
:label="subItem.name"
:value="subItem.sceneType"
>
</el-option>
</el-select>
......@@ -271,7 +271,9 @@ import GlOssApi from "glsk-oss-jssdk";
import { mapActions, mapState } from "vuex";
import { getMerchantPage } from "@api/shelfManage.js";
import { baseConfig } from "@/main";
import {
getStaffSceneLabelList,
} from "@api/resident";
export default {
name: 'StepOne',
components: {
......@@ -300,19 +302,25 @@ export default {
merchantId: "", // 4s店商户号,
shelfType: 1, // 上架类型:1-单店模式 2-项目制批量上架
sceneType: 1,
baseSceneCode: ''
},
uploadKey: Date.now(),
options: {
merchant: [],
shelfType: shelfTypeOpt,
sceneType: [
{ confId: 1, confValue: "精品升级" },
{ confId: 0, confValue: "会员权益升级" },
]
sceneTypeOpts: []
},
}
},
watch: {
'infoForm.sceneType': {
handler (val) {
this.infoForm.baseSceneCode = this.options.sceneTypeOpts.find(item => item.sceneType == val)?.baseSceneCode || ''
},
immediate: true,
deep: true,
}
},
computed: {
rules () {
let { templateInfo } = this,
......@@ -367,8 +375,12 @@ export default {
formRef () {
return this.$refs.formRef
},
sceneTypeName () {
return this.options.sceneTypeOpts.find(item => item.sceneType == this.infoForm.sceneType)?.name || ''
}
},
mounted () {
this.getStaffSceneLabelList();
this.GlOssApi = new GlOssApi({
baseConfig,
});
......@@ -376,6 +388,10 @@ export default {
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
...mapActions({ close: "d2admin/page/close" }),
async getStaffSceneLabelList () {
const res = await getStaffSceneLabelList();
this.options.sceneTypeOpts = res;
},
handleFileChange (file, fileList, targetItem) {
// return false
// // setTimeout(() => {
......
<template>
<div class="business-information-container">
<div class="business-information-content">
<template v-for="(i,index) in businessInformation">
<el-form-item
class="business-information-item"
:label="i.label + ':'"
:key="index"
>
<template v-if="i.type == 'text' || isViewMode">{{ data[i.key] || '-' }}</template>
<template v-else>
<el-input
v-model="data[i.key]"
@input="filterInputVal(i,$event,'data')"
:maxlength="i.maxlength || -1"
></el-input>
</template>
</el-form-item>
</template>
</div>
<el-form
ref="formRef"
label-width="150px"
:model="componentData"
:size="size"
:rules="rules"
>
<div class="business-information-content">
<template v-for="(i,index) in fixedInfo">
<el-form-item
class="business-information-item"
:label="i.label + ':'"
:key="`fixedInfo${index}`"
>
{{ getData(i.key) || '-' }}
</el-form-item>
</template>
<template v-for="(i,index) in businessInformation">
<el-form-item
class="business-information-item"
:label="i.label + ':'"
:key="`businessInformation${index}`"
:prop="i.key"
>
<template v-if="i.type == 'text' || isViewMode">{{ componentData[i.key] || '-' }}</template>
<template v-else>
<el-input
v-model="componentData[i.key]"
@input="filterInputVal(i,$event,'data')"
:maxlength="i.maxlength || -1"
></el-input>
</template>
</el-form-item>
</template>
</div>
</el-form>
</div>
</template>
<script type='text/ecmascript-6'>
import { deepClone } from '@/common/util'
import { isView } from '@/views/goods/shelfManage/utils';
import componentsMixin from './mixins.js';
export default {
......@@ -37,25 +58,60 @@ export default {
default: false
}
},
inject: ['size'],
watch: {
data: {
handler (newVal) {
this.componentData = deepClone(newVal)
},
deep: true,
immediate: true
}
},
computed: {
formRef () {
return this.$refs.formRef
},
djGrossProfit () {
return 123
},
djGpr () {
return 1
}
},
data () {
return {
componentData: {},
fixedInfo: [
{ label: '嘀加毛利', key: 'djGrossProfit', type: 'text' },
{ label: '嘀加毛利率', key: 'djGpr', type: 'text' },
],
businessInformation: [
{ label: '嘀加毛利', key: 'b-a', type: 'text' },
{ label: '嘀加毛利率', key: 'b-b', type: 'text' },
{ label: '预估交付数/月', key: 'b-c', filterRule: 'integerRange', min: 0, max: 999999, maxlength: 6 },
{ label: '预估触客率', key: 'b-d', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '预估交付数/月', key: 'deliveryCount', filterRule: 'integerRange', min: 0, max: 999999, maxlength: 6 },
{ label: '预估触客率', key: 'customerTouchRate', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '人员成本', key: 'personnelCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '房租', key: 'rentCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '折旧与摊销', key: 'depreciationCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '其他(水电、耗材等)', key: 'otherCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '门店单台利润额', key: 'b-j', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
]
{ label: '门店单台利润额', key: 'storeProfitPerCar', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
],
rules: {
deliveryCount: [{ required: true, message: '请输入预估交付数/月', trigger: 'blur' }],
customerTouchRate: [{ required: true, message: '请输入预估触客率', trigger: 'blur' }],
personnelCost: [{ required: true, message: '请输入人员成本', trigger: 'blur' }],
rentCost: [{ required: true, message: '请输入房租', trigger: 'blur' }],
depreciationCost: [{ required: true, message: '请输入折旧与摊销', trigger: 'blur' }],
otherCost: [{ required: true, message: '请输入其他(水电、耗材等)', trigger: 'blur' }],
storeProfitPerCar: [{ required: true, message: '请输入门店单台利润额', trigger: 'blur' }]
}
}
},
mounted () {
},
methods: {
getData (key) {
return this[key]
}
}
}
......
......@@ -53,6 +53,7 @@
v-model="data[i.key]"
:placeholder="`请选择${i.label}`"
class="select"
:disabled="setDisabled(i)"
>
<el-option
v-for="option in i.options"
......@@ -92,21 +93,12 @@
<script type='text/ecmascript-6'>
import data from '@/views/stockManage/returnManage/constant/data';
import { SALES_CATEGORY_LIST } from './constant'
import { SALES_CATEGORY_LIST, SALES_CATEGORY_RULES } from './constant'
import componentsMixin from './mixins.js';
import { queryProductTypes, queryProductCategories } from '@/api/salesManagement.js'
import { deepClone } from '@/common/util'
const validatorFrom = (rule, value, callback) => {
let { field, required } = rule,
list = [],
label = ''
SALES_CATEGORY_LIST.map(i => {
if (i.list) list.push(...i.list)
})
label = list.find(i => i.key === field)?.label || ''
if (required && (value == null || value == '' || value == undefined)) callback(new Error(`${label}不能为空`))
else callback()
}
export default {
mixins: [componentsMixin],
name: 'SalesCategoryDetail',
......@@ -120,34 +112,15 @@ export default {
default: () => ({})
},
},
inject: ['GET_BASE_SCENE_CODE'],
data () {
return {
salesCategoryList: deepClone(SALES_CATEGORY_LIST),
size: 'small',
viewKey: Date.now(),
detailInfo: {
},
loading: false,
data: {},
rules: {
productType: [{ required: true, validator: validatorFrom }],
productCategory: [{ required: true, validator: validatorFrom }],
feeSettlementMode: [{ required: true, validator: validatorFrom }],
penetrationRate: [{ required: true, validator: validatorFrom }],
conversionRate: [{ required: true, validator: validatorFrom }],
revenuePerCar: [{ required: true, validator: validatorFrom }],
g: [{ required: true, validator: validatorFrom }],
upgradePrice: [{ required: true, validator: validatorFrom }],
revenue: [{ required: true, validator: validatorFrom }],
trafficFee: [{ required: true, validator: validatorFrom }],
marketFee1: [{ required: true, validator: validatorFrom }],
marketFee2: [{ required: true, validator: validatorFrom }],
incentive1: [{ required: true, validator: validatorFrom }],
incentive2: [{ required: true, validator: validatorFrom }],
resourceFee: [{ required: true, validator: validatorFrom }],
productCost: [{ required: true, validator: validatorFrom }],
recyclingFilm: [{ required: true, validator: validatorFrom }],
}
rules: SALES_CATEGORY_RULES
}
},
computed: {
......@@ -159,6 +132,9 @@ export default {
this.close()
}
},
baseSceneCode () {
return this.GET_BASE_SCENE_CODE()
},
},
watch: {
dialogShow: {
......@@ -168,14 +144,41 @@ export default {
immediate: true,
deep: true
},
'data.productType': {
handler (val) {
if (val) {
this.queryProductCategories()
}
},
immediate: true,
deep: true
},
item: {
handler (val) {
this.data = val
},
immediate: true,
deep: true
},
},
mounted () {
},
methods: {
init () {
this.queryProductTypes()
// this.loading = true
this.viewKey = Date.now()
},
async queryProductTypes () {
const { items } = await queryProductTypes({ baseSceneCode: this.baseSceneCode })
this.salesCategoryList[0].list[0].options = items.map(i => ({ label: i, value: i }))
},
async queryProductCategories () {
const { items } = await queryProductCategories({ baseSceneCode: this.baseSceneCode, productType: this.data.productType })
this.salesCategoryList[0].list[1].options = items.map(i => ({ label: i, value: i }))
if (this.data.productCategory && !items.includes(this.data.productCategory)) this.data.productCategory = ''
},
close () {
this.$emit('update:dialogVisible', false)
},
......@@ -186,6 +189,13 @@ export default {
}
})
},
setDisabled (i) {
let flag = false
if (i.key == 'productCategory') {
flag = !this.data.productType
}
return flag
}
}
}
</script>
......
......@@ -12,68 +12,88 @@
:size="size"
plain
type="info"
v-if=""
v-if="length > 1"
>删除</el-button>
</div>
<template v-for="(item,index) in salesCategoryList">
<div
class="sales-category-item-box"
:key="index"
>
<div class="sub-title">{{ item.title }}</div>
<div class="sales-category-content">
<template v-for="(i,ind) in item.list">
<el-form-item
class="sales-category-item"
:label="i.label + ':'"
:key="ind"
>
{{ componentData[i.key] || '-' }}
<el-form
ref="formRef"
label-width="150px"
:model="componentData"
:size="size"
:rules="rules"
>
<template v-for="(item,index) in salesCategoryList">
<div
class="sales-category-item-box"
:key="index"
>
<div class="sub-title">{{ item.title }}</div>
<div class="sales-category-content">
<template v-for="(i,ind) in item.list">
<el-form-item
class="sales-category-item"
:label="i.label + ':'"
:key="ind"
:prop="i.key"
>
{{ componentData[i.key] != null ? componentData[i.key] : '-' }}
</el-form-item>
</template>
</el-form-item>
</template>
</div>
</div>
</div>
</template>
<SalesCategoryDetail
</template>
</el-form>
<EditSalesCategory
:dialogVisible.sync="salesCategoryDetailVisible"
:item="currentItem"
@submit="handleEditSalesCategory"
/>
</div>
</template>
<script type='text/ecmascript-6'>
import { deepClone } from '@/common/util'
import { SALES_CATEGORY_LIST } from './constant'
import SalesCategoryDetail from './SalesCategoryDetail.vue'
import { SALES_CATEGORY_LIST, SALES_CATEGORY_RULES } from './constant'
import EditSalesCategory from './EditSalesCategory.vue'
export default {
name: 'SalesCategory',
components: { SalesCategoryDetail },
components: { EditSalesCategory },
props: {
data: {
type: Object,
default: () => ({})
}
},
length: {
type: Number,
default: 0
},
},
inject: ['size'],
watch: {
data: {
handler (newVal) {
console.log(newVal, '===')
this.componentData = deepClone(newVal)
},
deep: true,
immediate: true
}
},
computed: {
formRef () {
return this.$refs.formRef
},
},
data () {
return {
componentData: {},
editStatus: false,
salesCategoryList: deepClone(SALES_CATEGORY_LIST),
salesCategoryDetailVisible: false,
currentItem: {}
currentItem: {},
rules: SALES_CATEGORY_RULES
}
},
mounted () {
......@@ -91,7 +111,33 @@ export default {
this.salesCategoryDetailVisible = true
},
deleteSalesCategory () {
this.$confirm("删除后不可恢复,是否确定删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
}).then(async () => {
this.$emit('delete', this.data)
// const data = await deleteStrategy({
// id: item.id
// })
// if (data) {
// this.$emit('refresh')
// this.$message.success('操作成功')
// this.close()
// } else this.$message.error('操作失败')
})
},
handleEditSalesCategory (data) {
console.log(data)
if (data.edit) {
delete data.edit
this.$emit('edit', data)
this.salesCategoryDetailVisible = false
} else {
this.$emit('add', data)
this.salesCategoryDetailVisible = false
}
}
}
}
......
......@@ -5,9 +5,9 @@ const SALES_CATEGORY_LIST = [
{ label: '销售品类', key: 'productCategory', type: 'select', options: [] },
{
label: '流量费结算模式', key: 'feeSettlementMode', type: 'select', options: [
{ label: '按信息量', value: '1' },
{ label: '按有效流量', value: '2' },
{ label: '按销售额', value: '3' },
{ label: '按信息量', value: '按信息量' },
{ label: '按有效流量', value: '按有效流量' },
{ label: '按销售额', value: '按销售额' },
]
},
]
......@@ -43,5 +43,34 @@ const SALES_CATEGORY_LIST = [
]
},
]
module.exports = { SALES_CATEGORY_LIST }
const VAILIDATOR_FROM = (rule, value, callback) => {
let { field, required } = rule,
list = [],
label = ''
SALES_CATEGORY_LIST.map(i => {
if (i.list) list.push(...i.list)
})
label = list.find(i => i.key === field)?.label || ''
if (required && (value === null || value === '' || value === undefined)) callback(new Error(`${label}不能为空`))
else callback()
}
const SALES_CATEGORY_RULES = {
productType: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'change' }],
productCategory: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'change' }],
feeSettlementMode: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
penetrationRate: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
conversionRate: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
revenuePerCar: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
conversionRate: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
upgradePrice: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
revenue: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
trafficFee: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
marketFee1: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
marketFee2: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
incentive1: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
incentive2: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
resourceFee: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
productCost: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
recyclingFilm: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
}
module.exports = { SALES_CATEGORY_LIST, SALES_CATEGORY_RULES }
......@@ -48,14 +48,6 @@
>
<template v-if="!updateStatus">
<div class="dialog-content">
<div>
<el-progress
:percentage="updatePercentage"
type="circle"
:width="80"
>
</el-progress>
</div>
<div class="dialog-tips-big">
正在处理中
</div>
......@@ -66,32 +58,30 @@
</template>
<template v-else>
<div
v-if="succNum > 0"
v-if="errorFileUrl"
class="dialog-content"
>
<div class="dialog-tips-big">
处理成功,可返回列表查看。
处理失败。可点击 <span>下载失败模版</span> 查看失败原因。
</div>
</div>
<div
v-if="failNum > 0"
v-else
class="dialog-content"
>
<div class="dialog-tips-big">
处理失败,可点击右上角下载失败模版,查看失败原因。
处理成功,可返回列表查看。
</div>
</div>
</template>
<template #footer>
<span
class="dialog-footer"
v-if="updateStatus && updatePercentage === 100"
>
<span class="dialog-footer">
<el-button
v-if="updateStatus"
type="primary"
@click="nextStep"
>
{{succNum > 0 ? '继续下一步' : '确定'}}
{{!errorFileUrl ? '继续下一步' : '确定'}}
</el-button>
</span>
</template>
......@@ -104,7 +94,7 @@ import { mapActions, mapState } from "vuex";
import StepOne from './components/StepOne.vue';
import StepTwo from './components/StepTwo/index.vue';
import { getWorkwechatTemplate, getBusisDetailBasic } from "@api/shelfManage.js";
import { storeApproveCreateDraft, storeApproveEditDraft } from '@/api/salesManagement.js'
import { storeApproveCreateDraft, storeApproveEditDraft, storeApproveQueryDetail } from '@/api/salesManagement.js'
import { deepClone } from "@/common/util";
export default {
......@@ -115,7 +105,8 @@ export default {
},
provide () {
return {
GET_PAGE_TYPE: () => this.pageType
GET_PAGE_TYPE: () => this.pageType,
GET_BASE_SCENE_CODE: () => this.baseSceneCode,
}
},
data () {
......@@ -126,62 +117,56 @@ export default {
templateInfo: [],
shelfTypeDisabled: false,
dialogVisible: false,
updateStatus: "",
updateStatus: false,
updatePercentage: 0,
succNum: 0,
failNum: 0,
errorFileUrl: "",
baseSceneCode: '',
businessCode: ''
}
},
watch: {
updateList: {
handler (newVal) {
if (newVal.length > 0) {
for (let i = 0; i < newVal.length; i++) {
if (newVal[i].uuid == this.updateUuid) {
this.updatePercentage = deepClone(newVal[i].progress);
if (newVal[i].progress === 100) {
this.updateStatus = deepClone(newVal[i].ifSuccess) || false;
this.succNum = deepClone(newVal[i].succNum) || 0;
this.failNum = deepClone(newVal[i].failNum) || 0;
}
}
}
}
},
deep: true,
},
},
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList,
updateList: state => state.d2admin.user.updateList,
}),
stepOneRef () {
return this.$refs.stepOneRef
},
stepTwoRef () {
return this.$refs.stepTwoRef
}
},
},
mounted () {
// return this.getDetail()
let { approveType, pageType, id } = this.$route.query
this.step = 2
this.pageComplete = true
setTimeout(() => {
this.baseSceneCode = '100101'
}, 2e3)
return
let { approveType, pageType, businessCode } = this.$route.query
if (pageType) {
this.businessCode = businessCode
this.pageType = pageType
if (pageType == 'view') return this.getDetail(id)
else if (pageType == 'reapply') this.getReapplyInfo(id)
else this.getApprovalTemplate(approveType)
if (pageType == 'view') return this.getDetail(businessCode, pageType)
else if (pageType == 'reapply') this.getReapplyInfo(businessCode)
else {
this.getApprovalTemplate(approveType, pageType, businessCode)
}
} else {
this.getApprovalTemplate(approveType)
}
},
methods: {
async getDetail (id) {
this.step = 2
async getDetail (businessCode, pageType) {
const data = await storeApproveQueryDetail({ businessCode })
if (pageType == 'view') {
this.step = 2
} else {
}
this.pageComplete = true
},
/**获取审批模板 */
async getApprovalTemplate (type) {
async getApprovalTemplate (type, pageType, businessCode) {
try {
const data = await getWorkwechatTemplate({ id: type })
if (data) {
......@@ -193,8 +178,11 @@ export default {
}
return item;
})
this.pageComplete = true
this.step = 1
if (pageType) {
this.getDetail(businessCode, pageType)
} else this.pageComplete = true
} else throw '获取模板信息失败'
} catch (error) {
this.$message.error(error)
......@@ -236,14 +224,14 @@ export default {
}
},
async submit () {
let { step } = this
if (step == 1) {
console.log(this.stepOneRef.infoForm, this.templateInfo)
this.clearStatus()
this.stepOneRef.formRef.validate(async (valid) => {
if (valid) {
let { infoForm } = this.stepOneRef,
let { infoForm, sceneTypeName } = this.stepOneRef,
{ approveType } = this.$route.query,
basicApproveInfo = this.templateInfo.map((item) => {
// 1.文本;2.多行文本;3.数字;4.金额;5.单选;6.多选;7.附件
if ([1, 2, 3, 4, 5].includes(item.inputType)) {
......@@ -270,45 +258,63 @@ export default {
basicApproveInfo: JSON.stringify(basicApproveInfo),
approveType: approveType,
shelfType: infoForm.shelfType,
submitFlag: 0
submitFlag: 0,
baseSceneCode: infoForm.baseSceneCode,
}
if (infoForm.shelfType == 1) {
params.merchantId = infoForm.merchantId;
params.merchantName = infoForm.merchantName;
}
const res = await storeApproveCreateDraft(params)
this.baseSceneCode = infoForm.baseSceneCode
this.dialogVisible = true;
this.updateUuid = res;
// this.updatePercentage = 0
// 异步处理文件上传 把id传入处理轮询
const list = [
...this.updateList,
{
name: infoForm.fileName,
ifSuccess: false,
uuid: res,
type: "upload",
},
];
this.actionSetDownloadList({ list, type: "updateList" });
const { errorFileUrl, trafficPartyDetails, businessCode } = await storeApproveCreateDraft(params)
this.updateStatus = true;
this.businessCode = businessCode
if (errorFileUrl) {
this.errorFileUrl = errorFileUrl
} else {
this.stepTwoRef.basicinformationFormList = this.templateInfo
infoForm.sceneTypeName = sceneTypeName
this.stepTwoRef.init({
basicinformationFormList: this.templateInfo,
basicinformationData: infoForm,
infoForm: trafficPartyDetails
})
}
}
})
} else {
console.log(this.stepTwoRef.infoForm)
this.stepTwoRef.formRef.validate(async (valid) => {
this.stepTwoRef.validate(async (valid, data) => {
if (valid) {
console.log(data)
let { businessCode } = this,
{ trafficValidationData, businessValidationData, productDetails } = data,
trafficPartyDetails = {
...trafficValidationData,
...businessValidationData,
},
parmas = {
businessCode,
trafficPartyDetails
}
parmas.trafficPartyDetails.productDetails = productDetails
console.log(parmas)
// 提交
}
})
}
},
nextStep () {
if (this.succNum > 0) {
this.stepTwoRef.basicinformationData = this.infoForm
this.stepTwoRef.basicinformationFormList = this.templateInfo
if (!this.errorFileUrl) {
this.step = 2
} else this.dialogVisible = false
}
this.clearStatus()
},
clearStatus () {
this.dialogVisible = false
this.errorFileUrl = ""
this.updateStatus = false
}
}
}
......@@ -347,5 +353,21 @@ export default {
.fixed-btn-box {
height: 86px;
}
.dialog-content {
text-align: center;
.dialog-tips-big {
font-size: 16px;
color: #333333;
margin-bottom: 20px;
span {
cursor: pointer;
color: rgba(42, 88, 173, 1);
}
}
.dialog-tips-small {
font-size: 12px;
color: #666666;
}
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!