|
|
|
@ -11,8 +11,12 @@ |
|
|
|
|
<span class="per_back">返回</span> |
|
|
|
|
<span class="per_school">{{ titlesw }}</span> |
|
|
|
|
</div> |
|
|
|
|
<el-button v-if="!viewDisabled" type="primary" round class="mag" v-preventReClick @click="submitOrder">确定 |
|
|
|
|
</el-button> |
|
|
|
|
<div> |
|
|
|
|
<el-button v-if="dispose || isAdd" type="primary" round v-preventReClick @click="shipAll">一键发货 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-if="!viewDisabled" type="primary" round v-preventReClick @click="submitOrder">确定 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
@ -66,7 +70,7 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="orderType" label="订单类型"> |
|
|
|
|
<el-select :disabled="viewDisabled" v-model="form.orderType" clearable placeholder="请选择订单类型" |
|
|
|
|
@change="updateOrderType"> |
|
|
|
|
@change="orderTypeChange"> |
|
|
|
|
<el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.name" |
|
|
|
|
:value="item.value"></el-option> |
|
|
|
|
</el-select> |
|
|
|
@ -125,6 +129,17 @@ |
|
|
|
|
<el-table-column prop="productName" label="产品名称" align="center" min-width="150" show-overflow-tooltip> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="190"> |
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" |
|
|
|
|
@change="batchDeadlineChange(0)" |
|
|
|
|
@input="productProps[0].deadline = productProps[0].deadline.replace(/[^0-9.]/g, '')" |
|
|
|
|
v-model="productProps[0].deadline" placeholder="批量输入时间" /> |
|
|
|
|
<el-select class="time-select" v-model="productProps[0].unit" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="batchUnitChange(0)"> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input class="time-input" :class="!scope.row.periodOfUse && whetherSubmit ? 'red' : ''" |
|
|
|
@ -134,9 +149,7 @@ |
|
|
|
|
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"> |
|
|
|
|
<el-option label="日" :value="0"></el-option> |
|
|
|
|
<el-option label="月" :value="1"></el-option> |
|
|
|
|
<el-option label="年" :value="2"></el-option> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -188,7 +201,7 @@ |
|
|
|
|
<el-input :class="['normal', scope.row.finalPrice === '' && whetherSubmit ? 'red' : '']" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@change="[allAmount($event, scope.row), calculateDiscountCourse($event, scope.row)]" |
|
|
|
|
@change="[allAmount(scope.row), calculateDiscountCourse(scope.row)]" |
|
|
|
|
v-model="scope.row.finalPrice" type="text"></el-input> 元 |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -262,6 +275,17 @@ |
|
|
|
|
<el-table-column prop="productName" label="产品名称" align="center" min-width="150" show-overflow-tooltip> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="190"> |
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" |
|
|
|
|
@change="batchDeadlineChange(1)" |
|
|
|
|
@input="productProps[1].deadline = productProps[1].deadline.replace(/[^0-9.]/g, '')" |
|
|
|
|
v-model="productProps[1].deadline" placeholder="批量输入时间" /> |
|
|
|
|
<el-select class="time-select" v-model="productProps[1].unit" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="batchUnitChange(1)"> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input class="time-input" :class="!scope.row.periodOfUse && whetherSubmit ? 'red' : ''" |
|
|
|
@ -271,9 +295,7 @@ |
|
|
|
|
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"> |
|
|
|
|
<el-option label="日" :value="0"></el-option> |
|
|
|
|
<el-option label="月" :value="1"></el-option> |
|
|
|
|
<el-option label="年" :value="2"></el-option> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -293,7 +315,7 @@ |
|
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
|
placeholder="请选择使用日期"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime |
|
|
|
|
<span v-if="scope.row.startTime"><span v-if="scope.row.endTime"> - </span>{{ scope.row.endTime |
|
|
|
|
}}</span> |
|
|
|
|
</p> |
|
|
|
|
</template> |
|
|
|
@ -325,7 +347,7 @@ |
|
|
|
|
<el-input :class="['normal', scope.row.finalPrice === '' && whetherSubmit ? 'red' : '']" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@change="[allAmount($event, scope.row), calculateDiscountCourse($event, scope.row)]" |
|
|
|
|
@change="[allAmount(scope.row), calculateDiscountCourse(scope.row)]" |
|
|
|
|
v-model="scope.row.finalPrice" type="text"></el-input> 元 |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -399,7 +421,18 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="productName" label="产品名称" align="center" min-width="100"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="190"> |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="210"> |
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" |
|
|
|
|
@change="batchDeadlineChange(4)" |
|
|
|
|
@input="productProps[4].deadline = productProps[4].deadline.replace(/[^0-9.]/g, '')" |
|
|
|
|
v-model="productProps[4].deadline" placeholder="批量输入时间" /> |
|
|
|
|
<el-select class="time-select" v-model="productProps[4].unit" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="batchUnitChange(4)"> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input class="time-input" :class="!scope.row.periodOfUse && whetherSubmit ? 'red' : ''" |
|
|
|
@ -410,9 +443,8 @@ |
|
|
|
|
<span style="margin-left:5px"> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options)"> |
|
|
|
|
<el-option label="日" :value="0"></el-option> |
|
|
|
|
<el-option label="月" :value="1"></el-option> |
|
|
|
|
<el-option label="年" :value="2"></el-option> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
@ -474,7 +506,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="账号数" align="center" min-width="100"> |
|
|
|
|
<el-table-column label="账号数" align="center" min-width="90"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input :class="['normal', !scope.row.accountNum && whetherSubmit ? 'red' : '']" |
|
|
|
@ -486,19 +518,18 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<!-- 金额自动计算,计算方式:账号数*成交价,且可以手动修改,保留两位小数 --> |
|
|
|
|
<el-table-column label="成交价" align="center" min-width="160"> |
|
|
|
|
<el-table-column label="成交价" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input style="width: 80%" |
|
|
|
|
:class="['normal', scope.row.finalPrice === '' && whetherSubmit ? 'red' : '']" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
@blur="[allAmount($event, scope.row), dealFinalValue($event, scope.row)]" |
|
|
|
|
:disabled="viewDisabled" @blur="[allAmount(scope.row), dealFinalValue($event, scope.row)]" |
|
|
|
|
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
v-model="scope.row.finalPrice" type="text"></el-input> 元 |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="结算价" align="center" min-width="140"> |
|
|
|
|
<el-table-column label="结算价" align="center" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input style="width: 80%" |
|
|
|
@ -559,6 +590,17 @@ |
|
|
|
|
<el-table-column prop="productName" label="产品名称" align="center" min-width="100"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="190"> |
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" |
|
|
|
|
@change="batchDeadlineChange(2)" |
|
|
|
|
@input="productProps[2].deadline = productProps[2].deadline.replace(/[^0-9.]/g, '')" |
|
|
|
|
v-model="productProps[2].deadline" placeholder="批量输入时间" /> |
|
|
|
|
<el-select class="time-select" v-model="productProps[2].unit" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="batchUnitChange(2)"> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input class="time-input" :class="!scope.row.periodOfUse && whetherSubmit ? 'red' : ''" |
|
|
|
@ -569,9 +611,8 @@ |
|
|
|
|
<span style="margin-left:5px"> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options)"> |
|
|
|
|
<el-option label="日" :value="0"></el-option> |
|
|
|
|
<el-option label="月" :value="1"></el-option> |
|
|
|
|
<el-option label="年" :value="2"></el-option> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" |
|
|
|
|
:value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
@ -679,13 +720,23 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!--:summary-method="getSummaries"--> |
|
|
|
|
<el-table :data="practicalCourses" class="orderTable orderTables" stripe header-align="center"> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="productName" label="产品名称" align="center" min-width="150" show-overflow-tooltip> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="190"> |
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" |
|
|
|
|
@change="batchDeadlineChange(3)" |
|
|
|
|
@input="productProps[3].deadline = productProps[3].deadline.replace(/[^0-9.]/g, '')" |
|
|
|
|
v-model="productProps[3].deadline" placeholder="批量输入时间" /> |
|
|
|
|
<el-select class="time-select" v-model="productProps[3].unit" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="batchUnitChange(3)"> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input class="time-input" :class="!scope.row.periodOfUse && whetherSubmit ? 'red' : ''" |
|
|
|
@ -695,9 +746,7 @@ |
|
|
|
|
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"> |
|
|
|
|
<el-option label="日" :value="0"></el-option> |
|
|
|
|
<el-option label="月" :value="1"></el-option> |
|
|
|
|
<el-option label="年" :value="2"></el-option> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -749,7 +798,7 @@ |
|
|
|
|
<el-input :class="['normal', scope.row.finalPrice === '' && whetherSubmit ? 'red' : '']" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@change="[allAmount($event, scope.row), calculateDiscountCourse($event, scope.row)]" |
|
|
|
|
@change="[allAmount(scope.row), calculateDiscountCourse(scope.row)]" |
|
|
|
|
v-model="scope.row.finalPrice" type="text"></el-input> 元 |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -821,6 +870,17 @@ |
|
|
|
|
<el-table-column prop="productName" label="产品名称" align="center" min-width="150" show-overflow-tooltip> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="190"> |
|
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
|
<el-input class="batch-time" :disabled="viewDisabled || isEdit" maxlength="4" |
|
|
|
|
@change="batchDeadlineChange(5)" |
|
|
|
|
@input="productProps[5].deadline = productProps[5].deadline.replace(/[^0-9.]/g, '')" |
|
|
|
|
v-model="productProps[5].deadline" placeholder="批量输入时间" /> |
|
|
|
|
<el-select class="time-select" v-model="productProps[5].unit" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="batchUnitChange(5)"> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input class="time-input" :class="!scope.row.periodOfUse && whetherSubmit ? 'red' : ''" |
|
|
|
@ -830,9 +890,7 @@ |
|
|
|
|
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled || isEdit" |
|
|
|
|
placeholder="请选择" @change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"> |
|
|
|
|
<el-option label="日" :value="0"></el-option> |
|
|
|
|
<el-option label="月" :value="1"></el-option> |
|
|
|
|
<el-option label="年" :value="2"></el-option> |
|
|
|
|
<el-option v-for="(item, i) in units" :key="i" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -884,7 +942,7 @@ |
|
|
|
|
<el-input :class="['normal', scope.row.finalPrice === '' && whetherSubmit ? 'red' : '']" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@change="[allAmount($event, scope.row), calculateDiscountCourse($event, scope.row)]" |
|
|
|
|
@change="[allAmount(scope.row), calculateDiscountCourse(scope.row)]" |
|
|
|
|
v-model="scope.row.finalPrice" type="text"></el-input> 元 |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -1098,30 +1156,42 @@ export default { |
|
|
|
|
return { |
|
|
|
|
// authority: 权限。0数据平台,1为课程,2职站增值模块,3实训课程(非集成),4实验工具 |
|
|
|
|
deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes', 'theoryCourse'], |
|
|
|
|
listName: [ |
|
|
|
|
productProps: [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: 'coursePermissions' |
|
|
|
|
name: 'coursePermissions', |
|
|
|
|
deadline: '', |
|
|
|
|
unit: 2, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
name: 'theoryCourseList' |
|
|
|
|
name: 'theoryCourseList', |
|
|
|
|
deadline: '', |
|
|
|
|
unit: 2, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 3, |
|
|
|
|
name: 'valuePermissions' |
|
|
|
|
name: 'valuePermissions', |
|
|
|
|
deadline: '', |
|
|
|
|
unit: 2, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 4, |
|
|
|
|
name: 'practicalCourses' |
|
|
|
|
name: 'practicalCourses', |
|
|
|
|
deadline: '', |
|
|
|
|
unit: 2, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 5, |
|
|
|
|
name: 'dataPlatformPermissions' |
|
|
|
|
name: 'dataPlatformPermissions', |
|
|
|
|
deadline: '', |
|
|
|
|
unit: 2, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 6, |
|
|
|
|
name: 'expTools' |
|
|
|
|
name: 'expTools', |
|
|
|
|
deadline: '', |
|
|
|
|
unit: 2, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
pageTypes: false, |
|
|
|
@ -1310,7 +1380,23 @@ export default { |
|
|
|
|
// 用于区分栏目 1实训课程 2理论课程 3职站增值应用 4实训课程(非集成)5数据前瞻 6实验工具 |
|
|
|
|
classificationId: 0, |
|
|
|
|
// 理论课程数据 |
|
|
|
|
theoryCourseList: [] |
|
|
|
|
theoryCourseList: [], |
|
|
|
|
units: [ |
|
|
|
|
{ |
|
|
|
|
id: 0, |
|
|
|
|
name: '日' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '月' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
name: '年' |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
batchDeadline1: '', |
|
|
|
|
batchUnit1: 2, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -1488,16 +1574,25 @@ export default { |
|
|
|
|
* type 正式为1 |
|
|
|
|
* 试用为2 |
|
|
|
|
*/ |
|
|
|
|
updateOrderType (type) { |
|
|
|
|
console.log('options=>', type) |
|
|
|
|
orderTypeChange (type) { |
|
|
|
|
if (type == 1) { |
|
|
|
|
this.coursePermissions.forEach(item => { |
|
|
|
|
this.dealSettlePrice(item) |
|
|
|
|
this.coursePermissions.forEach(e => { |
|
|
|
|
this.dealSettlePrice(e) |
|
|
|
|
this.calculateDiscountCourse(e) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.coursePermissions.forEach(item => { |
|
|
|
|
item.finalPrice = 0 |
|
|
|
|
item.settlementPrice = 0 |
|
|
|
|
this.productProps.map(e => { |
|
|
|
|
this[e.name].map(n => { |
|
|
|
|
n.finalPrice = 0 |
|
|
|
|
n.settlementPrice = 0 |
|
|
|
|
// 如果使用期限没填,则默认1月 |
|
|
|
|
if (!n.periodOfUse) { |
|
|
|
|
n.periodOfUse = 1 |
|
|
|
|
n.options = 1 |
|
|
|
|
this.deadLine(n.periodOfUse, n, n.options, 1) |
|
|
|
|
} |
|
|
|
|
this.calculateDiscountCourse(n) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -1524,7 +1619,7 @@ export default { |
|
|
|
|
e.periodOfUse = ""; |
|
|
|
|
} else if (!this.viewDisabled) { // 如果不是查看 |
|
|
|
|
e.startTime = cur.startTime.split(" ")[0]; |
|
|
|
|
e.endTime = cur.endTime.split(" ")[0]; |
|
|
|
|
if (cur.endTime) e.endTime = cur.endTime.split(" ")[0]; |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
if (item && this.renewDisabled) { |
|
|
|
@ -1577,6 +1672,29 @@ export default { |
|
|
|
|
const curClient = this.clients.find(e => e.customerId == customerId) |
|
|
|
|
this.$post(`${this.api.refreshCache}?schoolId=${curClient ? curClient.schoolId : ''}`).then(res => { }).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 一键发货 |
|
|
|
|
shipAll () { |
|
|
|
|
this.productProps.map(e => { |
|
|
|
|
this[e.name].map(n => { |
|
|
|
|
n.ship = 1 |
|
|
|
|
n.isEnable = 1 |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 批量设置产品时间 |
|
|
|
|
batchDeadlineChange (i) { |
|
|
|
|
this[this.productProps[i].name].map(e => { |
|
|
|
|
e.periodOfUse = this.productProps[i].deadline |
|
|
|
|
this.deadLine(e.periodOfUse, e, e.options, 1) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 批量设置产品期限单位 |
|
|
|
|
batchUnitChange (i) { |
|
|
|
|
this[this.productProps[i].name].map(e => { |
|
|
|
|
e.options = this.productProps[i].unit |
|
|
|
|
this.deadLine(e.periodOfUse, e, e.options, 1) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 新增订单 |
|
|
|
|
submitOrder () { |
|
|
|
|
let purchase = 0 // 总采购成本 |
|
|
|
@ -1798,10 +1916,9 @@ export default { |
|
|
|
|
// 更换了订单客户后重新获取结算价 |
|
|
|
|
getSettlemennt () { |
|
|
|
|
const list = [] |
|
|
|
|
this.listName.map(e => e.name).forEach(e => { |
|
|
|
|
this.productProps.map(e => e.name).forEach(e => { |
|
|
|
|
list.push(...this[e]) |
|
|
|
|
}) |
|
|
|
|
console.log("🚀 ~ file: AddOrder.vue:1954 ~ getSettlemennt ~ list:", list) |
|
|
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => { |
|
|
|
@ -1898,7 +2015,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
practicalCoursesSelectable (row, index) { // 禁止勾选已经选过的数据平台 |
|
|
|
|
let boolean = true; |
|
|
|
|
const { name } = this.listName.find(e => e.id == this.classificationId) |
|
|
|
|
const { name } = this.productProps.find(e => e.id == this.classificationId) |
|
|
|
|
this[name].length && this[name].some(e => { |
|
|
|
|
if (e.mallId == row.mallId) { |
|
|
|
|
boolean = false; |
|
|
|
@ -1938,13 +2055,13 @@ export default { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
const { orderType } = this.form |
|
|
|
|
const { name } = this.listName.find(e => e.id == that.classificationId) |
|
|
|
|
let fn = function (e) { |
|
|
|
|
that[name].push({ |
|
|
|
|
const { name } = this.productProps.find(e => e.id == that.classificationId) |
|
|
|
|
let createProduct = function (e) { |
|
|
|
|
const row = { |
|
|
|
|
dataOrCourseId: e.associatedProduct,// id |
|
|
|
|
mallId: e.mallId, |
|
|
|
|
productName: e.productName,// 名称 |
|
|
|
|
periodOfUse: "",// 使用期限 |
|
|
|
|
periodOfUse: orderType === 2 ? 1 : '',// 使用期限 |
|
|
|
|
startTime: new Date(),// 开始 |
|
|
|
|
endTime: "", // 终止 |
|
|
|
|
remainingPeriod: "",// 剩余期限 |
|
|
|
@ -1958,11 +2075,12 @@ export default { |
|
|
|
|
isEnable: 0, // 启用否:1启用,0禁用 |
|
|
|
|
ship: 0,// 发货否(0未发货,1已发货,默认不发货) |
|
|
|
|
authority, // 区分权限 |
|
|
|
|
options: 2, |
|
|
|
|
options: orderType === 2 ? 1 : 2, |
|
|
|
|
settlementPrice: orderType === 2 ? 0 : '', // 结算价 |
|
|
|
|
settlementPriceUnit: e.settlementPrice || 0, // 结算单价 |
|
|
|
|
mallNonAssociatedLinks: e.mallNonAssociatedLinks // 产品链接 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
that[name].push(row) |
|
|
|
|
}; |
|
|
|
|
const productId = [] |
|
|
|
|
this.practicalCoursesSelect.map(e => {// 取得选中的值,进行赋值 |
|
|
|
@ -1975,33 +2093,37 @@ export default { |
|
|
|
|
if (mall) { |
|
|
|
|
e.settlementPrice = mall.discountRate |
|
|
|
|
} |
|
|
|
|
fn(e); |
|
|
|
|
createProduct(e) |
|
|
|
|
}).catch((res) => { }) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.practicalCourseVisible = false; |
|
|
|
|
this.practicalCourseName = ""; |
|
|
|
|
this.practicalCoursesSelect = []; |
|
|
|
|
this.practicalCourseVisible = false |
|
|
|
|
this.practicalCourseName = '' |
|
|
|
|
this.practicalCoursesSelect = [] |
|
|
|
|
|
|
|
|
|
/* 调接口,判断是否为客户已有的产品功能 */ |
|
|
|
|
productId.length && await this.$post(this.api.renew, { |
|
|
|
|
authority, |
|
|
|
|
customerId: this.form.customerId, |
|
|
|
|
productId, |
|
|
|
|
}).then(res => { |
|
|
|
|
if (productId.length) { |
|
|
|
|
const res = await this.$post(this.api.renew, { |
|
|
|
|
authority, |
|
|
|
|
customerId: this.form.customerId, |
|
|
|
|
productId, |
|
|
|
|
}) |
|
|
|
|
this[name].map(e => { |
|
|
|
|
res.orderOthers.map(el => { |
|
|
|
|
if (el.dataOrCourseId == e.dataOrCourseId && el.authority == authority) { |
|
|
|
|
let time = new Date(el.endTime) |
|
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
|
e.endTime = ""; |
|
|
|
|
e.periodOfUse = ""; |
|
|
|
|
e.renew = true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
const cur = res.orderOthers.find(n => n.mallId === e.mallId && n.dataOrCourseId == e.dataOrCourseId && n.authority == authority) |
|
|
|
|
if (cur) { |
|
|
|
|
let time = new Date(cur.endTime) |
|
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
|
e.endTime = '' |
|
|
|
|
// e.periodOfUse = orderType === 2 ? 0 : '' |
|
|
|
|
e.renew = true |
|
|
|
|
} |
|
|
|
|
if (orderType === 2) { |
|
|
|
|
this.deadLine(e.periodOfUse, e, e.options, 1) |
|
|
|
|
this.calculateDiscountCourse(e) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return this.$message.warning("请选择数据"); |
|
|
|
|
} |
|
|
|
@ -2086,10 +2208,10 @@ export default { |
|
|
|
|
return isNaN(val) ? 0 : val |
|
|
|
|
}, |
|
|
|
|
// 课程计算折扣率 |
|
|
|
|
calculateDiscountCourse (val, row) { |
|
|
|
|
calculateDiscountCourse (row) { |
|
|
|
|
const { finalPrice, marketValue } = row |
|
|
|
|
// (原价-现价)÷原价 x100% |
|
|
|
|
if (finalPrice) row.discountRate = marketValue == 0 ? '0%' : ((marketValue - finalPrice) / marketValue * 100).toFixed(2) + "%"; |
|
|
|
|
if (finalPrice !== '') row.discountRate = marketValue == 0 ? '0%' : ((marketValue - finalPrice) / marketValue * 100).toFixed(2) + "%"; |
|
|
|
|
}, |
|
|
|
|
// 数据计算折扣率 |
|
|
|
|
calculateDiscount (val, row) { |
|
|
|
@ -2105,7 +2227,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 计算订单总额 |
|
|
|
|
allAmount ($event, row) { |
|
|
|
|
allAmount (row) { |
|
|
|
|
this.dealSettlePrice(row) |
|
|
|
|
let total = 0 |
|
|
|
|
const list = [...this.coursePermissions, ...this.dataPlatformPermissions, ...this.practicalCourses, ...this.expTools] |
|
|
|
@ -2139,7 +2261,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.dealSettlePrice(row) |
|
|
|
|
this.allAmount(e, row) |
|
|
|
|
this.allAmount(row) |
|
|
|
|
}, |
|
|
|
|
// 计算结算价 |
|
|
|
|
dealSettlePrice (row) { |
|
|
|
@ -2177,10 +2299,11 @@ export default { |
|
|
|
|
let time = new Date(row.startTime).getTime(); |
|
|
|
|
|
|
|
|
|
let endTime = time + optionsData |
|
|
|
|
row.endTime = time + optionsData |
|
|
|
|
var timestamp = endTime; |
|
|
|
|
var dt = new Date(timestamp); //根据时间戳生成的时间对象 |
|
|
|
|
// debugger |
|
|
|
|
row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate()) |
|
|
|
|
console.log("🚀 ~ deadLine ~ row.endTime:", row.endTime) |
|
|
|
|
let endYear = timestamp - time |
|
|
|
|
let endYears = endYear / 1000 / 60 / 60 / 24 |
|
|
|
|
row.remainingPeriod = endYears |
|
|
|
@ -2195,7 +2318,7 @@ export default { |
|
|
|
|
price * useUnit)).toFixed(2) |
|
|
|
|
this.dealComputers(e, row) |
|
|
|
|
|
|
|
|
|
row.authority ? this.calculateDiscountCourse(e, row) : this.calculateDiscount(e, row) |
|
|
|
|
row.authority ? this.calculateDiscountCourse(row) : this.calculateDiscount(e, row) |
|
|
|
|
|
|
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
|
if (isDate) { |
|
|
|
@ -2442,6 +2565,10 @@ export default { |
|
|
|
|
width: 100px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.batch-time { |
|
|
|
|
width: 110px !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.time-input { |
|
|
|
|
width: 90px !important; |
|
|
|
|
} |
|
|
|
|