|
@@ -9,11 +9,15 @@
|
|
|
@editInfo="editInfo"
|
|
|
>
|
|
|
<template slot="btn" slot-scope="props">
|
|
|
- <el-button type="text" @click="addClick(props.scope.row, 0)"
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="addClick(props.scope.row, 0)"
|
|
|
:disabled="props.scope.row.status === 1"
|
|
|
>修改计划</el-button
|
|
|
>
|
|
|
- <el-button type="text" @click="editGoods(props.scope.row)"
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="editGoods(props.scope.row)"
|
|
|
:disabled="props.scope.row.status === 1"
|
|
|
>适用商品</el-button
|
|
|
>
|
|
@@ -41,6 +45,7 @@
|
|
|
@handleCurrentChange="handleCurrentChange"
|
|
|
/>
|
|
|
<el-dialog
|
|
|
+ @closed="loadingClose"
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="610px"
|
|
|
:show-close="false"
|
|
@@ -82,7 +87,7 @@
|
|
|
<el-form-item label="" prop="beforeUrl" v-if="listData.beforeStatus">
|
|
|
<el-radio-group v-model="listData.beforeUrl">
|
|
|
<el-radio
|
|
|
- style="margin-bottom:10px;"
|
|
|
+ style="margin-bottom: 10px"
|
|
|
v-for="(item, index) in radioApi"
|
|
|
:key="index"
|
|
|
:label="item.beforeUrlId"
|
|
@@ -123,6 +128,7 @@
|
|
|
<el-button @click="close">取 消</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
+ :loading="disabledBtn"
|
|
|
v-if="statusPop !== 2"
|
|
|
@click="submit('listData')"
|
|
|
>确 定</el-button
|
|
@@ -208,7 +214,7 @@
|
|
|
>请先选择业务层级</span
|
|
|
>
|
|
|
<el-checkbox-group
|
|
|
- style="overflow:auto;max-height:500px;"
|
|
|
+ style="overflow: auto; max-height: 500px"
|
|
|
v-model="listDataGoods.goodsId"
|
|
|
v-else-if="listDataGoods.businessId && goodsList.length"
|
|
|
>
|
|
@@ -224,7 +230,7 @@
|
|
|
<span
|
|
|
:style="
|
|
|
item.goodsStatus === 0 &&
|
|
|
- bfListData.goodsId.indexOf(item.goodsId) === -1
|
|
|
+ bfListData.goodsId.indexOf(item.goodsId) === -1
|
|
|
? ''
|
|
|
: 'color:#F56C6C'
|
|
|
"
|
|
@@ -271,19 +277,17 @@
|
|
|
<span>{{ infoData.beforeName }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="关联题卷:">
|
|
|
- <span v-for="(item,index) in optionsApis" :key="index">
|
|
|
- <span v-if="item.value === infoData.beforeStatus">{{item.label}}</span>
|
|
|
+ <span v-for="(item, index) in optionsApis" :key="index">
|
|
|
+ <span v-if="item.value === infoData.beforeStatus">{{
|
|
|
+ item.label
|
|
|
+ }}</span>
|
|
|
</span>
|
|
|
<span>{{ infoData.urlName }}</span> <span>{{ infoData.url }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开放时间:">
|
|
|
- <span>{{
|
|
|
- $methodsTools.onlyForma(infoData.beforeStartTime)
|
|
|
- }}</span>
|
|
|
+ <span>{{ $methodsTools.onlyForma(infoData.beforeStartTime) }}</span>
|
|
|
至
|
|
|
- <span>{{
|
|
|
- $methodsTools.onlyForma(infoData.beforeEndTime)
|
|
|
- }}</span>
|
|
|
+ <span>{{ $methodsTools.onlyForma(infoData.beforeEndTime) }}</span>
|
|
|
</el-form-item>
|
|
|
<el-button type="info" style="margin-bottom: 20px" size="mini"
|
|
|
>适用商品</el-button
|
|
@@ -323,10 +327,11 @@ import searchBox from "@/components/searchBox";
|
|
|
import tableList from "@/components/tableList";
|
|
|
import pagination from "@/components/pagination";
|
|
|
export default {
|
|
|
- name:"QianpeiArrange",
|
|
|
+ name: "QianpeiArrange",
|
|
|
components: { searchBox, tableList, pagination },
|
|
|
data() {
|
|
|
return {
|
|
|
+ disabledBtn: false,
|
|
|
loading: false, //当前表单加载是否加载动画
|
|
|
navText: {
|
|
|
title: "前培安排",
|
|
@@ -392,8 +397,8 @@ export default {
|
|
|
prop: "people",
|
|
|
hidden: true,
|
|
|
width: "180px",
|
|
|
- scope:"AjumpPeolpe",
|
|
|
- type:2,
|
|
|
+ scope: "AjumpPeolpe",
|
|
|
+ type: 2,
|
|
|
},
|
|
|
],
|
|
|
optionsApis: [
|
|
@@ -514,9 +519,11 @@ export default {
|
|
|
if (this.statusPop === 1) {
|
|
|
this.listDataGoods.goodsId = [];
|
|
|
}
|
|
|
- this.$api.inquiresystembeforelistGoods({ businessId: value }).then((res) => {
|
|
|
- this.goodsList = res.rows;
|
|
|
- });
|
|
|
+ this.$api
|
|
|
+ .inquiresystembeforelistGoods({ businessId: value })
|
|
|
+ .then((res) => {
|
|
|
+ this.goodsList = res.rows;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
"listData.beforeStatus"(value) {
|
|
@@ -527,14 +534,19 @@ export default {
|
|
|
},
|
|
|
computed: { ...mapGetters(["educationType"]) },
|
|
|
methods: {
|
|
|
+ loadingClose() {
|
|
|
+ this.disabledBtn = false;
|
|
|
+ },
|
|
|
//修改适用商品
|
|
|
editGoods(row) {
|
|
|
this.$api
|
|
|
.inquiresystembeforelistGoodsgoodsInfo({ beforeId: row.beforeId })
|
|
|
.then((res) => {
|
|
|
- this.$api.inquiresystembeforelistGoods({ businessId: res.data.businessId }).then((result) => {
|
|
|
- this.goodsList = result.rows;
|
|
|
- });
|
|
|
+ this.$api
|
|
|
+ .inquiresystembeforelistGoods({ businessId: res.data.businessId })
|
|
|
+ .then((result) => {
|
|
|
+ this.goodsList = result.rows;
|
|
|
+ });
|
|
|
if (res.data.goodsType && res.data.goodsId.length) {
|
|
|
this.statusPop = 0;
|
|
|
this.bfListData = JSON.parse(JSON.stringify(res.data));
|
|
@@ -590,15 +602,13 @@ export default {
|
|
|
},
|
|
|
// 判断选择时间逻辑
|
|
|
changeEndTime(int) {
|
|
|
- if(this.listData.beforeStartTime === this.listData.beforeEndTime){
|
|
|
- this.$message.warning(
|
|
|
- "开始时间与结束时间不允许相同"
|
|
|
- );
|
|
|
- if(int === 1){
|
|
|
- this.listData.beforeStartTime = "";
|
|
|
+ if (this.listData.beforeStartTime === this.listData.beforeEndTime) {
|
|
|
+ this.$message.warning("开始时间与结束时间不允许相同");
|
|
|
+ if (int === 1) {
|
|
|
+ this.listData.beforeStartTime = "";
|
|
|
}
|
|
|
- if(int === 2){
|
|
|
- this.listData.beforeEndTime = "";
|
|
|
+ if (int === 2) {
|
|
|
+ this.listData.beforeEndTime = "";
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -749,6 +759,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
rulesTableSumbit() {
|
|
|
+ this.disabledBtn = true;
|
|
|
var data = JSON.parse(JSON.stringify(this.listData));
|
|
|
data.beforeStartTime = this.$methodsTools.time10to13(
|
|
|
data.beforeStartTime,
|
|
@@ -757,20 +768,30 @@ export default {
|
|
|
data.beforeEndTime = this.$methodsTools.time10to13(data.beforeEndTime, 1);
|
|
|
if (this.statusPop === 1) {
|
|
|
data.status = 0;
|
|
|
- this.$api.appsystembefore(data).then((res) => {
|
|
|
- this.$message.success("新增成功");
|
|
|
- this.dialogVisible = false;
|
|
|
- this.search();
|
|
|
- this.$store.commit("BEFORELIST");
|
|
|
- });
|
|
|
+ this.$api
|
|
|
+ .appsystembefore(data)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.search();
|
|
|
+ this.$store.commit("BEFORELIST");
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.disabledBtn = false;
|
|
|
+ });
|
|
|
}
|
|
|
if (this.statusPop === 0) {
|
|
|
- this.$api.editsystembefore(data).then((res) => {
|
|
|
- this.$message.success("修改成功");
|
|
|
- this.dialogVisible = false;
|
|
|
- this.search();
|
|
|
- this.$store.commit("BEFORELIST");
|
|
|
- });
|
|
|
+ this.$api
|
|
|
+ .editsystembefore(data)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.search();
|
|
|
+ this.$store.commit("BEFORELIST");
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.disabledBtn = false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
close() {
|