新增功能

fixLog
wangchenguang 2 years ago
parent 8879fa2e96
commit 33fbe643b5
  1. 4
      src/setting.js
  2. 344
      src/views/order/AddOrder.vue
  3. 4
      src/views/shop/addProduct/index.vue

@ -9,9 +9,9 @@ let jumpPath = `${location.origin}/judgmentPoint`
let host = `${location.origin}/`
if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/'
// host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.151:9000/'// 榕
host = 'http://192.168.31.116:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'

@ -121,7 +121,7 @@
<el-button v-if="coursePermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 0)">一键发货</el-button>
<el-button v-if="pageTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 0)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction()">添加</el-button>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(1)">添加</el-button>
</div>
</div>
@ -264,6 +264,163 @@
</div>
</el-card>
<!-- 理论课程 -->
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-between mgb20 user_header">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>理论课程</span>
</div>
<div>
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<template v-if="!viewDisabled && (dispose || theoryCourseList.find(e => e.status == 1) || (isAdd && coursePermissions.length))">
<el-button v-if="theoryCourseList.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 5)">一键发货</el-button>
<el-button v-if="theoryCourse" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 5)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(2)">添加</el-button>
</div>
</div>
<el-table :data="theoryCourseList" class="orderTable" 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-scope="scope">
<div class="small">
<el-input
class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled||editDisabled" 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-select>
</div>
</template>
</el-table-column>
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker
:class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
</p>
<p v-else>
<el-date-picker
:class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
@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></p>
</template>
</el-table-column>
<el-table-column label="剩余期限" align="center" min-width="110">
<template slot-scope="scope">
<div class="small">
<el-input disabled v-model="scope.row.remainingPeriod" placeholder=""
type="text"></el-input>
<span style="margin-left:5px"></span>
</div>
</template>
</el-table-column>
<el-table-column label="市场价" align="center" min-width="170">
<template slot-scope="scope">
<div class="small">
<el-input class="normal" disabled v-model="scope.row.marketValue" type="text"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="折扣率 " align="center" min-width="110">
<template slot-scope="scope">
<el-input class="normal" disabled v-model="scope.row.discountRate" placeholder=""
type="text" size="small" style="width: 100%"></el-input>
</template>
</el-table-column>
<el-table-column label="成交价" align="center" min-width="170">
<template slot-scope="scope">
<div class="small">
<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)]"
v-model="scope.row.finalPrice"
type="text"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="结算价" align="center" min-width="170">
<template slot-scope="scope">
<div class="small">
<el-input :class="['normal', scope.row.settlementPrice === '' && whetherSubmit?'red':'']"
:disabled="viewDisabled"
@input="scope.row.settlementPrice = scope.row.settlementPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.settlementPrice"
type="text"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="端口地址 " align="center" min-width="100">
<template slot-scope="scope">
<el-button @click="configure(scope.row)">配置</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<div class="flex-c-c">
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delCourseDataForm(scope.$index)"
style="margin-right:10px;"
>删除</el-button>
<!-- 1: 未生效2生效中3已过期 -->
<!--
1查看时不可操作
2发货和启用不要同时出现生效前只会显示发货不发货按钮生效后只显示禁启用按钮
3处理中的订单显示发货不显示禁用
-->
<el-switch
v-if="scope.row.ship === 0 || dispose || isAdd "
v-auth="'/order:发货'"
style="margin-right:10px;"
v-model="scope.row.ship"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.ship ? '已发货' : '未发货'"
:disabled="viewDisabled"
@change="handleDeliver($event,scope.row,5)">
</el-switch>
<el-switch
v-else
:disabled="viewDisabled"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="handleEnable($event,scope.row,5)">
</el-switch>
</div>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<!-- 数据平台权限 -->
<el-card shadow="hover" class="mgb20">
<div>
@ -278,7 +435,7 @@
<el-button v-if="dataPlatformPermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 1)">一键发货</el-button>
<el-button v-if="dataPageTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 1)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addDataJurisdiction()">添加</el-button>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(5)">添加</el-button>
</div>
</div>
@ -456,7 +613,7 @@
<el-button v-if="valuePermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 2)">一键发货</el-button>
<el-button v-if="modelPageTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 2)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addValueJurisdiction()">添加</el-button>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(3)">添加</el-button>
</div>
</div>
@ -563,7 +720,7 @@
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delDataForm(scope.$index)"
@click="delDataFormList(scope.$index)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
@ -606,7 +763,7 @@
<el-button v-if="practicalCourses.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 3)">一键发货</el-button>
<el-button v-if="practiceCourseTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 3)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addPracticalCourses">添加</el-button>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(4)">添加</el-button>
</div>
</div>
@ -763,7 +920,7 @@
<el-button v-if="expTools.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 4)">一键发货</el-button>
<el-button v-if="expToolTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 4)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addExpTool">添加</el-button>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(6)">添加</el-button>
</div>
</div>
@ -1071,7 +1228,7 @@
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实训课程非集成列表</span>
<span>{{ classificationId | dialogTitle}}</span>
</div>
<div>
<el-input placeholder="请输入产品名称" prefix-icon="el-icon-search" v-model.trim="practicalCourseName" clearable></el-input>
@ -1086,8 +1243,8 @@
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="typeName" label="产品类型" align="center"></el-table-column>
<el-table-column prop="supplierName" label="厂商" align="center"></el-table-column>
<el-table-column prop="expectedCourse" label="专业类" align="center"></el-table-column>
<el-table-column prop="expectedCourse" label="专业" align="center"></el-table-column>
<el-table-column prop="professionalClassName" label="专业类" align="center"></el-table-column>
<el-table-column prop="professionalName" label="专业" align="center"></el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="practicalCourseTotals"
@ -1096,7 +1253,7 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="practicalCourseVisible = false"> </el-button>
<el-button type="primary" v-preventReClick @click="practicalCourseSubmit"> </el-button>
<el-button type="primary" v-preventReClick @click="practicalCourseSubmit"> 147258</el-button>
</span>
</el-dialog>
@ -1199,7 +1356,7 @@
<el-dialog title="发货信息填写" :visible.sync="shipVisible" width="380px" class="dialog" :close-on-click-modal="false">
<el-input v-model="shipContent" placeholder="请填写需交付的产品登录地址、账号、密码等内容...(300个字以内)" type="textarea" :rows="10" maxlength="300"></el-input>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<span slot="footer" class="dialog-footer" >
<el-button @click="shipVisible = false">取消</el-button>
<el-button type="primary" @click="submitShip">确定</el-button>
</span>
@ -1217,12 +1374,13 @@ export default {
data() {
return {
// authority: 01234
deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes'],
deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes','theoryCourse'],
pageTypes: false,
dataPageTypes: false,
modelPageTypes:false,
practiceCourseTypes:false,
expToolTypes:false,
theoryCourse: false,
loading: false,//
isAdd: false, //
viewDisabled: false,//
@ -1399,6 +1557,10 @@ export default {
shipVisible: false,
shipContent: '',
curRow: {},
// 1 2 3 45 6
classificationId: 0,
//
theoryCourseList: []
};
},
watch: {
@ -1537,7 +1699,8 @@ export default {
if (orderOther.find(e => e.authority === 2)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
authority: 2,
// authority: 2,
authority: 5,
customerId,
productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
@ -1550,6 +1713,7 @@ export default {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
authority: 3,
// authority: 2,
customerId,
productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
@ -1562,6 +1726,7 @@ export default {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
authority: 4,
// authority: 3,
customerId,
productId: orderOther.filter(e => e.authority === 4).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
@ -1570,6 +1735,18 @@ export default {
}).catch(err => {})
}))
}
if (orderOther.find(e => e.authority === 5)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
authority: 2,
customerId,
productId: orderOther.filter(e => e.authority === 5).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
list.push(...orderOthers)
resolve()
}).catch(err => {})
}))
}
Promise.all(promises).then(_ => {
this.setStartDate(list, orderOther)
})
@ -1635,10 +1812,17 @@ export default {
return e;
});//
this.coursePermissions = list.filter(i => i.authority === 1);
this.theoryCourseList = list.filter(i => i.authority === 5);
this.dataPlatformPermissions = list.filter(i => i.authority === 0);
this.valuePermissions = list.filter(i => i.authority === 2);
this.practicalCourses = list.filter(i => i.authority === 3);
this.expTools = list.filter(i => i.authority === 4);
// this.dataPlatformPermissions = list.filter(i => i.authority === 0);
// this.theoryCourseList = list.filter(i => i.authority === 2);
// this.practicalCourses = list.filter(i => i.authority === 3);
// this.expTools = list.filter(i => i.authority === 4);
},
//
getRate() {
@ -1783,7 +1967,8 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.orderRepeat.length) return this.$message.error(this.repeatMsg)
let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions, ...this.valuePermissions, ...this.practicalCourses, ...this.expTools];
let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions, ...this.valuePermissions, ...this.practicalCourses, ...this.expTools,...this.theoryCourseList];
console.log('tempArr=>',tempArr)
let renew = tempArr.some(e => e.renew);
if (this.renewDisabled || renew) {/* 续费状态下 */
this.form.orderNature = 2;
@ -1860,12 +2045,6 @@ export default {
this.$forceUpdate();
}
},
//
addCourseJurisdiction() {
if (!this.form.customerId) return this.$message.warning("请先选择客户");
this.courseVisible = true;
this.getCourseJurisdiction();
},
//
getCourseJurisdiction() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
@ -1992,7 +2171,18 @@ export default {
}
});
},
//
delCourseDataForm(index) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.theoryCourseList.length === 1) {
return this.$message.warning("续费至少保留一条课程权限");
} else {
this.theoryCourseList.splice(index, 1);
}
});
},
//
addValueJurisdiction() {
@ -2166,6 +2356,19 @@ export default {
});
},
//
delDataFormList(index) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.valuePermissions.length === 1) {
return this.$message.warning("续费至少保留一条产品信息");
} else {
this.valuePermissions.splice(index, 1);
}
});
},
//
@ -2179,6 +2382,7 @@ export default {
this.dataLoading = true;
this.$post(this.api.listOfGoods, {
pageNum: this.practicalCoursePage,
productClassification: this.classificationId,
pageSize: 10,
isShelves: 0
}).then(({ page }) => {
@ -2206,10 +2410,34 @@ export default {
async practicalCourseSubmit() {
if (this.practicalCoursesSelect.length > 0) {
let that = this;
let authority
switch (that.classificationId) {
case 1:
authority = 1
break;
case 2:
authority = 5
break;
case 3:
authority = 2
break;
case 4:
authority = 3
break;
case 5:
authority = 0
break;
case 6:
authority = 4
break;
default:
break;
}
const { orderType } = this.form
let fn = function(e) {
let obj = {
dataOrCourseId: e.mallId,// id
dataOrCourseId: e.associatedProduct,// id
mallId: e.mallId,
productName: e.productName,//
periodOfUse: "",// 使
startTime: new Date(),//
@ -2223,14 +2451,42 @@ export default {
totalAmount: "",//
isEnable: 0, // 10
ship: 0,// 01
authority: 3, // 01
authority: authority, // 01
options: 1,
settlementPrice: orderType === 2 ? 0 : '', //
settlementMethod: e.settlementMethod, // 01
settlementPriceUnit: e.settlementPrice, //
businessProportion: e.businessProportion, //
};
that.practicalCourses.push(obj);
switch (that.classificationId) {
case 1:
//
that.coursePermissions.push(obj)
break;
case 2:
//
that.theoryCourseList.push(obj)
break;
case 3:
//
that.valuePermissions.push(obj)
break;
case 4:
//
that.practicalCourses.push(obj)
break;
case 5:
//
that.dataPlatformPermissions.push(obj)
break;
case 6:
//
that.expTools.push(obj)
break;
default:
break;
}
// that.practicalCourses.push(obj);
};
let idArr = [];
this.practicalCoursesSelect.map(e => {//
@ -2250,7 +2506,7 @@ export default {
this.practicalCoursesSelect = [];
/* 调接口,判断是否为客户已有的产品功能 */
let params = {
authority: 3,
authority: this.classificationId,
customerId: this.form.customerId,
productId: idArr
};
@ -2297,6 +2553,7 @@ export default {
this.expToolVisible = true;
this.getExpTool();
},
//
getExpTool() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
@ -2434,7 +2691,10 @@ export default {
this.practicalCourses :
data == 4 ?
this.expTools :
data === 5 ?
this.theoryCourseList :
this.coursePermissions
list.map(e => {
e.ship = ship
if(e.ship === 1) {
@ -2771,6 +3031,40 @@ export default {
},
goBack() {
this.$router.go(-1);
},
/**
* 添加实训课程产品权限,理论课程 ,数据前瞻平台权限,职站增值应用产品权限,实训课程非集成,实验工具
* type
*/
addCourseJurisdiction(type) {
if (!this.form.customerId) return this.$message.warning("请先选择客户");
// this.courseVisible = true;
// this.getCourseJurisdiction();
this.classificationId = type
this.practicalCourseVisible = true;
this.getPracticalCourses();
},
},
filters: {
dialogTitle(options) {
console.log(options)
switch (options) {
case 1:
return '实训课程产品列表'
case 2:
return '理论课程列表'
case 3:
return '职站增值应用列表'
case 4:
return '实训课程(非集成)列表'
case 5:
return '数据前瞻平台权限列表'
case 6:
return '实验工具列表'
default:
break;
}
}
}
};

@ -41,7 +41,7 @@
</el-col>
<el-col :span="6" :offset="2">
<el-form-item class="req" label="产品分类">
<el-select v-model="form.classificationIds" clearable placeholder="请选择产品分类" :disabled="!!form.mall.associatedProduct">
<el-select v-model="form.classificationIds" clearable placeholder="请选择产品分类" :disabled="!!form.mall.associatedProduct && form.classificationIds">
<el-option v-for="(item, i) in productCategoryList" :key="i" :label="item.classificationName" :value="item.classificationId"></el-option>
</el-select>
</el-form-item>
@ -59,7 +59,7 @@
<el-button style="margin-left: 5px" type="primary" @click="setClass">自定义</el-button>
</el-form-item>
<el-form-item class="req" label="供应厂商" prop="supplier">
<el-select v-model="form.supplierIds" clearable placeholder="请选择供应厂商" multiple :disabled="!!form.mall.associatedProduct">
<el-select v-model="form.supplierIds" clearable placeholder="请选择供应厂商" multiple :disabled="!!form.mall.associatedProduct && form.supplierIds.length >1">
<el-option v-for="(item, i) in suppliers" :key="i" :label="item.supplierName" :value="item.supplierId"></el-option>
</el-select>
</el-form-item>

Loading…
Cancel
Save