|
@@ -519,11 +519,53 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- label="学习有效期"
|
|
|
+ label="学习服务期"
|
|
|
style="margin-top: 12px"
|
|
|
- prop="studyTimeArrays"
|
|
|
+ :prop="
|
|
|
+ listData.serviceTimeType
|
|
|
+ ? listData.serviceTimeType === 4
|
|
|
+ ? 'studyTimeArrays'
|
|
|
+ : 'serviceTimeNum'
|
|
|
+ : 'serviceTimeType'
|
|
|
+ "
|
|
|
>
|
|
|
+ <el-select
|
|
|
+ v-model="listData.serviceTimeType"
|
|
|
+ placeholder="请选择学习服务器类型"
|
|
|
+ @change="initServiceFun"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in styleType"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span
|
|
|
+ v-if="
|
|
|
+ listData.serviceTimeType === 1 ||
|
|
|
+ listData.serviceTimeType === 2 ||
|
|
|
+ listData.serviceTimeType === 3
|
|
|
+ "
|
|
|
+ ><span style="margin: 0px 6px">购买那刻开始计算</span
|
|
|
+ ><el-input
|
|
|
+ class="timeInputSty"
|
|
|
+ v-model="listData.serviceTimeNum"
|
|
|
+ ></el-input
|
|
|
+ ><span style="margin-left: 6px">{{
|
|
|
+ listData.serviceTimeType === 1
|
|
|
+ ? "年"
|
|
|
+ : listData.serviceTimeType === 2
|
|
|
+ ? "月"
|
|
|
+ : listData.serviceTimeType === 3
|
|
|
+ ? "天"
|
|
|
+ : ""
|
|
|
+ }}</span></span
|
|
|
+ >
|
|
|
+
|
|
|
<el-date-picker
|
|
|
+ v-if="listData.serviceTimeType === 4"
|
|
|
v-model="listData.studyTimeArrays"
|
|
|
type="datetimerange"
|
|
|
value-format="timestamp"
|
|
@@ -532,8 +574,9 @@
|
|
|
end-placeholder="结束日期"
|
|
|
@change="changeDataTimeStudy(listData.studyTimeArrays)"
|
|
|
>
|
|
|
- </el-date-picker></el-form-item
|
|
|
- ></el-form>
|
|
|
+ </el-date-picker
|
|
|
+ ></el-form-item>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
<div v-if="listData.goodsType === 3">
|
|
|
<h5 class="fengs">关联商品和补考次数</h5>
|
|
@@ -633,6 +676,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
+ <!-- 颁发证书 -->
|
|
|
<div v-if="listData.goodsType === 1 || listData.goodsType === 2">
|
|
|
<h5
|
|
|
class="fengs"
|
|
@@ -760,6 +804,7 @@
|
|
|
>上架</el-button
|
|
|
>
|
|
|
</div>
|
|
|
+ <!-- 费用类型 -->
|
|
|
<el-dialog
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="400px"
|
|
@@ -812,6 +857,7 @@
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 添加课程 -->
|
|
|
<el-dialog
|
|
|
@opened="prepareEnd"
|
|
|
:visible.sync="dialogVisibleTableBoxs"
|
|
@@ -900,6 +946,7 @@
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 添加题卷 -->
|
|
|
<el-dialog
|
|
|
@opened="prepareEnd"
|
|
|
:visible.sync="dialogVisibleTableBoxs2"
|
|
@@ -997,6 +1044,7 @@
|
|
|
<el-button type="primary" @click="submitTab2">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 选择讲义 -->
|
|
|
<el-dialog
|
|
|
:visible.sync="aboutJYBox"
|
|
|
width="400px"
|
|
@@ -1027,6 +1075,7 @@
|
|
|
<el-button type="primary" @click="submitJYs">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 关联讲义列表 -->
|
|
|
<el-dialog
|
|
|
:visible.sync="jYactiveBoxs"
|
|
|
width="880px"
|
|
@@ -1150,6 +1199,7 @@
|
|
|
<el-button type="primary" @click="activejY">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 播放和拍照设置 -->
|
|
|
<el-dialog
|
|
|
:visible.sync="dialogPhoto"
|
|
|
width="980px"
|
|
@@ -1282,6 +1332,7 @@
|
|
|
:examConfigList="examConfigList"
|
|
|
@uploadArrays="uploadArraysTK"
|
|
|
/>
|
|
|
+ <!-- 关联商品 -->
|
|
|
<el-dialog
|
|
|
:visible.sync="activeGoodsBoxs"
|
|
|
width="750px"
|
|
@@ -1388,6 +1439,24 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
+ styleType: [
|
|
|
+ {
|
|
|
+ label: "按年限",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "按月限",
|
|
|
+ value: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "按天限",
|
|
|
+ value: 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "按具体时间区间",
|
|
|
+ value: 4,
|
|
|
+ },
|
|
|
+ ],
|
|
|
disabledBtn: false,
|
|
|
photoVideoList: {
|
|
|
playConfig: {
|
|
@@ -1422,6 +1491,8 @@ export default {
|
|
|
studyTimeArrays: [],
|
|
|
timeArrays: [],
|
|
|
studyCount: 1,
|
|
|
+ serviceTimeType: "",
|
|
|
+ serviceTimeNum: "",
|
|
|
},
|
|
|
|
|
|
eduTypeOptions: [], //教育类型数据
|
|
@@ -1623,6 +1694,31 @@ export default {
|
|
|
trigger: ["blur", "change"],
|
|
|
},
|
|
|
],
|
|
|
+ serviceTimeType: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择学习服务期类型",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ serviceTimeNum: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请输入非零正整数",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator(rule, value, callback) {
|
|
|
+ var reg = /^([1-9][0-9]*){1,3}$/;
|
|
|
+ if (reg.test(value)) {
|
|
|
+ callback();
|
|
|
+ } else {
|
|
|
+ callback(new Error("请输入非零正整数"));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
studyTimeArrays: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -1963,6 +2059,13 @@ export default {
|
|
|
this.getDict();
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 重置学习服务期时间值
|
|
|
+ */
|
|
|
+ initServiceFun() {
|
|
|
+ this.listData.serviceTimeNum = "";
|
|
|
+ this.listData.studyTimeArrays = [];
|
|
|
+ },
|
|
|
judgeResult1(v) {
|
|
|
if (
|
|
|
Number(this.listData.lowestPrice) &&
|
|
@@ -1985,21 +2088,12 @@ export default {
|
|
|
},
|
|
|
changeTypes() {
|
|
|
this.listData.studyCount = 1;
|
|
|
- if (this.listData.goodsType === 3 || this.listData.goodsType === 4) {
|
|
|
- this.listData.timeArrays = [
|
|
|
- new Date().getTime(),
|
|
|
- new Date().getTime() + 365 * 3 * 24 * 3600 * 1000,
|
|
|
- ];
|
|
|
- } else {
|
|
|
- this.listData.timeArrays = [
|
|
|
- new Date().getTime(),
|
|
|
- new Date().getTime() + 365 * 3 * 24 * 3600 * 1000,
|
|
|
- ];
|
|
|
- this.listData.studyTimeArrays = [
|
|
|
- new Date().getTime(),
|
|
|
- new Date().getTime() + 365 * 3 * 24 * 3600 * 1000,
|
|
|
- ];
|
|
|
- }
|
|
|
+ this.listData.timeArrays = [
|
|
|
+ new Date().getTime(),
|
|
|
+ new Date().getTime() + 365 * 1 * 24 * 3600 * 1000,
|
|
|
+ ];
|
|
|
+ this.listData.serviceTimeType = "";
|
|
|
+ this.initServiceFun();
|
|
|
},
|
|
|
zhText(param) {
|
|
|
const { columns, data } = param;
|
|
@@ -2451,29 +2545,31 @@ export default {
|
|
|
datas.goodsStatus = 0;
|
|
|
}
|
|
|
if (datas.goodsType === 1 || datas.goodsType === 2) {
|
|
|
- if (!datas.studyTimeArrays.length) {
|
|
|
- this.$message.warning("请选择学习有效期");
|
|
|
- this.disabledBtn = false;
|
|
|
- return;
|
|
|
- } else {
|
|
|
- if (
|
|
|
- this.listData.timeArrays[0] < this.listData.studyTimeArrays[0] ||
|
|
|
- this.listData.timeArrays[1] > this.listData.studyTimeArrays[1]
|
|
|
- ) {
|
|
|
- this.$message.warning(
|
|
|
- "商品有效期范围必须包含在学习有效期范围内,请重新调整"
|
|
|
- );
|
|
|
+ if (datas.serviceTimeType === 4) {
|
|
|
+ if (!datas.studyTimeArrays.length) {
|
|
|
+ this.$message.warning("请选择学习有效期");
|
|
|
this.disabledBtn = false;
|
|
|
return;
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ this.listData.timeArrays[0] < this.listData.studyTimeArrays[0] ||
|
|
|
+ this.listData.timeArrays[1] > this.listData.studyTimeArrays[1]
|
|
|
+ ) {
|
|
|
+ this.$message.warning(
|
|
|
+ "商品有效期范围必须包含在学习有效期范围内,请重新调整"
|
|
|
+ );
|
|
|
+ this.disabledBtn = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ datas.studyStartTime = this.$methodsTools.time10to13(
|
|
|
+ this.listData.studyTimeArrays[0],
|
|
|
+ 1
|
|
|
+ );
|
|
|
+ datas.studyEndTime = this.$methodsTools.time10to13(
|
|
|
+ this.listData.studyTimeArrays[1],
|
|
|
+ 1
|
|
|
+ );
|
|
|
}
|
|
|
- datas.studyStartTime = this.$methodsTools.time10to13(
|
|
|
- this.listData.studyTimeArrays[0],
|
|
|
- 1
|
|
|
- );
|
|
|
- datas.studyEndTime = this.$methodsTools.time10to13(
|
|
|
- this.listData.studyTimeArrays[1],
|
|
|
- 1
|
|
|
- );
|
|
|
}
|
|
|
}
|
|
|
this.courTypeOptions.map((item) => {
|
|
@@ -3237,6 +3333,12 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
+.timeInputSty {
|
|
|
+ width: 70px;
|
|
|
+ /deep/.el-input__inner {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+}
|
|
|
/deep/ .cenSty > .el-input__inner {
|
|
|
text-align: center;
|
|
|
}
|