|
@@ -14,7 +14,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-col :span="24" class="one"> <span>规格管理</span> </el-col>
|
|
|
-
|
|
|
<data-search :fields="searchFields" v-model="searchInfo" @query="search">
|
|
|
<template #status>
|
|
|
<el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
@@ -54,6 +53,7 @@
|
|
|
// 找到该商品下的规格定义
|
|
|
const _ = require('lodash');
|
|
|
import methodUtil from '@/util/opera';
|
|
|
+import { isCheckMoney } from '@/util/onlynum';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions } = createNamespacedHelpers('goodsSpec');
|
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
@@ -64,6 +64,14 @@ export default {
|
|
|
props: {},
|
|
|
components: {},
|
|
|
data: function () {
|
|
|
+ var checkMoney = (rule, value, callback) => {
|
|
|
+ var errorMsg = isCheckMoney(value);
|
|
|
+ if (errorMsg != '') {
|
|
|
+ callback(new Error(errorMsg));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
view: 'list',
|
|
|
fields: [
|
|
@@ -112,10 +120,12 @@ export default {
|
|
|
{ label: '运费', model: 'freight', type: 'number' },
|
|
|
{ label: '状态', model: 'status', type: 'select' },
|
|
|
{ label: '团长价格', model: 'leader_price', type: 'number' },
|
|
|
- { label: '图片', model: 'file', type: 'upload', url: '/files/point/goodsSpec/upload' },
|
|
|
+ { label: '图片', model: 'file', type: 'upload', url: '/files/point/goodsSpec/upload', limit: 1 },
|
|
|
],
|
|
|
rules: {
|
|
|
freight: [{ required: true, message: '请输入运费', trigger: 'blur' }],
|
|
|
+ sell_money: [{ require: false, validator: checkMoney }],
|
|
|
+ flow_money: [{ require: false, validator: checkMoney }],
|
|
|
},
|
|
|
form: {},
|
|
|
|
|
@@ -142,7 +152,7 @@ export default {
|
|
|
methods: {
|
|
|
...dictData({ getDict: 'query' }),
|
|
|
...mapActions(['query', 'fetch', 'update', 'delete', 'create']),
|
|
|
- ...goods({ goodsFetch: 'fetch' }),
|
|
|
+ ...goods({ goodsFetch: 'fetch', goodsUpdate: 'update' }),
|
|
|
...methodUtil,
|
|
|
// 添加自定义
|
|
|
initAddData() {
|