|
@@ -2,7 +2,6 @@
|
|
|
<div class="borderless">
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
- <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
|
|
|
<el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
@click="backToList">返回列表
|
|
|
</el-button>
|
|
@@ -23,7 +22,7 @@
|
|
|
<el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:6">
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
<avue-input-tree
|
|
|
- v-if="item.prop === 'corpsTypeId'"
|
|
|
+ v-if="item.prop === 'goodsTypeId'"
|
|
|
leaf-only
|
|
|
multiple
|
|
|
style="width: 100%;"
|
|
@@ -44,7 +43,7 @@
|
|
|
<containerTitle title="包装资料"></containerTitle>
|
|
|
<basic-container style="margin-bottom: 10px">
|
|
|
<el-row>
|
|
|
- <el-col v-for="(item,index) in packingData.column" :key="index" :span="item.span?item.span:8">
|
|
|
+ <el-col v-for="(item,index) in packingData.column" :key="index" :span="item.span?item.span:6">
|
|
|
<el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
|
|
|
<el-input type="textarea" v-if="(item.type === 'textarea')" v-model="form[item.prop]" size="small" autocomplete="off" placeholder=" "></el-input>
|
|
|
<el-select v-else-if="item.type === 'select'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
|
|
@@ -63,7 +62,7 @@
|
|
|
:data="contactsData"
|
|
|
ref="crudContact"
|
|
|
@row-save="rowContactSave"
|
|
|
- @row-del="rowDel">
|
|
|
+ @row-del="rowContactsDel">
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -82,7 +81,12 @@
|
|
|
:data="purchaseData"
|
|
|
ref="crudPurchase"
|
|
|
@row-save="rowPurchaseSave"
|
|
|
- @row-del="rowDel">
|
|
|
+ @row-del="rowPurchaseDel">
|
|
|
+ <template slot="corpId" slot-scope="{row,index}">
|
|
|
+ <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
|
|
|
+ <span style="margin-left: 12px;padding-top: 2px">{{ row.corpName }}</span>
|
|
|
+ <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="selectUser(row)">选择</el-button>
|
|
|
+ </template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -109,6 +113,45 @@
|
|
|
<avue-ueditor v-model="text" :options="options"></avue-ueditor>
|
|
|
</basic-container>
|
|
|
</el-form>
|
|
|
+ <el-dialog
|
|
|
+ title="导入供应商"
|
|
|
+ :visible.sync="userDialog"
|
|
|
+ class="el-dialogDeep"
|
|
|
+ append-to-body
|
|
|
+ width="80%">
|
|
|
+ <el-row style="margin-top: -5px;height: 0">
|
|
|
+ <el-col :span="5">
|
|
|
+ <div class="box">
|
|
|
+ <el-scrollbar>
|
|
|
+ <basic-container>
|
|
|
+ <avue-tree :option="userTreeOption" :data="userTreeData" @node-click="userNodeClick"/>
|
|
|
+ </basic-container>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="19">
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud ref="userCrud"
|
|
|
+ :option="userOption"
|
|
|
+ :data="userDataList"
|
|
|
+ :table-loading="userLoading"
|
|
|
+ :page.sync="userPage"
|
|
|
+ v-model="userForm"
|
|
|
+ @search-change="userSearchChange"
|
|
|
+ @search-reset="userSearchReset"
|
|
|
+ @refresh-change="userRefreshChange"
|
|
|
+ @selection-change="userSelectionChange"
|
|
|
+ @on-load="userOnLoad"
|
|
|
+ >
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="userDialog = false">取 消</el-button>
|
|
|
+ <el-button type="primary" :disabled="this.userSelection.length == 1 ? false:true" @click="userConfirm" >确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -117,6 +160,9 @@ import customerContact from "./configuration/customerContact.json"
|
|
|
import customerPurchase from "./configuration/customerPurchase.json"
|
|
|
import {detail, corpsattn, typeSave} from "@/api/maintenance/priceManagement"
|
|
|
import imgUploadList from "./configuration/imgUploadList.json"
|
|
|
+import { getDetail, updateDetail,getDeptTree ,priceDelete} from "@/api/basicData/commodityType";
|
|
|
+import {customerList, getDeptLazyTree} from "@/api/basicData/customerInformation"
|
|
|
+import userOption from "../customerInformation/configuration/mainList.json";
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
@@ -134,6 +180,7 @@ export default {
|
|
|
},
|
|
|
form: {},
|
|
|
disabled: false,
|
|
|
+ userDialog:false,//供应商导入窗口
|
|
|
customerContact: customerContact,
|
|
|
customerPurchase: customerPurchase,
|
|
|
imgUploadList: imgUploadList,
|
|
@@ -145,8 +192,8 @@ export default {
|
|
|
basicData: {
|
|
|
column: [
|
|
|
{
|
|
|
- label: '产品编码',
|
|
|
- prop: 'bigCharacter',
|
|
|
+ label: '商品编码',
|
|
|
+ prop: 'code',
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -155,8 +202,8 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
- label: '中文名称',
|
|
|
- prop: 'brand',
|
|
|
+ label: '商品名称',
|
|
|
+ prop: 'cname',
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -166,7 +213,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '英文名称',
|
|
|
- prop: 'status',
|
|
|
+ prop: 'ename',
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -177,17 +224,17 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '商品类别',
|
|
|
- prop: 'corpsTypeId',
|
|
|
+ prop: 'goodsTypeId',
|
|
|
rules: [
|
|
|
{
|
|
|
- required: false,
|
|
|
+ required: true,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
label: '中文规格',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'Typeno',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -198,17 +245,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '英文规格',
|
|
|
- prop: 'productCategory',
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: false,
|
|
|
- message: ' ',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]
|
|
|
- }, {
|
|
|
- label: '中文型号',
|
|
|
- prop: 'category',
|
|
|
+ prop: 'etypeno',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -217,18 +254,8 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
}, {
|
|
|
- label: '英文型号',
|
|
|
- prop: 'productCategory',
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: false,
|
|
|
- message: ' ',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]
|
|
|
- }, {
|
|
|
label: '海关中文',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'customName',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -238,7 +265,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '海关英文',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'customEname',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -248,7 +275,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '海关编码',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'customCode',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -258,7 +285,7 @@ export default {
|
|
|
]
|
|
|
},{
|
|
|
label: '退税率',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'customRate',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -280,8 +307,8 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '中文描述',
|
|
|
- prop: 'typeno',
|
|
|
- span: 6,
|
|
|
+ prop: 'nameDescription',
|
|
|
+ span: 24,
|
|
|
type:'textarea',
|
|
|
rules: [
|
|
|
{
|
|
@@ -292,8 +319,8 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '英文描述',
|
|
|
- prop: 'brandItem',
|
|
|
- span: 6,
|
|
|
+ prop: 'cnameDescription',
|
|
|
+ span: 24,
|
|
|
type:'textarea',
|
|
|
rules: [
|
|
|
{
|
|
@@ -309,7 +336,7 @@ export default {
|
|
|
column: [
|
|
|
{
|
|
|
label: '长度单位',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'lengthUnit',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -319,7 +346,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '重量单位',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'weightUnit',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -329,7 +356,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '包装单位',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'packgeunit',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -339,7 +366,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '每个体积',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'singleVolumn',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -349,7 +376,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '每个毛重',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'singleGrossWeight',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -359,7 +386,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '每个净重',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'singleWeight',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -369,7 +396,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '每箱体积',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'cntrVolumn',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -379,7 +406,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '每箱毛重',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'cntrGrossWeight',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -389,7 +416,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '每箱净重',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'cntrWeight',
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -399,7 +426,7 @@ export default {
|
|
|
]
|
|
|
}, {
|
|
|
label: '包装描述',
|
|
|
- prop: 'productCategory',
|
|
|
+ prop: 'packageDescription',
|
|
|
type:'textarea',
|
|
|
span:24,
|
|
|
rules: [
|
|
@@ -411,30 +438,61 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ detailsSelect:{},
|
|
|
+ //用户窗口定义
|
|
|
+ userTreeOption: {
|
|
|
+ nodeKey: 'id',
|
|
|
+ lazy: true,
|
|
|
+ treeLoad: function (node, resolve) {
|
|
|
+ const parentId = (node.level === 0) ? 0 : node.data.id;
|
|
|
+ getDeptLazyTree(parentId).then(res => {
|
|
|
+ resolve(res.data.data.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ leaf: !item.hasChildren
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+ size: 'small',
|
|
|
+ props: {
|
|
|
+ labelText: '标题',
|
|
|
+ label: 'title',
|
|
|
+ value: 'value',
|
|
|
+ children: 'children'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ userTreeData:[],
|
|
|
+ userOption:userOption,
|
|
|
+ userLoading:false,
|
|
|
+ userDataList:[],
|
|
|
+ userSelection:"",
|
|
|
+ userTreeDeptId:"",
|
|
|
+ userForm:{},
|
|
|
+ userPage:{
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSize: 10
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
//初始化查询
|
|
|
created() {
|
|
|
+ getDeptTree().then(res => {
|
|
|
+ this.dicData = res.data.data;
|
|
|
+ });
|
|
|
if (this.$route.query.id) {
|
|
|
- detail(JSON.parse(this.$route.query.id)).then(res => {
|
|
|
+ getDetail(JSON.parse(this.$route.query.id)).then(res => {
|
|
|
this.form = res.data.data
|
|
|
- this.contactsData = res.data.data.priceItemList
|
|
|
- delete this.form.priceItemList
|
|
|
+ this.contactsData = res.data.data.saleGoodsPrice
|
|
|
+ this.purchaseData = res.data.data.buyGoodsPrice
|
|
|
})
|
|
|
- } else {
|
|
|
- this.form = {}
|
|
|
- this.contactsData = []
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- '$route'(to, from) {
|
|
|
- console.log(to, from);
|
|
|
- if (this.$route.query.id) {
|
|
|
-
|
|
|
- } else {
|
|
|
- this.form = {}
|
|
|
- }
|
|
|
+ }else{
|
|
|
+ //新增时根据左侧选中树结构给客户类别赋值
|
|
|
+ this.$set(this.form,"goodsTypeId", this.$route.query.treeDeptId)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -451,15 +509,14 @@ export default {
|
|
|
this.$refs.crudPurchase.rowCell(row, index)
|
|
|
},
|
|
|
//删除商品信息触发
|
|
|
- rowDel(row, index, donerowDel) {
|
|
|
+ rowContactsDel(row, index) {
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- //商品判断是否需要调用删除接口
|
|
|
if (row.id) {
|
|
|
- corpsattn(row.id).then(res => {
|
|
|
+ priceDelete(row.id).then(res => {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "操作成功!"
|
|
@@ -475,24 +532,117 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ rowPurchaseDel(row, index) {
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ if (row.id) {
|
|
|
+ priceDelete(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.purchaseData.splice(index, 1);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.purchaseData.splice(index, 1);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
//修改提交触发
|
|
|
editCustomer() {
|
|
|
- console.log(this.form)
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.form.priceItemList = this.contactsData
|
|
|
- typeSave(this.form).then(res => {
|
|
|
+ //校验明细列表
|
|
|
+ let valids = true;
|
|
|
+ if(this.contactsData.length !=0){
|
|
|
+ this.contactsData.forEach((item) =>{
|
|
|
+ if((!item.code ||!item.bigCharacter ||!item.brand ||!item.brandItem ) && valids){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请检查销售价格第 "+(item.$index +1 )+" 行必填项"
|
|
|
+ });
|
|
|
+ valids = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.purchaseData.length !=0){
|
|
|
+ this.purchaseData.forEach((item) =>{
|
|
|
+ if((item.corpId =="") && valids){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请检查采购价格第 "+(item.$index +1 )+" 行必填项"
|
|
|
+ });
|
|
|
+ valids = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (valid && valids) {
|
|
|
+ const params = {
|
|
|
+ ...this.form,
|
|
|
+ type:0,
|
|
|
+ saleGoodsPrice : this.contactsData,
|
|
|
+ buyGoodsPrice : this.purchaseData
|
|
|
+ }
|
|
|
+ updateDetail(params).then(res => {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: this.form.id ? "修改成功!" : "新增成功!"
|
|
|
});
|
|
|
- this.backToList()
|
|
|
})
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //供应商窗口事件
|
|
|
+ selectUser(row){
|
|
|
+ this.userDialog = true
|
|
|
+ this.detailsSelect = row.$index;
|
|
|
+ },
|
|
|
+ userSearchChange(params, done){
|
|
|
+ this.userOnLoad(this.userPage, params);
|
|
|
+ done()
|
|
|
+ },
|
|
|
+ userSearchReset(){
|
|
|
+
|
|
|
+ },
|
|
|
+ userRefreshChange(){
|
|
|
+ this.userOnLoad(this.userPage)
|
|
|
+ },
|
|
|
+ userSelectionChange(row){
|
|
|
+ this.userSelection = row;
|
|
|
+ },
|
|
|
+ userOnLoad(page,params={ parentId: 0 }){
|
|
|
+ this.userLoading = true;
|
|
|
+ let queryParams = Object.assign({}, params, {
|
|
|
+ size: page.pageSize,
|
|
|
+ current: page.currentPage,
|
|
|
+ corpsTypeId: this.userTreeDeptId
|
|
|
+ });
|
|
|
+ customerList(queryParams).then(res => {
|
|
|
+ this.userDataList = res.data.data.records
|
|
|
+ this.userPage.total = res.data.data.total
|
|
|
+ this.userLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ userNodeClick(data){
|
|
|
+ this.userTreeDeptId = data.id;
|
|
|
+ this.userOnLoad(this.userPage);
|
|
|
+ },
|
|
|
+ //确定
|
|
|
+ userConfirm(){
|
|
|
+ if(this.userSelection){
|
|
|
+ this.purchaseData[this.detailsSelect].corpId = this.userSelection[0].id;
|
|
|
+ this.$set(this.purchaseData[this.detailsSelect],'corpName',this.userSelection[0].cname)
|
|
|
+ this.userDialog = !this.userDialog
|
|
|
+ }
|
|
|
+ },
|
|
|
// 商品图片上传保存
|
|
|
imgUploadSave(row, done, loading) {
|
|
|
console.log(row)
|
|
@@ -528,10 +678,8 @@ export default {
|
|
|
},
|
|
|
// 上传前
|
|
|
uploadBefore(file, done, loading,column) {
|
|
|
- console.log(file.type)
|
|
|
const is2M = file.size / 1024 / 1024 < 2
|
|
|
const isType = file.type === "image/jpeg" || file.type === "image/png" || file.type === "image/jpg"
|
|
|
- console.log(isType)
|
|
|
if (!isType) {
|
|
|
this.$message.error('图片只能是JPG、JPEG、PNG格式')
|
|
|
loading()
|