|
@@ -1,5 +1,21 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
|
+ <el-row :gutter="24">
|
|
|
|
+ <el-col :span="4">
|
|
|
|
+ <el-card style="height: 100%; min-height: 100vh;">
|
|
|
|
+ <div style="marginTop:20px;margin-left: 10px;">
|
|
|
|
+ <el-tree
|
|
|
|
+ :data="productNameList"
|
|
|
|
+ v-model="table.getdataListParm.parammaps.categoryId"
|
|
|
|
+ :props="defaultProps"
|
|
|
|
+ @node-click="handleNodeClick"
|
|
|
|
+ style="font-size: 26px;"
|
|
|
|
+ :disabled="false"
|
|
|
|
+ ></el-tree>
|
|
|
|
+ </div>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="20">
|
|
<div class="operation">
|
|
<div class="operation">
|
|
<el-button v-if="isRoleEdit" class="success" style="float: left;margin-right:10px;" @click="form_add">添加</el-button>
|
|
<el-button v-if="isRoleEdit" class="success" style="float: left;margin-right:10px;" @click="form_add">添加</el-button>
|
|
|
|
|
|
@@ -14,10 +30,28 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="search">
|
|
<div class="search">
|
|
- <el-select v-model="table.getdataListParm.parammaps.categoryId" placeholder="客户名称" class="filter-item" style="width: 120px;" clearable>
|
|
|
|
|
|
+ <!-- <el-select v-model="table.getdataListParm.parammaps.categoryId" placeholder="产品类别" class="filter-item" style="width: 120px;" clearable>
|
|
<el-option v-for="(item,index) in productNameList" :key="index" :label="item.name" :value="item.id" />
|
|
<el-option v-for="(item,index) in productNameList" :key="index" :label="item.name" :value="item.id" />
|
|
- </el-select>
|
|
|
|
|
|
+ </el-select> -->
|
|
|
|
+ <tree-select
|
|
|
|
+ v-model="table.getdataListParm.parammaps.categoryId"
|
|
|
|
+ class="typeSelect"
|
|
|
|
+ :height="300"
|
|
|
|
+ :width="250"
|
|
|
|
+ clearable
|
|
|
|
+ :data="productNameList"
|
|
|
|
+ :placeholder="placeholder"
|
|
|
|
+ style="display: inline-block"
|
|
|
|
+ :default-props="defaultProps"
|
|
|
|
+ :node-key="nodeKey"
|
|
|
|
+ :checked-keys="defaultCheckedKeysSelect"
|
|
|
|
+ @popoverHide="popoverHideSelect"
|
|
|
|
+ :disabled="false"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+
|
|
<el-input v-model="table.getdataListParm.parammaps.pname" placeholder="产品名称" style="width: 180px;" class="filter-item" clearable />
|
|
<el-input v-model="table.getdataListParm.parammaps.pname" placeholder="产品名称" style="width: 180px;" class="filter-item" clearable />
|
|
|
|
+ <el-input v-model="table.getdataListParm.parammaps.pcode" placeholder="产品编码" style="width: 180px;" class="filter-item" clearable />
|
|
<el-input v-model="table.getdataListParm.parammaps.model" placeholder="产品型号" style="width: 180px;" class="filter-item" clearable />
|
|
<el-input v-model="table.getdataListParm.parammaps.model" placeholder="产品型号" style="width: 180px;" class="filter-item" clearable />
|
|
<el-input v-model="table.getdataListParm.parammaps.Specifications" placeholder="产品规格" style="width: 180px;" class="filter-item" clearable />
|
|
<el-input v-model="table.getdataListParm.parammaps.Specifications" placeholder="产品规格" style="width: 180px;" class="filter-item" clearable />
|
|
|
|
|
|
@@ -38,6 +72,11 @@
|
|
<span>{{ scope.row.cname }}</span>
|
|
<span>{{ scope.row.cname }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column label="产品编码" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.pcode }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="产品名称" min-width="150px" align="center">
|
|
<el-table-column label="产品名称" min-width="150px" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.pname }}</span>
|
|
<span>{{ scope.row.pname }}</span>
|
|
@@ -53,6 +92,24 @@
|
|
<span>{{ scope.row.Specifications }}</span>
|
|
<span>{{ scope.row.Specifications }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column label="产品图片" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-popover placement="right" title="" trigger="hover">
|
|
|
|
+ <img
|
|
|
|
+ slot="reference"
|
|
|
|
+ :src="scope.row.imagePath"
|
|
|
|
+ style="height: 100px; width: 100px"
|
|
|
|
+ />
|
|
|
|
+ <!-- 悬停时显示的内容 -->
|
|
|
|
+ <img
|
|
|
|
+ :src="scope.row.imagePath"
|
|
|
|
+ style="height: 200px; width: 200px"
|
|
|
|
+ />
|
|
|
|
+ </el-popover>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
<el-table-column label="备注" min-width="150px" align="center">
|
|
<el-table-column label="备注" min-width="150px" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.remark }}</span>
|
|
<span>{{ scope.row.remark }}</span>
|
|
@@ -86,10 +143,27 @@
|
|
<div class="app-add">
|
|
<div class="app-add">
|
|
<el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
|
|
<el-form ref="temp" :rules="create.rules" :model="create.temp" label-position="right" label-width="150px" style="width: 80%;margin:0 auto 50px">
|
|
|
|
|
|
- <el-form-item label="产品类别:" prop="categoryId">
|
|
|
|
- <el-select ref="categoryId" v-model="create.temp.categoryId" filterable placeholder="请选择类别" class="filter-item" style="width: 100%;" @change="change_bar" :disabled="create.dialogStatus=='see'">
|
|
|
|
- <el-option v-for="(item,index) in productNameList" :key="index" :label="item.name" :value="item.id" />
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-form-item label="产品类别:" style="width: 400px;" class="filter-item" prop="categoryId">
|
|
|
|
+ <tree-select
|
|
|
|
+ class="typeSelect"
|
|
|
|
+ :height="300"
|
|
|
|
+ :width="250"
|
|
|
|
+ size="small"
|
|
|
|
+ clearable
|
|
|
|
+ :data="productNameList"
|
|
|
|
+ :placeholder="placeholder"
|
|
|
|
+ style="display:inline-block;"
|
|
|
|
+ :default-props="defaultProps"
|
|
|
|
+ :node-key="nodeKey"
|
|
|
|
+ :checked-keys="defaultCheckedKeys"
|
|
|
|
+ @popoverHide="popoverHide"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-form-item label="产品编码:" prop="pcode">
|
|
|
|
+ <el-input ref="pname" v-model="create.temp.pcode" class="filter-item" style="width: 100%;" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="产品名称:" prop="pname">
|
|
<el-form-item label="产品名称:" prop="pname">
|
|
@@ -103,41 +177,86 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="备注:" prop="remark">
|
|
<el-form-item label="备注:" prop="remark">
|
|
- <el-input ref="remark" v-model="create.temp.remark" />
|
|
|
|
|
|
+ <el-input ref="remark" class="filter-item" v-model="create.temp.remark" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="顺序:" prop="sort">
|
|
<el-form-item label="顺序:" prop="sort">
|
|
- <el-input ref="sort" v-model="create.temp.sort" />
|
|
|
|
|
|
+ <el-input ref="sort" class="filter-item" v-model="create.temp.sort" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="启用:" prop="enable">
|
|
<el-form-item label="启用:" prop="enable">
|
|
- <el-switch ref="enable" v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
|
|
|
|
|
|
+ <el-switch ref="enable" class="filter-item" v-model="create.temp.enable" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
+
|
|
|
|
+ <el-form-item label="产品图片:">
|
|
|
|
+ <el-upload id="uploadPic"
|
|
|
|
+ :action="uploadImageUrl"
|
|
|
|
+ :limit='1'
|
|
|
|
+ :file-list="fileList"
|
|
|
|
+ list-type="picture-card"
|
|
|
|
+ :on-preview="handlePictureCardPreview"
|
|
|
|
+ :on-change="(file, fileList) => handlePicChange(file, fileList)"
|
|
|
|
+ :on-success="(response, file, fileList) => handlePicSuccess(response, file, fileList)"
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :disabled="isView"
|
|
|
|
+ :on-remove="(file, fileList) => handlePicRemove(file, fileList)"
|
|
|
|
+ >
|
|
|
|
+ <i slot="default" class="el-icon-plus"></i>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-dialog :visible.sync="dialogVisible">
|
|
|
|
+ <img width="100%" :src="dialogImageUrl" alt="">
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button class="cancelClose" @click="create.dialogFormVisible = false;get_table_data()">关闭</el-button>
|
|
|
|
- <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" @click="create.dialogStatus==='create'?add_dialog_save():form_edit_save()">确认</el-button>
|
|
|
|
|
|
+ <el-button class="cancelClose" @click="create.dialogFormVisible = false;defaultCheckedKeys = [];this.dialogImageUrl = '';get_table_data()">关闭</el-button>
|
|
|
|
+ <el-button v-if="create.dialogStatus==='create' || create.dialogStatus==='update'" class="success" @click="create.dialogStatus==='create'?add_dialog_save():form_edit_save();this.dialogImageUrl = '';">确认</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth } from '@/api/common'
|
|
|
|
|
|
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth,transData } from '@/api/common'
|
|
import { isIntegerZero } from '@/utils/validate'
|
|
import { isIntegerZero } from '@/utils/validate'
|
|
-import Cookies from 'js-cookie'
|
|
|
|
|
|
+import Cookies from 'js-cookie'
|
|
|
|
+import TreeSelect from '@/components/TreeSelect';
|
|
import { parseTime } from '@/utils/index.js'
|
|
import { parseTime } from '@/utils/index.js'
|
|
import Pagination from '@/components/Pagination'
|
|
import Pagination from '@/components/Pagination'
|
|
import { MessageBox } from 'element-ui'
|
|
import { MessageBox } from 'element-ui'
|
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'ProductList',
|
|
name: 'ProductList',
|
|
- components: { Pagination },
|
|
|
|
|
|
+ components: { Pagination,TreeSelect },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ handlePictureCardPreview(file) {
|
|
|
|
+ this.dialogImageUrl = file.url;
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ },
|
|
|
|
|
|
|
|
+ dialogImageUrl: '',
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ uploadImageUrl: process.env.VUE_APP_BASE_API + 'authdata/uploaderimage',
|
|
|
|
+ //图片请求头
|
|
|
|
+ headers: { optname: 'insertcustompic', id: 1,token: getToken()},
|
|
isRoleEdit: [],
|
|
isRoleEdit: [],
|
|
productNameList: [], // 产品类别下拉框
|
|
productNameList: [], // 产品类别下拉框
|
|
|
|
+ placeholder: '请选择上级分类',
|
|
|
|
+ defaultProps: {
|
|
|
|
+ children: 'children',
|
|
|
|
+ label: 'name', // 根据实际字段名调整
|
|
|
|
+ },
|
|
|
|
+ disabled: false, // 是否禁用
|
|
|
|
+ nodeKey: 'id', // 节点的唯一标识字段
|
|
|
|
+ defaultCheckedKeys: [],
|
|
|
|
+ defaultCheckedKeysSelect :[],
|
|
|
|
+ fileList: [],
|
|
//表格请求参数~
|
|
//表格请求参数~
|
|
table: {
|
|
table: {
|
|
getdataListParm: {
|
|
getdataListParm: {
|
|
@@ -151,6 +270,7 @@ export default {
|
|
pname: '',
|
|
pname: '',
|
|
model: '',
|
|
model: '',
|
|
Specifications: '',
|
|
Specifications: '',
|
|
|
|
+ pcode:'',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
tableKey: 0,
|
|
tableKey: 0,
|
|
@@ -171,14 +291,16 @@ export default {
|
|
Specifications: '',
|
|
Specifications: '',
|
|
remark: '',
|
|
remark: '',
|
|
sort: '',
|
|
sort: '',
|
|
- enable: 1
|
|
|
|
|
|
+ enable: 1,
|
|
|
|
+ pcode:'',
|
|
|
|
+ pImage:'',
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
pname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
pname: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
model: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
model: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
Specifications: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
Specifications: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }],
|
|
- sort: [{ validator: isIntegerZero, trigger: 'blur' }]
|
|
|
|
-
|
|
|
|
|
|
+ sort: [{ validator: isIntegerZero, trigger: 'blur' }],
|
|
|
|
+ pcode: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
|
|
},
|
|
},
|
|
},
|
|
},
|
|
textMap: {
|
|
textMap: {
|
|
@@ -192,7 +314,15 @@ export default {
|
|
cellStyle: { padding: 0 + 'px' }
|
|
cellStyle: { padding: 0 + 'px' }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ computed: {
|
|
|
|
+ // 设置请求头
|
|
|
|
+ headers() {
|
|
|
|
+ return {
|
|
|
|
+ // 设置token
|
|
|
|
+ token: getToken()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
this.get_table_data()
|
|
this.get_table_data()
|
|
|
|
|
|
@@ -202,6 +332,56 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ handlePicChange(file, fileList) {
|
|
|
|
+
|
|
|
|
+},
|
|
|
|
+ handlePicRemove(file, fileList) {
|
|
|
|
+ console.log(file, fileList);
|
|
|
|
+ console.log(fileList.length);
|
|
|
|
+ if (fileList.length == 1) {
|
|
|
|
+ document.getElementById('uploadPic').lastChild.style.display = "none"
|
|
|
|
+ } else {
|
|
|
|
+ document.getElementById('uploadPic').lastChild.style.display = "inline-block"
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handlePicSuccess(response, file, fileList) {
|
|
|
|
+
|
|
|
|
+ if (fileList.length == 1) {
|
|
|
|
+ document.getElementById('uploadPic').lastChild.style.display = "none"
|
|
|
|
+ } else {
|
|
|
|
+ document.getElementById('uploadPic').lastChild.style.display = "inline-block"
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.create.temp, 'pImage', response.execresult.LastInsertId);
|
|
|
|
+ },
|
|
|
|
+ andlePictureCardPreview(file) {
|
|
|
|
+ this.dialogImageUrl = file.url;
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ popoverHideSelect(checkedIds, checkedData) {
|
|
|
|
+ if (checkedIds !== null) {
|
|
|
|
+ this.table.getdataListParm.parammaps.categoryId = checkedData.id;
|
|
|
|
+ } else {
|
|
|
|
+ this.table.getdataListParm.parammaps.categoryId ='';
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleNodeClick(data, node) {
|
|
|
|
+ this.table.getdataListParm.parammaps.categoryId = data.id;
|
|
|
|
+ this.get_table_data_left();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ popoverHide(checkedIds, checkedData) {
|
|
|
|
+ console.log(checkedIds, checkedData);
|
|
|
|
+ if (checkedData == null) {
|
|
|
|
+ this.$set(this.create.temp, 'pcode', '');
|
|
|
|
+ this.create.temp.categoryId = '';
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this.create.temp, 'pcode', checkedData.code);
|
|
|
|
+ this.create.temp.categoryId = checkedData.id;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
//获取按钮权限
|
|
//获取按钮权限
|
|
get_auto_buttons() {
|
|
get_auto_buttons() {
|
|
const Edit = 'DungScores'
|
|
const Edit = 'DungScores'
|
|
@@ -213,7 +393,8 @@ export default {
|
|
get_select_list() {
|
|
get_select_list() {
|
|
GetDataByName({ name: 'getCategorySelect', offset: 0, pagecount: 0, parammaps: {} }, ).then(response => {
|
|
GetDataByName({ name: 'getCategorySelect', offset: 0, pagecount: 0, parammaps: {} }, ).then(response => {
|
|
this.productNameList = response.data.list
|
|
this.productNameList = response.data.list
|
|
- console.log("产品类别下拉框", response)
|
|
|
|
|
|
+ this.productNameList= transData(response.data.list, 'id', 'pid', 'children');
|
|
|
|
+ console.log("产品类别下拉框", response);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -227,6 +408,11 @@ export default {
|
|
if (response.data.list !== null) {
|
|
if (response.data.list !== null) {
|
|
for (var i = 0; i < response.data.list.length; i++) {
|
|
for (var i = 0; i < response.data.list.length; i++) {
|
|
response.data.list[i].enable = parseInt(response.data.list[i].enable)
|
|
response.data.list[i].enable = parseInt(response.data.list[i].enable)
|
|
|
|
+ if ( response.data.list[i].pImage !== '') {
|
|
|
|
+ response.data.list[i].imagePath = process.env.VUE_APP_BASE_API + response.data.list[i].imagePath;
|
|
|
|
+ } else {
|
|
|
|
+ response.data.list[i].imagePath = ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
this.table.list = response.data.list
|
|
this.table.list = response.data.list
|
|
@@ -241,6 +427,29 @@ export default {
|
|
}, 100)
|
|
}, 100)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ get_table_data_left() {
|
|
|
|
+ this.table.listLoading = true
|
|
|
|
+ console.log("this.table.getdataListParm======>", this.table.getdataListParm)
|
|
|
|
+ GetDataByName(this.table.getdataListParm).then(response => {
|
|
|
|
+ console.log('table数据======>', response.data.list)
|
|
|
|
+ if (response.data.list !== null) {
|
|
|
|
+ for (var i = 0; i < response.data.list.length; i++) {
|
|
|
|
+ response.data.list[i].enable = parseInt(response.data.list[i].enable)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.table.list = response.data.list
|
|
|
|
+ this.table.pageNum = response.data.pageNum
|
|
|
|
+ this.table.pageSize = response.data.pageSize
|
|
|
|
+ this.table.total = response.data.total
|
|
|
|
+ } else {
|
|
|
|
+ this.table.list = []
|
|
|
|
+ }
|
|
|
|
+ this.table.getdataListParm.parammaps.categoryId = '';
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.table.listLoading = false
|
|
|
|
+ }, 100)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
form_search() {
|
|
form_search() {
|
|
console.log('点击了查询')
|
|
console.log('点击了查询')
|
|
|
|
|
|
@@ -272,8 +481,19 @@ export default {
|
|
form_add() {
|
|
form_add() {
|
|
console.log('点击了新增')
|
|
console.log('点击了新增')
|
|
this.form_reset()
|
|
this.form_reset()
|
|
|
|
+ // this.dialogImageUrl = row.imagePath;
|
|
this.create.dialogStatus = 'create'
|
|
this.create.dialogStatus = 'create'
|
|
this.create.dialogFormVisible = true
|
|
this.create.dialogFormVisible = true
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ // if (row.imagePath !== ''){
|
|
|
|
+ // const fileList = [];
|
|
|
|
+ // var urlObj = { "url": "", "response": { "execresult": { "LastInsertId": "" } } };
|
|
|
|
+ // urlObj.url = row.imagePath;
|
|
|
|
+ // urlObj.response.execresult.LastInsertId = row.pImage;
|
|
|
|
+ // fileList.push(urlObj);
|
|
|
|
+ // this.fileList = fileList;
|
|
|
|
+ // }
|
|
|
|
+
|
|
},
|
|
},
|
|
//添加保存
|
|
//添加保存
|
|
add_dialog_save() {
|
|
add_dialog_save() {
|
|
@@ -284,19 +504,36 @@ export default {
|
|
//新增保存
|
|
//新增保存
|
|
this.requestParam.name = 'insertProducts'
|
|
this.requestParam.name = 'insertProducts'
|
|
this.requestParam.parammaps = this.create.temp
|
|
this.requestParam.parammaps = this.create.temp
|
|
- PostDataByName(this.requestParam).then(response => {
|
|
|
|
|
|
+
|
|
|
|
+ this.requestParam = {
|
|
|
|
+ data: [
|
|
|
|
+ {
|
|
|
|
+ name: "CheckProductPCode",
|
|
|
|
+ type: "v",
|
|
|
|
+ parammaps :{
|
|
|
|
+ pcode :this.create.temp.pcode,
|
|
|
|
+ id :''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: "insertProducts",
|
|
|
|
+ type: "e",
|
|
|
|
+ parammaps: this.create.temp,
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ExecDataByConfig(this.requestParam).then(response => {
|
|
console.log('新增保存发送参数', this.requestParam)
|
|
console.log('新增保存发送参数', this.requestParam)
|
|
if (response.msg !== 'fail') {
|
|
if (response.msg !== 'fail') {
|
|
|
|
+ this.defaultCheckedKeys = [];
|
|
this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
this.create.dialogFormVisible = false
|
|
this.create.dialogFormVisible = false
|
|
this.get_table_data()
|
|
this.get_table_data()
|
|
} else {
|
|
} else {
|
|
- this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
|
|
|
|
|
|
+ this.$notify({ title: '失败', message: response.data, type: 'error', duration: 2000 })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -306,24 +543,57 @@ export default {
|
|
form_edit(row) {
|
|
form_edit(row) {
|
|
console.log('点击了编辑', row)
|
|
console.log('点击了编辑', row)
|
|
row.categoryId = String(row.categoryId)
|
|
row.categoryId = String(row.categoryId)
|
|
-
|
|
|
|
|
|
+ // this.dialogImageUrl = row.imagePath;
|
|
this.create.temp = Object.assign({}, row)
|
|
this.create.temp = Object.assign({}, row)
|
|
this.create.temp.id = row.id
|
|
this.create.temp.id = row.id
|
|
this.create.dialogStatus = 'update'
|
|
this.create.dialogStatus = 'update'
|
|
this.create.dialogFormVisible = true
|
|
this.create.dialogFormVisible = true
|
|
|
|
+ // this.create.pcode = row.pcode;
|
|
|
|
+ this.defaultCheckedKeys =[row.categoryId] ;
|
|
|
|
+ console.log(row.imagePath);
|
|
|
|
+ if (row.pImage !== ''){
|
|
|
|
+ const fileList = [];
|
|
|
|
+ var urlObj = { "url": "", "response": { "execresult": { "LastInsertId": "" } } };
|
|
|
|
+ urlObj.url = row.imagePath;
|
|
|
|
+ urlObj.response.execresult.LastInsertId = row.pImage;
|
|
|
|
+ fileList.push(urlObj);
|
|
|
|
+ this.fileList = fileList;
|
|
|
|
+ }else{
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ this.dialogImageUrl = '';
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 编辑保存
|
|
// 编辑保存
|
|
form_edit_save() {
|
|
form_edit_save() {
|
|
this.$refs['temp'].validate(valid => {
|
|
this.$refs['temp'].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- this.requestParam.name = 'updateProducts'
|
|
|
|
- this.requestParam.parammaps = this.create.temp
|
|
|
|
- PostDataByName(this.requestParam).then(response => {
|
|
|
|
|
|
+ // this.requestParam.name = 'updateProducts'
|
|
|
|
+ // this.requestParam.parammaps = this.create.temp
|
|
|
|
+
|
|
|
|
+ this.requestParam = {
|
|
|
|
+ data: [
|
|
|
|
+ {
|
|
|
|
+ name: "CheckProductPCode",
|
|
|
|
+ type: "v",
|
|
|
|
+ parammaps :{
|
|
|
|
+ pcode :this.create.temp.pcode,
|
|
|
|
+ id : this.create.temp.id
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: "updateProducts",
|
|
|
|
+ type: "e",
|
|
|
|
+ parammaps: this.create.temp,
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ ExecDataByConfig(this.requestParam).then(response => {
|
|
console.log('编辑保存发送参数', this.requestParam)
|
|
console.log('编辑保存发送参数', this.requestParam)
|
|
if (response.msg !== 'fail') {
|
|
if (response.msg !== 'fail') {
|
|
this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|
|
this.create.dialogFormVisible = false
|
|
this.create.dialogFormVisible = false
|
|
|
|
+ this.defaultCheckedKeys = [];
|
|
this.get_table_data()
|
|
this.get_table_data()
|
|
} else {
|
|
} else {
|
|
this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
|
|
this.$notify({ title: '失败', message: '保存失败', type: 'error', duration: 2000 })
|
|
@@ -411,3 +681,9 @@ export default {
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.custom-tree {
|
|
|
|
+ font-size: 26px; /* 设置字体大小 */
|
|
|
|
+}
|
|
|
|
+</style>
|