订单:一键发货、批量修改期限、试用默认1月

dev_review
yujialong 5 months ago
parent d611d682a2
commit 6fe4a41fa1
  1. 1
      src/App.vue
  2. 4
      src/setting.js
  3. 323
      src/views/Login.vue
  4. 297
      src/views/order/AddOrder.vue
  5. 104
      src/views/serve/Configure.vue

@ -3,6 +3,7 @@
<el-radio-group v-if="Setting.isDev" v-model="ip" @change="ipChange">
<el-radio :label="0">刘榕ip</el-radio>
<el-radio :label="1">陈赓ip</el-radio>
<el-radio :label="2">测试服ip</el-radio>
</el-radio-group>
<router-view></router-view>
</div>

@ -15,8 +15,8 @@ if (isDev) {
sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = localStorage.getItem('nakadaiIp') == 1 ? 'http://192.168.31.51:9000/' : 'http://192.168.31.217:9000/'
// host = 'http://192.168.31.51:9000/'
const ips = ['http://192.168.31.217:9000/', 'http://192.168.31.51:9000/', 'http://121.37.12.51/']
host = ips[+localStorage.getItem('nakadaiIp')]
} else if (isPro) {
sandPath = `https://izhixinyun.com/sandbox`
jumpPath = 'https://judgment.huorantech.cn/'

@ -9,125 +9,78 @@
<div class="ms-login">
<div class="ms-title">
<!-- <p class="title">账号登录</p> -->
<el-menu :default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect">
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="1">账号登录</el-menu-item>
<el-menu-item index="2">手机号/邮箱登录</el-menu-item>
</el-menu>
<el-form v-show="activeIndex==='1'"
:model="param"
:rules="rules"
ref="login"
label-width="0px"
style="margin-top: 20px">
<el-form v-show="activeIndex === '1'" :model="param" :rules="rules" ref="login" label-width="0px"
style="margin-top: 20px">
<el-form-item prop="account">
<el-input @blur="blur"
v-model="param.account"
placeholder="请输入账号"></el-input>
<el-input @blur="blur" v-model="param.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password"
placeholder="请输入密码"
v-model="param.password">
<el-input type="password" placeholder="请输入密码" v-model="param.password">
</el-input>
</el-form-item>
<el-form-item prop="code"
v-if="showVerify">
<el-input placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm()">
<el-form-item prop="code" v-if="showVerify">
<el-input placeholder="请输入验证码" v-model="param.code" @keyup.enter.native="submitForm()">
</el-input>
<img @click="blur"
:src="verificationIMG"
class="verification"
alt="">
<img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item>
<div style="width:100%;display:flex;justify-content: flex-end;">
<el-button type="text"
class="forget">忘记密码?</el-button>
<el-button type="text" class="forget">忘记密码?</el-button>
</div>
<div class="login-btn">
<el-button type="primary"
@click="submitForm()">马上登录</el-button>
<el-button type="primary" @click="submitForm()">马上登录</el-button>
</div>
</el-form>
<el-form v-show="activeIndex==='2'"
:model="phoneOrEmail"
:rules="phoneOrEmailrules"
ref="phoneOrEmail"
label-width="0px"
style="margin-top: 20px">
<el-form v-show="activeIndex === '2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail"
label-width="0px" style="margin-top: 20px">
<el-form-item prop="account">
<el-input @blur="phoneBlur"
v-model="phoneOrEmail.account"
placeholder="请输入电话/邮箱"></el-input>
<el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password"
placeholder="请输入密码"
v-model="phoneOrEmail.password">
<el-input type="password" placeholder="请输入密码" v-model="phoneOrEmail.password">
</el-input>
</el-form-item>
<el-form-item prop="code"
v-if="showPhoneVerify">
<el-input placeholder="请输入验证码"
v-model="phoneOrEmail.code"
@keyup.enter.native="submitForm('phone')">
<el-form-item prop="code" v-if="showPhoneVerify">
<el-input placeholder="请输入验证码" v-model="phoneOrEmail.code" @keyup.enter.native="submitForm('phone')">
</el-input>
<img @click="phoneBlur"
:src="PhoneVerificationIMG"
class="verification"
alt="">
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt="">
</el-form-item>
<div style="width:100%;display:flex;justify-content: flex-end;">
<el-button type="text"
class="forget">忘记密码?</el-button>
<el-button type="text" class="forget">忘记密码?</el-button>
</div>
<div class="login-btn">
<el-button type="primary"
@click="submitForm('phone')">马上登录</el-button>
<el-button type="primary" @click="submitForm('phone')">马上登录</el-button>
</div>
</el-form>
</div>
</div>
<el-dialog title="绑定手机号"
:visible.sync="phoneVisible"
:close-on-click-modal="false"
width="576px">
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="576px">
<p class="tips">依据国家政策法规需绑定手机号进行网络实名才可登录使用本平台</p>
<el-form ref="form"
label-width="60px">
<el-form ref="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号"
v-model="phone"
maxlength="11"></el-input>
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div style="display:flex;">
<el-input v-model="phoneCode"
placeholder="请输入验证码"
maxlength="6"></el-input>
<el-button style="margin-left:10px"
@click="sendPhoneCode"
:disabled="phoneDisabled">{{phoneBtnText}}</el-button>
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText
}}</el-button>
</div>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="phoneVisible = false"> </el-button>
<el-button type="primary"
@click="phoneSubmit"> </el-button>
<el-button type="primary" @click="phoneSubmit"> </el-button>
</span>
</el-dialog>
<v-footer class="footer"
ref="footer"></v-footer>
<v-footer class="footer" ref="footer"></v-footer>
</div>
</template>
@ -249,7 +202,8 @@ export default {
}).catch(err => {
if (err.status === 30001) {
this.phoneVisible = true
} else if (err.status == 10004) {
} else if (err.status == 10004 || err.status == 10005) {
param.code = ''
this.blur()
}
});
@ -343,143 +297,166 @@ export default {
<style scoped lang="scss">
.login-wrap {
position: relative;
width: 100%;
background-image: url(../assets/img/login-bg.png);
background-size: 100%;
position: relative;
width: 100%;
background-image: url(../assets/img/login-bg.png);
background-size: 100%;
}
.ms-title {
width: 548px;
position: absolute;
left: 50%;
top: 30px;
transform: translate(-50%, 0);
width: 548px;
position: absolute;
left: 50%;
top: 30px;
transform: translate(-50%, 0);
}
/deep/ .ms-login {
position: relative;
width: 1200px;
height: calc(92vh - 40px);
margin: 60px auto 0;
background-image: url(../assets/img/login-input.png);
box-shadow: 0px 0px 79px 0px rgba(11, 15, 65, 0.36);
background-repeat: no-repeat;
overflow: hidden;
.el-input__inner {
height: 80px;
line-height: 80px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.verification {
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 78px;
cursor: pointer;
}
position: relative;
width: 1200px;
height: calc(92vh - 40px);
margin: 60px auto 0;
background-image: url(../assets/img/login-input.png);
box-shadow: 0px 0px 79px 0px rgba(11, 15, 65, 0.36);
background-repeat: no-repeat;
overflow: hidden;
.el-input__inner {
height: 80px;
line-height: 80px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.verification {
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 78px;
cursor: pointer;
}
}
.title {
font-size: 16px;
text-align: center;
font-weight: bold;
font-size: 16px;
text-align: center;
font-weight: bold;
}
.login-btn {
text-align: center;
text-align: center;
}
.login-btn button {
width: 100%;
height: 88px;
margin-bottom: 50px;
font-weight: bold;
background: linear-gradient(90deg, rgba(94, 206, 253, 1), rgba(91, 67, 231, 1));
box-shadow: 0px 7px 27px 0px rgba(50, 129, 255, 0.51);
border-radius: 10px;
width: 100%;
height: 88px;
margin-bottom: 50px;
font-weight: bold;
background: linear-gradient(90deg, rgba(94, 206, 253, 1), rgba(91, 67, 231, 1));
box-shadow: 0px 7px 27px 0px rgba(50, 129, 255, 0.51);
border-radius: 10px;
}
.login-tips {
text-align: center;
color: #999;
font-weight: bold;
text-align: center;
color: #999;
font-weight: bold;
}
.forget {
margin-bottom: 28px;
text-align: right;
color: #999;
font-weight: bold;
&:hover {
color: #0092ff;
}
margin-bottom: 28px;
text-align: right;
color: #999;
font-weight: bold;
&:hover {
color: #0092ff;
}
}
.thirdParty {
width: 100%;
display: flex;
justify-content: center;
margin-top: 33px;
width: 100%;
display: flex;
justify-content: center;
margin-top: 33px;
}
/* 头部 */
.header {
height: 60px;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
height: 60px;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
}
.logo {
width: 171px;
height: 40px;
margin-left: 20px;
width: 171px;
height: 40px;
margin-left: 20px;
}
img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.header_title {
width: 33%;
display: flex;
justify-content: space-between;
align-items: center;
width: 33%;
display: flex;
justify-content: space-between;
align-items: center;
}
.header_title a {
cursor: pointer;
cursor: pointer;
}
.header_title a:hover {
color: blueviolet;
color: blueviolet;
}
.nul {
width: 80px;
margin-right: 30px;
width: 80px;
margin-right: 30px;
}
.el-menu-demo {
display: flex;
justify-content: space-between;
border-bottom: 0;
background-color: transparent;
display: flex;
justify-content: space-between;
border-bottom: 0;
background-color: transparent;
}
.tips {
margin: -20px 0 20px 5px;
font-size: 14px;
text-align: center;
color: #666;
margin: -20px 0 20px 5px;
font-size: 14px;
text-align: center;
color: #666;
}
@media (max-width: 1600px) {
/deep/.ms-login {
width: 1000px;
.el-input__inner {
height: 50px;
line-height: 50px;
}
.verification {
height: 48px;
}
}
.ms-title {
width: 480px;
/deep/.ms-login {
width: 1000px;
.el-input__inner {
height: 50px;
line-height: 50px;
}
.login-btn button {
height: 60px;
.verification {
height: 48px;
}
}
.ms-title {
width: 480px;
}
.login-btn button {
height: 60px;
}
}
</style>

@ -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: 01234
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 45 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, // 10
ship: 0,// 01
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;
}

@ -1,7 +1,6 @@
<template>
<div>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
@ -12,37 +11,23 @@
<div>
<el-col :span="4">
<el-form-item label="系统归属">
<el-select v-model="form.belong"
clearable
placeholder="请选择系统归属"
@change="initData">
<el-option v-for="(item, i) in belongs"
:key="i"
:label="item"
:value="i"></el-option>
<el-select v-model="form.belong" clearable placeholder="请选择系统归属" @change="initData">
<el-option v-for="(item, i) in belongs" :key="i" :label="item" :value="i"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="系统类型">
<el-select v-model="form.type"
clearable
placeholder="请选择系统类型"
@change="initData">
<el-option v-for="(item, i) in types"
:key="i"
:label="item"
:value="i"></el-option>
<el-select v-model="form.type" clearable placeholder="请选择系统类型" @change="initData">
<el-option v-for="(item, i) in types" :key="i" :label="item" :value="i"></el-option>
</el-select>
</el-form-item>
</el-col>
</div>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入系统名称"
prefix-icon="el-icon-search"
v-model.trim="form.systemName"
clearable></el-input>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="form.systemName"
clearable></el-input>
</el-form-item>
</el-col>
</el-form>
@ -50,84 +35,53 @@
</div>
</el-card>
<el-card shadow="hover"
class="card">
<el-card shadow="hover" class="card">
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>服务列表</span>
</div>
<el-table :data="list"
class="table"
stripe
header-align="center">
<el-table :data="list" class="table" stripe header-align="center">
<!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
<el-table-column type="index"
width="100"
label="序号"
align="center">
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="systemName"
label="系统名称"
align="center"></el-table-column>
<el-table-column prop="type"
label="系统类型"
align="center">
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
<el-table-column prop="type" label="系统类型" align="center">
<template slot-scope="scope">
{{ types[scope.row.type] }}
</template>
</el-table-column>
<el-table-column prop="supplierName"
label="供应商"
align="center"></el-table-column>
<el-table-column prop="belong"
label="系统归属"
align="center">
<el-table-column prop="supplierName" label="供应商" align="center"></el-table-column>
<el-table-column prop="belong" label="系统归属" align="center">
<template slot-scope="scope">
{{ belongs[scope.row.belong] }}
</template>
</el-table-column>
<el-table-column prop="state"
label="系统状态"
align="center">
<el-table-column prop="state" label="系统状态" align="center">
<template slot-scope="scope">
{{ states[scope.row.state] }}
</template>
</el-table-column>
<el-table-column prop="payamount"
label="系统后台"
align="center">
<el-table-column prop="payamount" label="系统后台" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="toBackstage(scope.row)"
v-if="scope.row.systemId !== '11' && scope.row.systemId !== '12'"
v-auth="'/configure:系统后台进入'">进入</el-button>
<el-button type="text" @click="toBackstage(scope.row)"
v-if="scope.row.systemId !== '11' && scope.row.systemId !== '12'"
v-auth="'/configure:系统后台进入'">进入</el-button>
</template>
</el-table-column>
<el-table-column prop="payamount"
label="项目系统"
align="center">
<el-table-column prop="payamount" label="项目系统" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="getIntoProject(scope.row)"
v-auth="'/configure:项目系统进入'">进入</el-button>
<el-button type="text" @click="getIntoProject(scope.row)" v-auth="'/configure:项目系统进入'">进入</el-button>
</template>
</el-table-column>
<el-table-column prop="payamount"
label="判分系统"
align="center">
<el-table-column prop="payamount" label="判分系统" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="getIntoJudgement(scope.row)"
v-auth="'/configure:判分系统进入'">进入</el-button>
<el-button type="text" @click="getIntoJudgement(scope.row)" v-auth="'/configure:判分系统进入'">进入</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="handleCurrentChange"
layout="total, prev, pager, next"
:current-page="page"
:total="total">
<el-pagination background @current-change="handleCurrentChange" layout="total, prev, pager, next"
:current-page="page" :total="total">
</el-pagination>
</div>
</el-card>
@ -154,7 +108,7 @@ export default {
1: '外部产品',
0: '内部系统'
},
types: ['编程类', '流程类'],
types: ['编程类', '流程类', 'AI类'],
states: ['运行中', '默认'],
page: +this.$route.query.page || 1,
pageSize: 10
@ -227,10 +181,10 @@ export default {
<style lang="scss" scoped>
.card {
min-height: calc(100vh - 300px);
min-height: calc(100vh - 300px);
}
.mag {
margin-right: 20px;
margin-right: 20px;
}
</style>

Loading…
Cancel
Save