|
@@ -30,7 +30,7 @@
|
|
|
<multi-upload v-model="formData.image" :disabled="'image'==subColumn"></multi-upload>
|
|
<multi-upload v-model="formData.image" :disabled="'image'==subColumn"></multi-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="productContent" label="详情">
|
|
<el-form-item prop="productContent" label="详情">
|
|
|
- <el-input v-model="formData.productContent" :disabled="'productContent'==subColumn"></el-input>
|
|
|
|
|
|
|
+ <rich-text :height="500" v-model="formData.productContent" :noImage="true"></rich-text>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item prop="stockNum" label="数量">
|
|
<el-form-item prop="stockNum" label="数量">
|
|
|
<el-input type="number" v-model="formData.stockNum" :disabled="'stockNum'==subColumn"></el-input>
|
|
<el-input type="number" v-model="formData.stockNum" :disabled="'stockNum'==subColumn"></el-input>
|
|
@@ -89,7 +89,8 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import formValidator from '../formValidator'
|
|
|
|
|
|
|
+import formValidator from '../formValidator';
|
|
|
|
|
+import RichText from '../components/RichText';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
created() {
|
|
created() {
|
|
@@ -99,46 +100,51 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (this.$route.query.id) {
|
|
if (this.$route.query.id) {
|
|
|
- this.$http.get({
|
|
|
|
|
- url: '/productInfo/getOne',
|
|
|
|
|
- data: {
|
|
|
|
|
- id: this.$route.query.id
|
|
|
|
|
- }
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.success) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.$http
|
|
|
|
|
+ .get({
|
|
|
|
|
+ url: '/productInfo/getOne',
|
|
|
|
|
+ data: {
|
|
|
|
|
+ id: this.$route.query.id,
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.success) {
|
|
|
|
|
+ if (res.data.image) {
|
|
|
|
|
+ res.data.image = res.data.image.split(',');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- this.formData = res.data;
|
|
|
|
|
|
|
+ this.formData = res.data;
|
|
|
|
|
|
|
|
- if (this.$route.query.column) {
|
|
|
|
|
- this.formData[this.subColumn] = this.subValue;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (this.$route.query.column) {
|
|
|
|
|
+ this.formData[this.subColumn] = this.subValue;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- this.formData.shelfFlag =
|
|
|
|
|
|
|
+ this.formData.shelfFlag =
|
|
|
this.formData.shelfFlag == 'Y' ? true : false;
|
|
this.formData.shelfFlag == 'Y' ? true : false;
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
if (this.$route.query.column) {
|
|
if (this.$route.query.column) {
|
|
|
this.formData[this.subColumn] = this.subValue;
|
|
this.formData[this.subColumn] = this.subValue;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- this.$http.get({
|
|
|
|
|
- url: '/landMark/all'
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.success) {
|
|
|
|
|
-
|
|
|
|
|
- if (res.data.length > 0) {
|
|
|
|
|
- res.data.forEach(item => {
|
|
|
|
|
- this.landmarkIdOptions.push({ label: item.mapName, value: item.id });
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.$http
|
|
|
|
|
+ .get({
|
|
|
|
|
+ url: '/landMark/noMapAll',
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.success) {
|
|
|
|
|
+ if (res.data.length > 0) {
|
|
|
|
|
+ res.data.forEach(item => {
|
|
|
|
|
+ this.landmarkIdOptions.push({
|
|
|
|
|
+ label: item.mapName,
|
|
|
|
|
+ value: item.id,
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -146,32 +152,37 @@ export default {
|
|
|
formData: {
|
|
formData: {
|
|
|
typeFlag: 0,
|
|
typeFlag: 0,
|
|
|
},
|
|
},
|
|
|
- rules: {
|
|
|
|
|
- },
|
|
|
|
|
- typeFlagOptions: [{
|
|
|
|
|
- value: 0,
|
|
|
|
|
- label: '门票'
|
|
|
|
|
- }, {
|
|
|
|
|
- value: 1,
|
|
|
|
|
- label: '导航包'
|
|
|
|
|
- }, {
|
|
|
|
|
- value: 2,
|
|
|
|
|
- label: '实物券'
|
|
|
|
|
- }, {
|
|
|
|
|
- value: 3,
|
|
|
|
|
- label: '优惠券'
|
|
|
|
|
- }, {
|
|
|
|
|
- value: 4,
|
|
|
|
|
- label: '组合商品'
|
|
|
|
|
- }],
|
|
|
|
|
|
|
+ rules: {},
|
|
|
|
|
+ typeFlagOptions: [
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 0,
|
|
|
|
|
+ label: '门票',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 1,
|
|
|
|
|
+ label: '导航包',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 2,
|
|
|
|
|
+ label: '实物券',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 3,
|
|
|
|
|
+ label: '优惠券',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: 4,
|
|
|
|
|
+ label: '组合商品',
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
landmarkIdOptions: [],
|
|
landmarkIdOptions: [],
|
|
|
subColumn: '',
|
|
subColumn: '',
|
|
|
subValue: '',
|
|
subValue: '',
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
onSave() {
|
|
onSave() {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
|
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
this.submit();
|
|
this.submit();
|
|
|
} else {
|
|
} else {
|
|
@@ -182,39 +193,51 @@ export default {
|
|
|
submit() {
|
|
submit() {
|
|
|
var data = JSON.parse(JSON.stringify(this.formData));
|
|
var data = JSON.parse(JSON.stringify(this.formData));
|
|
|
|
|
|
|
|
- data.shelfFlag = this.formData.shelfFlag ? 'Y' : 'N';
|
|
|
|
|
-
|
|
|
|
|
- this.$http.post({
|
|
|
|
|
- url: this.formData.id ? '/productInfo/update' : '/productInfo/save',
|
|
|
|
|
- data: data
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.success) {
|
|
|
|
|
- this.$message.success('成功');
|
|
|
|
|
- this.$router.go(-1);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.warning('失败')
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ data.shelfFlag = this.formData.shelfFlag ? 'Y' : 'N';
|
|
|
|
|
+
|
|
|
|
|
+ this.$http
|
|
|
|
|
+ .post({
|
|
|
|
|
+ url: this.formData.id
|
|
|
|
|
+ ? '/productInfo/update'
|
|
|
|
|
+ : '/productInfo/save',
|
|
|
|
|
+ data: data,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.success) {
|
|
|
|
|
+ this.$message.success('成功');
|
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning('失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
onDelete() {
|
|
onDelete() {
|
|
|
- this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
|
|
|
|
|
- return this.$http.post({
|
|
|
|
|
- url: '/productInfo/del',
|
|
|
|
|
- data: { id: this.formData.id }
|
|
|
|
|
- })
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.$message.success('删除成功');
|
|
|
|
|
- this.$router.go(-1);
|
|
|
|
|
- }).catch(action => {
|
|
|
|
|
- if (action === 'cancel') {
|
|
|
|
|
- this.$message.info('删除取消');
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error('删除失败');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.$alert('删除将无法恢复,确认要删除么?', '警告', {
|
|
|
|
|
+ type: 'error',
|
|
|
})
|
|
})
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ return this.$http.post({
|
|
|
|
|
+ url: '/productInfo/del',
|
|
|
|
|
+ data: { id: this.formData.id },
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(action => {
|
|
|
|
|
+ if (action === 'cancel') {
|
|
|
|
|
+ this.$message.info('删除取消');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('删除失败');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ components: {
|
|
|
|
|
+ RichText,
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
</style>
|
|
</style>
|