|
@@ -54,7 +54,6 @@
|
|
|
<el-form-item label="单位:" prop="unit" class="custom-align-right">
|
|
|
<el-input v-model="form.unit" autocomplete="off" placeholder="请输入单位"></el-input>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
<el-form-item label="最小定量:" prop="min" class="custom-align-right">
|
|
|
<el-input v-model="form.min" autocomplete="off" placeholder="请输入最小定量"></el-input>
|
|
|
</el-form-item>
|
|
@@ -64,16 +63,14 @@
|
|
|
<el-form-item label="有效期:" prop="validity" class="custom-align-right">
|
|
|
<el-date-picker v-model="form.validity" type="date" placeholder="选择日期" :disabled="form.islong == 1">
|
|
|
</el-date-picker>
|
|
|
-
|
|
|
- <el-checkbox v-model="form.islong">无期限</el-checkbox>
|
|
|
+ <el-checkbox v-model="form.islong" @change="checked => selectChange(checked)">无期限</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div v-if="form.type_id == 2">
|
|
|
-
|
|
|
<el-form-item label="截止日期:" prop="validity" class="custom-align-right">
|
|
|
<el-date-picker v-model="form.validity" type="date" placeholder="选择日期" :disabled="form.islong == 1">
|
|
|
</el-date-picker>
|
|
|
- <el-checkbox v-model="form.islong">无期限</el-checkbox>
|
|
|
+ <el-checkbox v-model="form.islong" @change="checked => selectChange(checked)">无期限</el-checkbox>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<el-form-item label="商品图:" class="custom-align-right" prop="imgurl">
|
|
@@ -109,13 +106,34 @@
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+<<<<<<< Updated upstream
|
|
|
<div class="imgBox" style="margin-left: 125px ;margin-bottom: 20px; padding-top: -20px;">
|
|
|
最多可上传5张,每张图片大小不能超过 500 K,推荐上传图片尺寸 宽1000像素 高1000像素。(首张显示为商品头图)
|
|
|
</div>
|
|
|
<el-form-item label="商品关键词:" prop="keyword" class="custom-align-right">
|
|
|
+=======
|
|
|
+ <div class="imgBox" style="margin-left: 100px ;margin-bottom: 20px; padding-top: -20px;">
|
|
|
+ 最多可上传5张,每张图片大小不能超过500K,推荐上传图片尺寸
|
|
|
+ 宽1000像素 高1000像素。(首张显示为商品头图)</div>
|
|
|
+ <!-- <el-form-item label="商品关键词:" prop="keyword" class="custom-align-right">
|
|
|
+>>>>>>> Stashed changes
|
|
|
<el-input v-model="form.keyword" autocomplete="off" placeholder="请输入商品关键词"></el-input>
|
|
|
+ </el-form-item> -->
|
|
|
+
|
|
|
+ <el-form-item label="商品关键词:" prop="keyword" class="custom-align-right">
|
|
|
+ <template #label>
|
|
|
+ <span class="askBox">
|
|
|
+ 商品关键词:
|
|
|
+ <el-tooltip class="item" effect="dark" content="商品关键词,如:三农市场网、全国三农、信息一体化。" placement="top">
|
|
|
+ <i class="el-icon-question"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <tagInput :initialTags="tags" @tags-updated="updateTags"></tagInput>
|
|
|
</el-form-item>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
<el-form-item label="商品描述:" prop="description" class="custom-align-right">
|
|
|
<el-input v-model="form.description" maxlength="300" autocomplete="off" placeholder="请输入商品描述"
|
|
|
type="textarea" :rows="10"></el-input>
|
|
@@ -163,6 +181,8 @@
|
|
|
import { getWebSiteId, getUseType } from '@/utils/auth'
|
|
|
//表格标题
|
|
|
import tableTitle from './components/tableTitle';
|
|
|
+//引入tag标签组件
|
|
|
+import tagInput from '../../components/InputTag/index.vue';
|
|
|
//引入公用样式
|
|
|
import '@/styles/global.less';
|
|
|
//格式化时间
|
|
@@ -174,7 +194,8 @@ import myEditor from '../../components/edit/myEditor.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
tableTitle,
|
|
|
- myEditor
|
|
|
+ myEditor,
|
|
|
+ tagInput
|
|
|
},
|
|
|
data() {
|
|
|
//0.全局操作 start ------------------------------------------------------------>
|
|
@@ -215,7 +236,12 @@ export default {
|
|
|
searchCascaderKey: 0, //列表缓存key
|
|
|
// imgurl: ['http://192.168.1.127:9501/image/20250227/1740674706184955.jpg', 'http://192.168.1.127:9501/image/20250227/1740674706184955.jpg'],//图片路径
|
|
|
website_id: 2,
|
|
|
+<<<<<<< Updated upstream
|
|
|
creatNews_user_type: 0,//判断用户类型',
|
|
|
+=======
|
|
|
+ tags: [],//标签数组
|
|
|
+
|
|
|
+>>>>>>> Stashed changes
|
|
|
//提交表单
|
|
|
form: {
|
|
|
//1.1使用了外链
|
|
@@ -422,8 +448,6 @@ export default {
|
|
|
this.getMainData();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
// 监听路由参数中的 id 变化,若变化则更新页面状态并获取数据
|
|
|
// '$route.query.id': function (newVal, oldVal) {
|
|
|
// console.log('当前 id:', newVal, '旧的 id:', oldVal);
|
|
@@ -510,7 +534,6 @@ export default {
|
|
|
addToServe() {
|
|
|
//先进行验证
|
|
|
this.$refs.form.validate(valid => {
|
|
|
-
|
|
|
console.log(this.form.validity, 'this.form.validity-----------------')
|
|
|
if (this.form.islong == 1 && (this.form.validity == null || this.form.validity == '')) {
|
|
|
this.form.validity = '1970-01-01 00:00:00';
|
|
@@ -611,7 +634,6 @@ export default {
|
|
|
//回显推荐等级
|
|
|
this.form.imgurl = Array.isArray(res.data.imgurl) ? res.data.imgurl : JSON.parse(res.data.imgurl);
|
|
|
this.imgurl = Array.isArray(res.data.imgurl) ? res.data.imgurl : JSON.parse(res.data.imgurl);
|
|
|
- this.form.keyword = res.data.keyword;
|
|
|
this.form.type_id = res.data.type_id;
|
|
|
this.form.website_id = res.data.website_id;
|
|
|
this.form.catid = res.data.catid;
|
|
@@ -622,6 +644,7 @@ export default {
|
|
|
this.form.islong = res.data.islong == 1 ? true : false;
|
|
|
this.form.validity = res.data.validity;
|
|
|
this.form.keyword = res.data.keyword;
|
|
|
+ this.tags = res.data.keyword ? res.data.keyword.split(",") : [];
|
|
|
this.form.description = res.data.description;
|
|
|
//回显编辑器内容
|
|
|
this.$nextTick(() => {
|
|
@@ -746,6 +769,19 @@ export default {
|
|
|
this.form.level = value;
|
|
|
},
|
|
|
//跳转操作 end ------------------------------------------------------------>
|
|
|
+ //商品关键词
|
|
|
+ updateTags(newTags) {
|
|
|
+ // this.foem.seo_keywords = newTags;
|
|
|
+ this.tags = newTags;
|
|
|
+ this.form.keyword = newTags.join(',');
|
|
|
+ },
|
|
|
+ selectChange(checked){
|
|
|
+ if(checked==true){
|
|
|
+ this.form.validity = '1970-01-01 00:00:00';
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
'form.type_id': {
|
|
@@ -805,6 +841,7 @@ export default {
|
|
|
},
|
|
|
immediate: true // 立即执行一次
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
mounted() {
|
|
|
this.user_type = getUseType();
|