完善系统管理
新增基础信息和商品管理
This commit is contained in:
60
src/api/baseinfo/goodsShelves/goodsShelves.js
Normal file
60
src/api/baseinfo/goodsShelves/goodsShelves.js
Normal file
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouserack/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouserack/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
saveGoodsShelves: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouserack/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initGoodsShelves: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouserack/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 库位-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouserack/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询所有库位列表
|
||||
warehouserackListAll: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouserack/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
},
|
||||
}
|
||||
55
src/api/baseinfo/supplier/supplier.js
Normal file
55
src/api/baseinfo/supplier/supplier.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
// 列表查询
|
||||
listPage: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/supplierinfo/listPage',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存
|
||||
saveOrUpdate: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/supplierinfo/save',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
// 回显
|
||||
fetchDetailsBySid: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/supplierinfo/fetchDetailsBySid/' + data,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
delBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/supplierinfo/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取供应商类型
|
||||
selSupplierType: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/suppliertype/selSupplierType',
|
||||
method: 'post',
|
||||
params: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
37
src/api/baseinfo/suppliertype/suppliertype.js
Normal file
37
src/api/baseinfo/suppliertype/suppliertype.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
// 列表查询
|
||||
listPage: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/suppliertype/listPage',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存
|
||||
saveOrUpdate: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/suppliertype/save',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
delBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/suppliertype/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
70
src/api/baseinfo/warehouse/warehouse.js
Normal file
70
src/api/baseinfo/warehouse/warehouse.js
Normal file
@@ -0,0 +1,70 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseinfo/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
// 仓库查询
|
||||
getAllWarehouse: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseinfo/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseinfo/updateStatus/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
saveWarehouse: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseinfo/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initWarehouse: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseinfo/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 仓库-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseinfo/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
78
src/api/baseinfo/warehouseArea/warehouseArea.js
Normal file
78
src/api/baseinfo/warehouseArea/warehouseArea.js
Normal file
@@ -0,0 +1,78 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehousearea/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
},
|
||||
|
||||
// 库区查询
|
||||
getAllWarehousearea: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehousearea/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 根据仓库sid查询库区
|
||||
getAllWarehouseareaBysid: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin//warehousearea/selectAll',
|
||||
method: 'get',
|
||||
params: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehousearea/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
saveWarehousearea: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehousearea/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initWarehousearea: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehousearea/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 库区-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehousearea/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
67
src/api/baseinfo/warehouseAreaType/warehouseAreaType.js
Normal file
67
src/api/baseinfo/warehouseAreaType/warehouseAreaType.js
Normal file
@@ -0,0 +1,67 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseareatype/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
},
|
||||
|
||||
// 库去类型查询
|
||||
getAllWarehouseareatype: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseareatype/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseareatype/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
saveWarehousearea: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseareatype/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initWarehousearea: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseareatype/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 库区类型-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/warehouseareatype/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
74
src/api/goods/brand.js
Normal file
74
src/api/goods/brand.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsbrand/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 品牌查询
|
||||
getAllBrand: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsbrand/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsbrand/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
saveBrands: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsbrand/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initBrands: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsbrand/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 品牌-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsbrand/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
}
|
||||
78
src/api/goods/category.js
Normal file
78
src/api/goods/category.js
Normal file
@@ -0,0 +1,78 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodstype/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 类别查询
|
||||
getAllType: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodstype/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodstype/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
// 修改是否一品一码
|
||||
updateIsGoodsID: function(sid, isGoodsID) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodstype/updateIsGoodsID/' + sid + "/" + isGoodsID
|
||||
});
|
||||
},
|
||||
|
||||
// 新增、保存
|
||||
saveTypes: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodstype/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initTypes: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodstype/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 类别-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodstype/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
70
src/api/goods/factory.js
Normal file
70
src/api/goods/factory.js
Normal file
@@ -0,0 +1,70 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basemanufacturer/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 厂家查询
|
||||
getAllFacturer: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basemanufacturer/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basemanufacturer/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
saveFacturer: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basemanufacturer/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initFacturer: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basemanufacturer/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 厂家-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basemanufacturer/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
94
src/api/goods/goods.js
Normal file
94
src/api/goods/goods.js
Normal file
@@ -0,0 +1,94 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsspu/listPage',
|
||||
// url: '/oms/apiadmin/base/basegoodsspu/goodsListPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsspu/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
// 新增、保存
|
||||
saveGoods: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsspu/saveOrUpdate',
|
||||
// url: '/oms/apiadmin/base/basegoodsspu/saveOrUpdateGoods',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initGoods: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsspu/initialization/' + data,
|
||||
// url: '/oms/apiadmin/base/basegoodsspu/goodsDetails/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 商品规格 修改是否可用状态
|
||||
updateIsEnable2: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsspu/updateIsEnablebySku/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 商品-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsspu/delBySids',
|
||||
// url: '/oms/apiadmin/base/basegoodsspu/delGoodsBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 下载模板
|
||||
downloadExcel: function() {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsspu/download',
|
||||
method: 'post',
|
||||
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询商品分页列表
|
||||
getGoodsListAllByOrg: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/basegoodssku/listAllByOrg',
|
||||
// url: '/oms/apiadmin/base/basegoodsspu/goodsListPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
70
src/api/goods/unit.js
Normal file
70
src/api/goods/unit.js
Normal file
@@ -0,0 +1,70 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsunit/listPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 单位查询
|
||||
getAllUnit: function(params) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsunit/listAll',
|
||||
method: 'post',
|
||||
data: params,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 修改是否可用状态
|
||||
updateIsEnable: function(sid, isEnable) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsunit/updateIsEnable/' + sid + "/" + isEnable
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 新增、保存
|
||||
saveUnits: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsunit/saveOrUpdate',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化
|
||||
initUnits: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsunit/initialization/' + data,
|
||||
method: 'get'
|
||||
});
|
||||
},
|
||||
|
||||
// 单位-- 删除
|
||||
deleteBySids: function(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/base/basegoodsunit/delBySids',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export function userAdd(data) {
|
||||
// 初始化 用户
|
||||
export function initUserInfo(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysstaffinfo/fetchBySid/' + data.sid,
|
||||
url: '/oms/apiadmin/sysstaffinfo/fetchBySid/' + data.sid + "/" + data.defaultDeptSid,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {
|
||||
@@ -92,7 +92,7 @@ export function userSingle(data) {
|
||||
// 单条用户的角色列表
|
||||
export function setRole(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysrole/listAllByUserSid/' + data.userSid + "/" + data.orgsid,
|
||||
url: '/oms/apiadmin/sysrole/listAllByUserSid/' + data.userSid + "/" + data.orgSid,
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
|
||||
22
src/main.js
22
src/main.js
@@ -16,7 +16,11 @@ import eimage from '@/components/E-image/index.vue'
|
||||
import moment from 'moment'
|
||||
import Print from '@/utils/print' // 引入附件的js文件
|
||||
import request from '@/utils/request'
|
||||
import { setDefaultOrgPath, setDefaultOrgPathName, setStorage } from './utils/auth.js'
|
||||
import {
|
||||
setDefaultOrgPath,
|
||||
setDefaultOrgPathName,
|
||||
setStorage
|
||||
} from './utils/auth.js'
|
||||
import VueAMap from 'vue-amap'
|
||||
|
||||
Vue.use(ElementUI)
|
||||
@@ -36,7 +40,9 @@ Vue.use(Print) // 注册
|
||||
Vue.use(VueAMap)
|
||||
VueAMap.initAMapApiLoader({
|
||||
key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请
|
||||
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加
|
||||
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation',
|
||||
'AMap.Geocoder'
|
||||
], // 此处的插件按需添加
|
||||
v: '1.4.4',
|
||||
uiVersion: '1.0'
|
||||
})
|
||||
@@ -63,10 +69,10 @@ if (parseInt(one) > 18) {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取登录用户信息
|
||||
// 获取登录用户信息
|
||||
function getUserInfo() {
|
||||
// return request({
|
||||
// url: '/wms/apiadmin/sysuser/loginDetails',
|
||||
// url: '/oms/apiadmin/sysuser/loginDetails',
|
||||
// method: 'post',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json'
|
||||
@@ -110,9 +116,12 @@ function getUserInfo() {
|
||||
}
|
||||
|
||||
getUserInfo()
|
||||
|
||||
function GetQueryString(name) {
|
||||
var one = window.location.href.indexOf('?token=') + 7
|
||||
if (one < 7) { return null }
|
||||
if (one < 7) {
|
||||
return null
|
||||
}
|
||||
var two = window.location.href.lastIndexOf('&') // + 1
|
||||
var data = window.location.href.substr(one)
|
||||
if (two > one) {
|
||||
@@ -125,5 +134,6 @@ function GetQueryString(name) {
|
||||
return null
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
|
||||
var r = window.location.search.substr(1).match(reg)
|
||||
if (r != null) return unescape(r[2]); return null
|
||||
if (r != null) return unescape(r[2]);
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -44,6 +44,138 @@ export const constantRoutes = [
|
||||
}
|
||||
}]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/baseInfo',
|
||||
component: Layout,
|
||||
redirect: null,
|
||||
meta: {
|
||||
title: '基础信息'
|
||||
},
|
||||
children: [{
|
||||
path: '/warehouses/warehouse',
|
||||
name: 'Warehouse',
|
||||
component: () => import('@/views/baseInfo/warehouses/warehouse/index'),
|
||||
meta: {
|
||||
title: '仓库管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/warehouses/warehouseArea',
|
||||
name: 'WarehouseArea',
|
||||
component: () => import('@/views/baseInfo/warehouses/warehouseArea/index'),
|
||||
meta: {
|
||||
title: '库区管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/warehouses/warehouseAreaType',
|
||||
name: 'WarehouseAreaType',
|
||||
component: () => import('@/views/baseInfo/warehouses/warehouseAreaType/index'),
|
||||
meta: {
|
||||
title: '库区类型管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/warehouses/goodsShelves',
|
||||
name: 'GoodsShelves',
|
||||
component: () => import('@/views/baseInfo/warehouses/goodsShelves/index'),
|
||||
meta: {
|
||||
title: '库位管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/supplier/supplier',
|
||||
name: 'Supplier',
|
||||
component: () => import('@/views/baseInfo/supplier/supplier/supplier'),
|
||||
meta: {
|
||||
title: '供应商管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/supplier/suppliertype',
|
||||
name: 'Suppliertype',
|
||||
component: () => import('@/views/baseInfo/supplier/suppliertype/suppliertype'),
|
||||
meta: {
|
||||
title: '供应商类型管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/goods',
|
||||
component: Layout,
|
||||
redirect: null,
|
||||
meta: {
|
||||
title: '商品管理'
|
||||
},
|
||||
children: [{
|
||||
path: '/brands/index',
|
||||
name: 'Brands',
|
||||
component: () => import('@/views/goods/brands/index'),
|
||||
meta: {
|
||||
title: '品牌管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/category/index',
|
||||
name: 'Category',
|
||||
component: () => import('@/views/goods/category/index'),
|
||||
meta: {
|
||||
title: '商品类别',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/factory/index',
|
||||
name: 'Factory',
|
||||
component: () => import('@/views/goods/factory/index'),
|
||||
meta: {
|
||||
title: '厂家管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/unit/index',
|
||||
name: 'Unit',
|
||||
component: () => import('@/views/goods/unit/index'),
|
||||
meta: {
|
||||
title: '计量单位',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/goods/index',
|
||||
name: 'Goods',
|
||||
component: () => import('@/views/goods/goods/index'),
|
||||
meta: {
|
||||
title: '商品管理',
|
||||
icon: 'product-add'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/customerManagement',
|
||||
component: Layout,
|
||||
@@ -68,8 +200,7 @@ export const constantRoutes = [
|
||||
meta: {
|
||||
title: '销售'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
children: [{
|
||||
path: '/sales/salesOrder',
|
||||
component: () => import('@/views/sales/salesOrder/salesOrder'),
|
||||
name: 'SalesOrder',
|
||||
|
||||
205
src/views/baseInfo/supplier/supplier/relation/openingbank.vue
Normal file
205
src/views/baseInfo/supplier/supplier/relation/openingbank.vue
Normal file
@@ -0,0 +1,205 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="saveOrUpdate()">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<el-row style="border-top: 1px solid #e0e3eb">
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>开户银行</div>
|
||||
<el-form-item prop="bankName"><el-input class="addinputInfo addinputw" v-model="formobj.bankName"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>银行账号</div>
|
||||
<el-form-item prop="bankAccount"><el-input class="addinputInfo addinputw" v-model="formobj.bankAccount"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>账号名称</div>
|
||||
<el-form-item prop="accountName"><el-input class="addinputInfo addinputw" v-model="formobj.accountName"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>账号类型</div>
|
||||
<el-form-item prop="dueBankKey">
|
||||
<el-select v-model="formobj.dueBankKey" class="addinputInfo" placeholder="" @change="dueBankChange">
|
||||
<el-option v-for="item in dueBank_list" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">开户行地址</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.bankAddress" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">银行网点</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.bankingOutlets" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">联行号</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.paymentLines" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">swiftCode(银行代码)</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.swiftCode" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">币种</div>
|
||||
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.currency" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
typeValues
|
||||
} from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
name: 'OpeningBank',
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
dueBank_list: [],
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierSid: '',
|
||||
bankName: '',
|
||||
bankAccount: '',
|
||||
accountName: '',
|
||||
dueBankKey: '',
|
||||
dueBankValue: '',
|
||||
bankingOutlets: '',
|
||||
bankAddress: '',
|
||||
paymentLines: '',
|
||||
swiftCode: '',
|
||||
currency: ''
|
||||
},
|
||||
index: '',
|
||||
rules: {
|
||||
bankName: [{
|
||||
required: true,
|
||||
message: '开户银行不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
bankAccount: [{
|
||||
required: true,
|
||||
message: '银行账号不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
accountName: [{
|
||||
required: true,
|
||||
message: '账号名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
dueBankKey: [{
|
||||
required: true,
|
||||
message: '账号类型不能为空',
|
||||
trigger: 'change'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
typeValues({
|
||||
type: 'accountType'
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.dueBank_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
showAdd() {
|
||||
this.viewTitle = '【新增】开户行信息'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
},
|
||||
showEdit(value, index) {
|
||||
this.viewTitle = '【编辑】开户行信息'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
this.formobj = JSON.parse(JSON.stringify(value))
|
||||
this.index = index
|
||||
},
|
||||
dueBankChange(value) {
|
||||
const choose = this.dueBank_list.filter((item) => item.dictKey === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.dueBankValue = choose[0].dictValue
|
||||
} else {
|
||||
this.formobj.dueBankValue = ''
|
||||
}
|
||||
},
|
||||
saveOrUpdate() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$emit('backData', this.formobj, this.index)
|
||||
this.handleReturn()
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn() {
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierSid: '',
|
||||
bankName: '',
|
||||
bankAccount: '',
|
||||
accountName: '',
|
||||
dueBankKey: '',
|
||||
dueBankValue: '',
|
||||
bankingOutlets: '',
|
||||
bankAddress: '',
|
||||
paymentLines: '',
|
||||
swiftCode: '',
|
||||
currency: ''
|
||||
}
|
||||
this.index = ''
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 140px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 130px !important;
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
</style>
|
||||
282
src/views/baseInfo/supplier/supplier/supplier.vue
Normal file
282
src/views/baseInfo/supplier/supplier/supplier.vue
Normal file
@@ -0,0 +1,282 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="供应商管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<!--Start查询列表部分-->
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
|
||||
<el-form-item label="厂商名称">
|
||||
<el-input v-model="listQuery.params.supplierName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂商类型">
|
||||
<el-input v-model="listQuery.params.supplierTypeName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="办公电话">
|
||||
<el-input v-model="listQuery.params.contactTelePhone" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人">
|
||||
<el-input v-model="listQuery.params.contactName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<div class="listtop">
|
||||
<div class="tit">供应商列表</div>
|
||||
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
||||
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
|
||||
</div>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" align="center" width="50" />
|
||||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" width="180px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierName" label="厂商名称" align="center" />
|
||||
<el-table-column prop="supplierTypeName" label="厂商类型" align="center" />
|
||||
<el-table-column prop="address" label="厂商通讯地址" align="center" />
|
||||
<el-table-column prop="contactTelePhone" label="厂商办公电话" align="center" />
|
||||
<el-table-column prop="contactName" label="联系人" align="center" />
|
||||
<el-table-column prop="contactMobile" label="联系电话" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
||||
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
<!--新增及修改 -->
|
||||
<supplierAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList" />
|
||||
<!-- 详情 -->
|
||||
<supplierInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/baseinfo/supplier/supplier.js'
|
||||
import supplierAdd from './supplierAdd'
|
||||
import supplierInfo from './supplierInfo'
|
||||
|
||||
export default {
|
||||
name: 'Supplier',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar,
|
||||
supplierAdd,
|
||||
supplierInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierName: '',
|
||||
supplierTypeName: '',
|
||||
contactTelePhone: '',
|
||||
contactName: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 信息条数 获取点击时当前的sid
|
||||
handleSelectionChange(row) {
|
||||
const aa = []
|
||||
row.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 表中序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.listQuery.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.listQuery.params.menuUrl = this.$route.path
|
||||
req.listPage(this.listQuery).then((response) => {
|
||||
this.listLoading = false
|
||||
if (response.success) {
|
||||
this.list = response.data.records
|
||||
this.listQuery.total = response.data.total
|
||||
} else {
|
||||
this.list = []
|
||||
this.listQuery.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierName: '',
|
||||
supplierTypeName: '',
|
||||
contactTelePhone: '',
|
||||
contactName: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divAdd'].showAdd()
|
||||
},
|
||||
toEdit(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divAdd'].showEdit(row)
|
||||
},
|
||||
toInfo(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divInfo'].showInfo(row)
|
||||
},
|
||||
doDel() {
|
||||
if (this.sids.length === 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '请选择至少一条记录进行删除操作'
|
||||
})
|
||||
return
|
||||
}
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.delBySids(this.sids).then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
}
|
||||
this.getList()
|
||||
loading.close()
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 修改、编辑、详情返回列表页面
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
552
src/views/baseInfo/supplier/supplier/supplierAdd.vue
Normal file
552
src/views/baseInfo/supplier/supplier/supplierAdd.vue
Normal file
@@ -0,0 +1,552 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">基本信息</div>
|
||||
<el-row style="border-top: 1px solid #e0e3eb">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商名称</div>
|
||||
<el-form-item prop="supplierName"><el-input v-model="formobj.supplierName" class="addinputInfo addinputw"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商简称</div>
|
||||
<el-form-item prop="supplierPY"><el-input v-model="formobj.supplierPY" class="addinputInfo addinputw"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商编码</div>
|
||||
<el-form-item prop="supplierCode"><el-input v-model="formobj.supplierCode" class="addinputInfo addinputw"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商类型</div>
|
||||
<el-form-item prop="supplierTypeSid">
|
||||
<el-select v-model="formobj.supplierTypeSid" class="addinputInfo" filterable placeholder=""
|
||||
@change="supplierTypeChange">
|
||||
<el-option v-for="item in supplierType_list" :key="item.sid" :label="item.supplierTypeName"
|
||||
:value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商电话</div>
|
||||
<el-form-item prop="contactTelePhone"><el-input v-model="formobj.contactTelePhone"
|
||||
class="addinputInfo addinputw" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">传真</div>
|
||||
<el-form-item><el-input v-model="formobj.fax" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">详细地址</div>
|
||||
<el-form-item>
|
||||
<div class="addinputInfo"
|
||||
style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center">
|
||||
<el-select v-model="formobj.province" filterable clearable placeholder="请选择省" style="width:160px"
|
||||
@change="provinceChange">
|
||||
<el-option v-for="item in province_list" :key="item.sid" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
<el-select v-model="formobj.city" filterable placeholder="请选择市" style="width:160px"
|
||||
@change="cityChange">
|
||||
<el-option v-for="item in city_list" :key="item.sid" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
<el-select v-model="formobj.county" filterable placeholder="请选择县" style="width:160px"
|
||||
@change="countyChange">
|
||||
<el-option v-for="item in county_list" :key="item.sid" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
<el-input v-model="formobj.address" style="width: 30%" clearable placeholder="" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系人</div>
|
||||
<el-form-item><el-input v-model="formobj.contactName" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系电话</div>
|
||||
<el-form-item><el-input v-model="formobj.contactMobile" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" />
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">邮编</div>
|
||||
<el-form-item><el-input v-model="formobj.zipCode" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">电子邮件</div>
|
||||
<el-form-item><el-input v-model="formobj.email" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">网址</div>
|
||||
<el-form-item><el-input v-model="formobj.website" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="icon">*</span>开票公司名称</div>
|
||||
<el-form-item prop="billingCompanyName"><el-input v-model="formobj.billingCompanyName"
|
||||
class="addinputInfo addinputw" clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税号</div>
|
||||
<el-form-item><el-input v-model="formobj.registNum" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">法人</div>
|
||||
<el-form-item><el-input v-model="formobj.legalName" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">采购员</div>
|
||||
<el-form-item><el-input v-model="formobj.purchaser" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">开票类型</div>
|
||||
<el-form-item>
|
||||
<el-select v-model="formobj.billingTypeValue" class="addinputInfo" filterable placeholder=""
|
||||
@change="billingTypeChange">
|
||||
<el-option v-for="item in billingType_list" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税率</div>
|
||||
<el-form-item><el-input v-model="formobj.taxRate" class="addinputInfo addinputw" clearable placeholder=""
|
||||
@keyup.native="formobj.taxRate = getNumber(formobj.taxRate, 2)" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><el-input v-model="formobj.remarks" class="addinputInfo addinputw" clearable
|
||||
placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="title titleOne">
|
||||
<div>开户行列表</div>
|
||||
<el-button type="primary" size="mini" class="btntopblueline" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<el-table :key="tableKey" :data="formobj.baseSupplierBankList" :index="index" border style="width: 100%">
|
||||
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center" />
|
||||
<el-table-column fixed width="150" label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row, scope.$index)">编辑</el-button>
|
||||
<el-button type="danger" size="mini" @click="handleDelete(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dueBankValue" label="账户类型" align="center" width="100" />
|
||||
<el-table-column prop="bankName" label="开户银行" align="center" width="120" />
|
||||
<el-table-column prop="bankAccount" label="银行账号" align="center" width="100" />
|
||||
<el-table-column prop="accountName" label="账号名称" align="center" width="160" />
|
||||
<el-table-column prop="bankingOutlets" label="银行网点" align="center" width="100" />
|
||||
<el-table-column prop="bankAddress" label="开户行地址" align="center" min-width="200" />
|
||||
<el-table-column prop="paymentLines" label="联行号" align="center" width="100" />
|
||||
<el-table-column prop="swiftCode" label="swifcode(银行代码)" align="center" width="170" />
|
||||
<el-table-column prop="currency" label="币种" align="center" width="100" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<openingbank v-show="viewState == 2 || viewState == 3" ref="divOpen" @backData="backData" @doback="resetState" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/supplier/supplier.js'
|
||||
import openingbank from './relation/openingbank'
|
||||
import {
|
||||
getProvince,
|
||||
getCity,
|
||||
getCounty,
|
||||
typeValues
|
||||
} from '@/api/Common/dictcommons'
|
||||
|
||||
export default {
|
||||
name: 'SupplierAdd',
|
||||
components: {
|
||||
openingbank
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
submitdisabled: false,
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
supplierType_list: [],
|
||||
province_list: [],
|
||||
city_list: [],
|
||||
county_list: [],
|
||||
billingType_list: [],
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
baseSupplierBankList: [],
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
rules: {
|
||||
supplierName: [{
|
||||
required: true,
|
||||
message: '供应商名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
supplierPY: [{
|
||||
required: true,
|
||||
message: '供应商简称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
supplierCode: [{
|
||||
required: true,
|
||||
message: '供应商编码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
supplierTypeSid: [{
|
||||
required: true,
|
||||
message: '供应商类型不能为空',
|
||||
trigger: 'change'
|
||||
}],
|
||||
contactTelePhone: [{
|
||||
required: true,
|
||||
message: '供应商电话不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
billingCompanyName: [{
|
||||
required: true,
|
||||
message: '开票公司名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
typeValues({
|
||||
type: 'billingType'
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.billingType_list = res.data
|
||||
}
|
||||
})
|
||||
getProvince().then((res) => {
|
||||
if (res.success) {
|
||||
this.province_list = res.data
|
||||
}
|
||||
})
|
||||
req.selSupplierType({
|
||||
orgPath: window.sessionStorage.getItem('orgSid')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.supplierType_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getNumber(val, limit) {
|
||||
val = val.replace(/[^0-9.]/g, '') // 保留数字
|
||||
val = val.replace(/^00/, '0.') // 开头不能有两个0
|
||||
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0.
|
||||
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个
|
||||
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点
|
||||
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0
|
||||
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
|
||||
const reg = new RegExp(str)
|
||||
if (limit === 0) {
|
||||
// 不需要小数点
|
||||
val = val.replace(reg, '$1')
|
||||
} else {
|
||||
// 通过正则保留小数点后指定的位数
|
||||
val = val.replace(reg, '$1.$2')
|
||||
}
|
||||
return val
|
||||
},
|
||||
supplierTypeChange(value) {
|
||||
const choose = this.supplierType_list.filter((item) => item.sid === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.supplierTypeName = choose[0].supplierTypeName
|
||||
}
|
||||
},
|
||||
provinceChange(value) {
|
||||
const choose = this.province_list.filter((item) => item.name === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.provinceSid = choose[0].sid
|
||||
this.getCity(this.formobj.provinceSid)
|
||||
} else {
|
||||
this.formobj.provinceSid = ''
|
||||
this.formobj.citySid = ''
|
||||
this.formobj.city = ''
|
||||
this.city_list = []
|
||||
this.formobj.county = ''
|
||||
this.formobj.countySid = ''
|
||||
this.county_list = []
|
||||
}
|
||||
},
|
||||
getCity(val) {
|
||||
getCity({
|
||||
sid: val
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.city_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
cityChange(value) {
|
||||
const choose = this.city_list.filter((item) => item.name === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.citySid = choose[0].sid
|
||||
this.getCounty(this.formobj.citySid)
|
||||
}
|
||||
},
|
||||
getCounty(val) {
|
||||
getCounty({
|
||||
sid: val
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.county_list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
countyChange(value) {
|
||||
const choose = this.county_list.filter((item) => item.name === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.countySid = choose[0].sid
|
||||
}
|
||||
},
|
||||
showAdd() {
|
||||
this.viewTitle = '【新增】供应商'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
},
|
||||
showEdit(row) {
|
||||
this.viewTitle = '【编辑】供应商'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
this.init()
|
||||
req.fetchDetailsBySid(row.sid).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
billingTypeChange(value) {
|
||||
const choose = this.billingType_list.filter((item) => item.dictValue === value)
|
||||
if (choose !== null && choose.length > 0) {
|
||||
this.formobj.billingTypeKey = choose[0].dictKey
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divOpen'].showAdd()
|
||||
},
|
||||
handleEdit(row, index) {
|
||||
this.viewState = 3
|
||||
this.$refs['divOpen'].showEdit(row, index)
|
||||
},
|
||||
handleDelete(index) {
|
||||
this.formobj.baseSupplierBankList.splice(index, 1)
|
||||
},
|
||||
backData(value, index) {
|
||||
this.viewState = 1
|
||||
|
||||
if (index !== '' && index !== null) {
|
||||
// this.formobj.baseSupplierBankList[index] = {
|
||||
// sid: value.sid,
|
||||
// supplierSid: value.supplierSid,
|
||||
// bankName: value.bankName,
|
||||
// bankAccount: value.bankAccount,
|
||||
// accountName: value.accountName,
|
||||
// dueBankKey: value.dueBankKey,
|
||||
// dueBankValue: value.dueBankValue,
|
||||
// bankingOutlets: value.bankingOutlets,
|
||||
// bankAddress: value.bankAddress,
|
||||
// paymentLines: value.paymentLines,
|
||||
// swiftCode: value.swiftCode,
|
||||
// currency: value.currency
|
||||
// }
|
||||
|
||||
this.$set(this.formobj.baseSupplierBankList, index, value)
|
||||
} else {
|
||||
this.formobj.baseSupplierBankList.push({
|
||||
sid: '',
|
||||
supplierSid: value.supplierSid,
|
||||
bankName: value.bankName,
|
||||
bankAccount: value.bankAccount,
|
||||
accountName: value.accountName,
|
||||
dueBankKey: value.dueBankKey,
|
||||
dueBankValue: value.dueBankValue,
|
||||
bankingOutlets: value.bankingOutlets,
|
||||
bankAddress: value.bankAddress,
|
||||
paymentLines: value.paymentLines,
|
||||
swiftCode: value.swiftCode,
|
||||
currency: value.currency
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
saveOrUpdate() {
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitdisabled = true
|
||||
req.saveOrUpdate(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
this.submitdisabled = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.submitdisabled = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
baseSupplierBankList: [],
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.submitdisabled = false
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/*表格列设置fixed后固定列出现下边框的设置*/
|
||||
/deep/ .el-table__fixed {
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
/*表格列设置fixed后固定列出现下边框的设置*/
|
||||
/deep/ .el-table__fixed-right {
|
||||
height: 100% !important;
|
||||
}
|
||||
</style>
|
||||
238
src/views/baseInfo/supplier/supplier/supplierInfo.vue
Normal file
238
src/views/baseInfo/supplier/supplier/supplierInfo.vue
Normal file
@@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<div class="tab-header webtop">
|
||||
<div>{{ viewTitle }}</div>
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listconadd">
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">基本信息</div>
|
||||
<el-row style="border-top: 1px solid #e0e3eb">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商名称</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商简称</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierPY }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商编码</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierCode }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.supplierTypeName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商电话</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.contactTelePhone }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">供应商传真</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.fax }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">详细地址</div>
|
||||
<el-form-item><span
|
||||
class="addinputInfo">{{ formobj.province }}{{ formobj.city }}{{ formobj.county }}{{ formobj.address }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.contactName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">联系电话</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.contactMobile }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">邮编</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.zipCode }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">电子邮件</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.email }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">网址</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.website }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">开票公司名称</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billingCompanyName }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税号</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.registNum }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">法人</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.legalName }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">采购员</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.purchaser }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">开票类型</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.billingTypeValue }}</span></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税率</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.taxRate }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="title">开户行列表</div>
|
||||
<el-table :key="tableKey" :data="formobj.baseSupplierBankList" :index="index" border style="width: 100%">
|
||||
<el-table-column fixed width="80" label="序号" type="index" :index="index + 1" align="center" />
|
||||
<el-table-column prop="dueBankValue" label="账户类型" align="center" width="100" />
|
||||
<el-table-column prop="bankName" label="开户银行" align="center" width="120" />
|
||||
<el-table-column prop="bankAccount" label="银行账号" align="center" width="100" />
|
||||
<el-table-column prop="accountName" label="账号名称" align="center" width="160" />
|
||||
<el-table-column prop="bankingOutlets" label="银行网点" align="center" width="100" />
|
||||
<el-table-column prop="bankAddress" label="开户行地址" align="center" min-width="200" />
|
||||
<el-table-column prop="paymentLines" label="联行号" align="center" width="100" />
|
||||
<el-table-column prop="swiftCode" label="swifcode(银行代码)" align="center" width="170" />
|
||||
<el-table-column prop="currency" label="币种" align="center" width="100" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/supplier/supplier.js'
|
||||
|
||||
export default {
|
||||
name: 'SupplierInfo',
|
||||
data() {
|
||||
return {
|
||||
viewTitle: '',
|
||||
viewState: 1,
|
||||
tableKey: 0,
|
||||
index: 0,
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
useOrgSid: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
baseSupplierBankList: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showInfo(row) {
|
||||
this.viewTitle = '供应商详情'
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
req.fetchDetailsBySid(row.sid).then((res) => {
|
||||
if (res.success) {
|
||||
this.formobj = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn() {
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierCode: '',
|
||||
supplierName: '',
|
||||
supplierPY: '',
|
||||
supplierTypeSid: '',
|
||||
supplierTypeName: '',
|
||||
provinceSid: '',
|
||||
province: '',
|
||||
citySid: '',
|
||||
city: '',
|
||||
countySid: '',
|
||||
county: '',
|
||||
address: '',
|
||||
contactMobile: '',
|
||||
contactTelePhone: '',
|
||||
contactName: '',
|
||||
fax: '',
|
||||
zipCode: '',
|
||||
email: '',
|
||||
website: '',
|
||||
billingCompanyName: '',
|
||||
registNum: '',
|
||||
legalName: '',
|
||||
purchaser: '',
|
||||
sortNo: '',
|
||||
billingTypeKey: '',
|
||||
billingTypeValue: '',
|
||||
useOrgSid: '',
|
||||
createOrgName: '',
|
||||
createOrgSid: '',
|
||||
taxRate: '',
|
||||
remarks: '',
|
||||
baseSupplierBankList: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
</style>
|
||||
328
src/views/baseInfo/supplier/suppliertype/suppliertype.vue
Normal file
328
src/views/baseInfo/supplier/suppliertype/suppliertype.vue
Normal file
@@ -0,0 +1,328 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--列表页面-->
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar view-title="供应商类型管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<!--Start查询列表部分-->
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
|
||||
<el-form-item label="供应商类型">
|
||||
<el-input v-model="listQuery.params.supplierTypeName" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商编码">
|
||||
<el-input v-model="listQuery.params.supplierTypeCode" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
<div class="listtop">
|
||||
<div class="tit">供应商类型列表</div>
|
||||
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
||||
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
|
||||
</div>
|
||||
<!--Start 主页面主要部分 -->
|
||||
<div class="">
|
||||
<el-table :key="tableKey" v-loading="listLoading" :data="list" :border="true" style="width: 100%;"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" align="center" width="50" />
|
||||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" width="180px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toEdit(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierTypeName" label="供应商类型" align="center" />
|
||||
<el-table-column prop="supplierTypeCode" label="供应商编码" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!--End 主页面主要部分-->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
||||
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
|
||||
</div>
|
||||
<!--End查询列表部分-->
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialogVisible" width="70%">
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<el-row style="border-top: 1px solid #E0E3EB">
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商类型</div>
|
||||
<el-form-item><el-input class="addinputInfo" style="width: 60%" v-model.trim="formobj.supplierTypeName"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="icon">*</span>供应商编码</div>
|
||||
<el-form-item><el-input class="addinputInfo" style="width: 60%" v-model.trim="formobj.supplierTypeCode"
|
||||
clearable placeholder="" /></el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import req from '@/api/baseinfo/suppliertype/suppliertype.js'
|
||||
export default {
|
||||
name: 'SupplierType',
|
||||
components: {
|
||||
Pagination,
|
||||
pageye,
|
||||
ButtonBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
dialogVisible: false,
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'del',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
viewState: 1, // 1、列表 2、新增 3、编辑 4、查看
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
sids: [], // 用于导出的时候保存已选择的SIDs
|
||||
FormLoading: false,
|
||||
listLoading: false,
|
||||
// 翻页
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: ''
|
||||
}
|
||||
},
|
||||
formobj: {
|
||||
sid: '',
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化变量
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
methods: {
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
// 信息条数 获取点击时当前的sid
|
||||
handleSelectionChange(row) {
|
||||
const aa = []
|
||||
row.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 表中序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
// 查询列表信息
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.listQuery.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.listQuery.params.menuUrl = this.$route.path
|
||||
req.listPage(this.listQuery).then((response) => {
|
||||
this.listLoading = false
|
||||
if (response.success) {
|
||||
this.list = response.data.records
|
||||
this.listQuery.total = response.data.total
|
||||
} else {
|
||||
this.list = []
|
||||
this.listQuery.total = 0
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询按钮
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
// 点击重置
|
||||
handleReset() {
|
||||
this.listQuery = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: ''
|
||||
}
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
toAdd() {
|
||||
this.dialogVisible = true
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
supplierTypeName: '',
|
||||
supplierTypeCode: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
},
|
||||
toEdit(row) {
|
||||
this.dialogVisible = true
|
||||
this.formobj = {
|
||||
sid: row.sid,
|
||||
supplierTypeName: row.supplierTypeName,
|
||||
supplierTypeCode: row.supplierTypeCode,
|
||||
orgPath: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
if (this.formobj.supplierTypeName === '' || this.formobj.supplierTypeCode === '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '供应商类型或编码不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
||||
this.formobj.orgSid = window.sessionStorage.getItem('orgSid')
|
||||
req.saveOrUpdate(this.formobj).then((res) => {
|
||||
if (res.success) {
|
||||
this.dialogVisible = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
doDel() {
|
||||
if (this.sids.length === 0) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '请选择至少一条记录进行删除操作'
|
||||
})
|
||||
return
|
||||
}
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.delBySids(this.sids).then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
}
|
||||
this.getList()
|
||||
loading.close()
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 100px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 90px !important;
|
||||
}
|
||||
</style>
|
||||
274
src/views/baseInfo/warehouses/goodsShelves/goodsShelvesAdd.vue
Normal file
274
src/views/baseInfo/warehouses/goodsShelves/goodsShelvesAdd.vue
Normal file
@@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>库位信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 选择所属仓库:</span>
|
||||
<el-select v-model="formobj.warehouseName" placeholder="请选择所属仓库" class="item_input"
|
||||
@change="selectWarehouseChange">
|
||||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 选择所属库区:</span>
|
||||
<el-select v-model="formobj.locationName" placeholder="请选择所属库区" class="item_input"
|
||||
@change="selectWarehouseAreaChange">
|
||||
<el-option v-for="item in warehouseAreaList" :key="item.sid" :label="item.areaName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库位名称:</span>
|
||||
<el-input v-model="formobj.rackName" placeholder="库位名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 库位编码:</span>
|
||||
<el-input v-model="formobj.rackCode" placeholder="库位编码" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库位备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="库位备注" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/goodsShelves/goodsShelves.js'
|
||||
import req2 from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
import req3 from '@/api/baseinfo/warehouseArea/warehouseArea.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
rackName: '',
|
||||
rackCode: '',
|
||||
warehouseName: '',
|
||||
warehouseSid: '',
|
||||
locationName: '',
|
||||
locationSid: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
warehouseList: [],
|
||||
warehouseAreaList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
req2.getAllWarehouse(parpams).then(resp => {
|
||||
this.warehouseList = resp.data
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
if (this.formobj.warehouseName == '' || this.formobj.warehouseSid == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '所属仓库不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.locationName == '' || this.formobj.locationSid == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '所属库区不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.rackCode == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '库位编码不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
req.saveGoodsShelves(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
rackName: '',
|
||||
rackCode: '',
|
||||
warehouseName: '',
|
||||
warehouseSid: '',
|
||||
locationName: '',
|
||||
locationSid: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
this.initData()
|
||||
},
|
||||
showEdit(row) {
|
||||
this.initData()
|
||||
req.initGoodsShelves(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectWarehouseChange(val) {
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseChange', choose)
|
||||
this.formobj.warehouseSid = choose[0].sid
|
||||
this.formobj.warehouseName = choose[0].warehouseName
|
||||
|
||||
this.formobj.locationSid = ''
|
||||
this.formobj.locationName = ''
|
||||
|
||||
var params = {
|
||||
ckSid: choose[0].sid
|
||||
}
|
||||
|
||||
req3.getAllWarehouseareaBysid(params).then(resp => {
|
||||
this.warehouseAreaList = resp.data
|
||||
})
|
||||
|
||||
},
|
||||
selectWarehouseAreaChange(val) {
|
||||
const choose = this.warehouseAreaList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseAreaChange', choose)
|
||||
this.formobj.locationSid = choose[0].sid
|
||||
this.formobj.locationName = choose[0].areaName
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.box-card {
|
||||
margin-left: 60px;
|
||||
margin-right: 60px;
|
||||
min-width: 70%;
|
||||
margin-top: 20px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
||||
.item_text {
|
||||
flex: 0.8;
|
||||
font-size: 18px;
|
||||
text-align: right;
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
}
|
||||
|
||||
.item_input {
|
||||
flex: 4;
|
||||
font-size: 16px;
|
||||
margin-left: 10px;
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.item_left_input {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.item_left_text {
|
||||
height: 30px;
|
||||
margin-left: 20px;
|
||||
line-height: 30px;
|
||||
color: #018AD2;
|
||||
padding: 0px 15px;
|
||||
border: 1.5px solid #018AD2;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
.item_right {
|
||||
flex: 1;
|
||||
justify-items: center;
|
||||
|
||||
.item_right_list_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.item_right_list_delect {
|
||||
color: #5E94FF;
|
||||
margin-left: 20px;
|
||||
font-size: 16px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
311
src/views/baseInfo/warehouses/goodsShelves/index.vue
Normal file
311
src/views/baseInfo/warehouses/goodsShelves/index.vue
Normal file
@@ -0,0 +1,311 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="库位列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="库位名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">库位列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rackName" label="库位名称" align="center" />
|
||||
<el-table-column prop="rackCode" label="库位编码" align="center" />
|
||||
<el-table-column prop="warehouseName" label="所属仓库" align="center" />
|
||||
<el-table-column prop="locationName" label="所属库区" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/goodsShelves/goodsShelves.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './goodsShelvesAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
317
src/views/baseInfo/warehouses/warehouse/index.vue
Normal file
317
src/views/baseInfo/warehouses/warehouse/index.vue
Normal file
@@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="仓库列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="仓库名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">仓库列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" :active-value="1"
|
||||
:inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseName" label="仓库名称" align="center" />
|
||||
<el-table-column prop="warehouseCode" label="仓库编码" align="center" />
|
||||
<el-table-column prop="manager" label="仓库主管" align="center" />
|
||||
<el-table-column prop="telephone" label="联系电话" align="center" />
|
||||
<el-table-column prop="squareMeter" label="占地面积" align="center" />
|
||||
<el-table-column prop="address" label="仓库地址" align="center" />
|
||||
<el-table-column prop="sortNo" label="排序" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './warehouseAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
|
||||
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
292
src/views/baseInfo/warehouses/warehouse/warehouseAdd.vue
Normal file
292
src/views/baseInfo/warehouses/warehouse/warehouseAdd.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>仓库信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 仓库名称:</span>
|
||||
<el-input v-model="formobj.warehouseName" placeholder="仓库名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 仓库编码:</span>
|
||||
<el-input v-model="formobj.warehouseCode" placeholder="仓库编码" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库联系人:</span>
|
||||
<el-input v-model="formobj.contacts" placeholder="仓库联系人" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">手机号码:</span>
|
||||
<el-input v-model="formobj.mob" placeholder="手机号码" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库主管:</span>
|
||||
<el-input v-model="formobj.manager" placeholder="仓库主管" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">联系电话:</span>
|
||||
<el-input v-model="formobj.telephone" placeholder="联系电话" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item_text">占地面积:</span>
|
||||
<el-input v-model="formobj.squareMeter" placeholder="占地面积" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库经度:</span>
|
||||
<el-input v-model="formobj.longitude" placeholder="仓库经度" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库纬度:</span>
|
||||
<el-input v-model="formobj.latitude" placeholder="仓库纬度" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 具体地址:</span>
|
||||
<el-input v-model="formobj.address" placeholder="具体地址" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 使用状态:</span>
|
||||
<el-radio-group v-model="formobj.usageStatus" size="small" @change="changeTheme" class="item_input">
|
||||
<el-radio :label="1">正常</el-radio>
|
||||
<el-radio :label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- <el-input v-model="formobj.usageStatus" placeholder="仓库排序" class="item_input" clearable /> -->
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 仓库排序:</span>
|
||||
<el-input v-model="formobj.sortNo" placeholder="仓库排序" class="item_input" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">仓库备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="备注" class="item_input" clearable />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
warehouseName: '',
|
||||
warehouseCode: '',
|
||||
contacts: "",
|
||||
mob: "",
|
||||
telephone: "",
|
||||
manager: '',
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
usageStatus: 1,
|
||||
address: '',
|
||||
squareMeter: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
warehouseType: "0",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changeTheme(val) {
|
||||
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
if (this.formobj.warehouseName == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '仓库名称不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.warehouseCode == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '仓库编码不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.address == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '具体地址不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (this.formobj.sortNo == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '排序不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
req.saveWarehouse(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
warehouseName: '',
|
||||
warehouseCode: '',
|
||||
contacts: "",
|
||||
mob: "",
|
||||
telephone: "",
|
||||
manager: '',
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
usageStatus: 1,
|
||||
address: '',
|
||||
squareMeter: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
warehouseType: "0",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initWarehouse(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.box-card {
|
||||
margin-left: 60px;
|
||||
margin-right: 60px;
|
||||
min-width: 70%;
|
||||
margin-top: 20px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
||||
.item_text {
|
||||
flex: 0.8;
|
||||
font-size: 18px;
|
||||
text-align: right;
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
}
|
||||
|
||||
.item_input {
|
||||
flex: 4;
|
||||
font-size: 16px;
|
||||
margin-left: 10px;
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.item_left_input {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.item_left_text {
|
||||
height: 30px;
|
||||
margin-left: 20px;
|
||||
line-height: 30px;
|
||||
color: #018AD2;
|
||||
padding: 0px 15px;
|
||||
border: 1.5px solid #018AD2;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
.item_right {
|
||||
flex: 1;
|
||||
justify-items: center;
|
||||
|
||||
.item_right_list_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.item_right_list_delect {
|
||||
color: #5E94FF;
|
||||
margin-left: 20px;
|
||||
font-size: 16px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
314
src/views/baseInfo/warehouses/warehouseArea/index.vue
Normal file
314
src/views/baseInfo/warehouses/warehouseArea/index.vue
Normal file
@@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="库区列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="库区名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">库区列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="areaName" label="库区名称" align="center" />
|
||||
<el-table-column prop="areaCode" label="库区编码" align="center" />
|
||||
<el-table-column prop="volume" label="库区容量" align="center" />
|
||||
<el-table-column prop="unit" label="计量单位" align="center" />
|
||||
<el-table-column prop="areaTypeName" label="库区类型" align="center" />
|
||||
<el-table-column prop="warehouseName" label="所属仓库" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseArea/warehouseArea.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './warehouseAreaAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
|
||||
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
290
src/views/baseInfo/warehouses/warehouseArea/warehouseAreaAdd.vue
Normal file
290
src/views/baseInfo/warehouses/warehouseArea/warehouseAreaAdd.vue
Normal file
@@ -0,0 +1,290 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>库区信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 选择所属仓库:</span>
|
||||
<el-select v-model="formobj.warehouseName" placeholder="请选择所属仓库" class="item_input"
|
||||
@change="selectWarehouseChange">
|
||||
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 库区名称:</span>
|
||||
<el-input v-model="formobj.areaName" placeholder="库区名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 库区编码:</span>
|
||||
<el-input v-model="formobj.areaCode" placeholder="库区编码" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区容量:</span>
|
||||
<el-input v-model="formobj.volume" placeholder="库区容量" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">计量单位:</span>
|
||||
<el-input v-model="formobj.unit" placeholder="计量单位" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 库区类型:</span>
|
||||
<el-select v-model="formobj.areaTypeName" placeholder="请选择库区类型" class="item_input"
|
||||
@change="selectWarehouseTypeValueChange">
|
||||
<el-option v-for="item in warehouseTypeList" :key="item.sid" :label="item.warehouseAreaTypeName"
|
||||
:value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="库区备注" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseArea/warehouseArea.js'
|
||||
import req2 from '@/api/baseinfo/warehouse/warehouse.js'
|
||||
import req3 from '@/api/baseinfo/warehouseAreaType/warehouseAreaType.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
areaName: '',
|
||||
areaCode: '',
|
||||
volume: '',
|
||||
unit: '',
|
||||
remarks: '',
|
||||
warehouseName: '',
|
||||
warehouseSid: '',
|
||||
areaTypeSid: "",
|
||||
areaTypeName: "",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
warehouseList: [],
|
||||
warehouseTypeList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
req2.getAllWarehouse(parpams).then(resp => {
|
||||
this.warehouseList = resp.data
|
||||
})
|
||||
|
||||
req3.getAllWarehouseareatype(parpams).then(resp => {
|
||||
this.warehouseTypeList = resp.data
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
if (this.formobj.warehouseName == '' || this.formobj.warehouseSid == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '所属仓库不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.areaName == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '库区名称不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.areaCode == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '库区编码不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formobj.areaTypeName == '' || this.formobj.areaTypeSid == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '库区类型不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
req.saveWarehousearea(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
areaName: '',
|
||||
areaCode: '',
|
||||
volume: '',
|
||||
unit: '',
|
||||
remarks: '',
|
||||
warehouseName: '',
|
||||
warehouseSid: '',
|
||||
areaTypeSid: "",
|
||||
areaTypeName: "",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
this.initData()
|
||||
},
|
||||
showEdit(row) {
|
||||
this.initData()
|
||||
req.initWarehousearea(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectWarehouseChange(val) {
|
||||
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseChange', choose)
|
||||
this.formobj.warehouseSid = choose[0].sid
|
||||
this.formobj.warehouseName = choose[0].warehouseName
|
||||
},
|
||||
selectWarehouseTypeValueChange(val) {
|
||||
const choose = this.warehouseTypeList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectWarehouseTypeValueChange', choose)
|
||||
this.formobj.areaTypeSid = choose[0].sid
|
||||
this.formobj.areaTypeName = choose[0].warehouseAreaTypeName
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.box-card {
|
||||
margin-left: 60px;
|
||||
margin-right: 60px;
|
||||
min-width: 70%;
|
||||
margin-top: 20px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
||||
.item_text {
|
||||
flex: 0.8;
|
||||
font-size: 18px;
|
||||
text-align: right;
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
}
|
||||
|
||||
.item_input {
|
||||
flex: 4;
|
||||
font-size: 16px;
|
||||
margin-left: 10px;
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.item_left_input {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.item_left_text {
|
||||
height: 30px;
|
||||
margin-left: 20px;
|
||||
line-height: 30px;
|
||||
color: #018AD2;
|
||||
padding: 0px 15px;
|
||||
border: 1.5px solid #018AD2;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
.item_right {
|
||||
flex: 1;
|
||||
justify-items: center;
|
||||
|
||||
.item_right_list_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.item_right_list_delect {
|
||||
color: #5E94FF;
|
||||
margin-left: 20px;
|
||||
font-size: 16px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
309
src/views/baseInfo/warehouses/warehouseAreaType/index.vue
Normal file
309
src/views/baseInfo/warehouses/warehouseAreaType/index.vue
Normal file
@@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="库区类型列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="库区类型名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">库区类型列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouseAreaTypeName" label="库区类型名称" align="center" />
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" />
|
||||
<el-table-column prop="remarks" label="库区类型备注" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseAreaType/warehouseAreaType.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './warehouseAreaTypeAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>库区类型信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-card class="box-card">
|
||||
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 库区类型名称:</span>
|
||||
<el-input v-model="formobj.warehouseAreaTypeName" placeholder="库区类型名称" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">库区类型备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="库区类型备注" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/baseinfo/warehouseAreaType/warehouseAreaType.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
warehouseAreaTypeName: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
if (this.formobj.warehouseAreaTypeName == '') {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'warning',
|
||||
message: '库区类型名称不能为空'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
req.saveWarehousearea(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
warehouseAreaTypeName: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
showEdit(row) {
|
||||
req.initWarehousearea(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// 隐藏上传组件
|
||||
|
||||
::v-deep .hide {
|
||||
.el-upload--picture-card {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.box-card {
|
||||
margin-left: 60px;
|
||||
margin-right: 60px;
|
||||
min-width: 70%;
|
||||
margin-top: 20px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
||||
.item_text {
|
||||
flex: 0.8;
|
||||
font-size: 18px;
|
||||
text-align: right;
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
}
|
||||
|
||||
.item_input {
|
||||
flex: 4;
|
||||
font-size: 16px;
|
||||
margin-left: 10px;
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.item_left_input {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.item_left_text {
|
||||
height: 30px;
|
||||
margin-left: 20px;
|
||||
line-height: 30px;
|
||||
color: #018AD2;
|
||||
padding: 0px 15px;
|
||||
border: 1.5px solid #018AD2;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
.item_right {
|
||||
flex: 1;
|
||||
justify-items: center;
|
||||
|
||||
.item_right_list_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.item_right_list_delect {
|
||||
color: #5E94FF;
|
||||
margin-left: 20px;
|
||||
font-size: 16px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
312
src/views/goods/brands/brandsAdd.vue
Normal file
312
src/views/goods/brands/brandsAdd.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>品牌信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 品牌名称</div>
|
||||
<el-form-item prop="brandName">
|
||||
<el-input v-model="formobj.brandName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 品牌代码</div>
|
||||
<el-form-item prop="brandCode">
|
||||
<el-input v-model="formobj.brandCode" placeholder="" class="addinputw addinputInf" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 首字母大写</div>
|
||||
<el-form-item prop="letter">
|
||||
<el-input v-model="formobj.letter" placeholder="" class="addinputw addinputInf" clearable
|
||||
oninput="value=value.replace(/[^A-Z]/g,'');" @input="letter" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
|
||||
<div class="span-sty"> 品牌备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">品牌Logo</div>
|
||||
<el-form-item>
|
||||
<upload-img ref="uploadImg" class="addinputw addinputInfo" v-model="imgList" :limit="1" bucket="map"
|
||||
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }" @change="backData" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<!--
|
||||
<el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 品牌名称:</span>
|
||||
<el-input v-model="formobj.brandName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 品牌代码:</span>
|
||||
<el-input v-model="formobj.brandCode" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 首字母大写:</span>
|
||||
<el-input v-model="formobj.letter" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Z]/g,'');" @input="letter" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">品牌备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;">
|
||||
<span class="item_text">品牌Logo:</span>
|
||||
<upload-img ref="uploadImg" class="item_input" v-model="imgList" :limit="1" bucket="map"
|
||||
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }" @change="backData" />
|
||||
|
||||
</div>
|
||||
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/brand.js'
|
||||
import uploadImg from '@/components/uploadFile/uploadImg'
|
||||
export default {
|
||||
components: {
|
||||
uploadImg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgList: [],
|
||||
imgList2: [],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
brandName: '',
|
||||
brandCode: '',
|
||||
remarks: '',
|
||||
letter: '',
|
||||
image: "",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
hideUploadBtn2: false,
|
||||
rules: {
|
||||
brandName: [{
|
||||
required: true,
|
||||
message: '品牌名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
brandCode: [{
|
||||
required: true,
|
||||
message: '品牌代码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
letter: [{
|
||||
required: true,
|
||||
message: '首字母大写不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.initData()
|
||||
},
|
||||
methods: {
|
||||
letter(val) {
|
||||
console.log('letter', val)
|
||||
this.formobj.letter = val
|
||||
},
|
||||
backData(value) {
|
||||
console.log('value', value)
|
||||
|
||||
if (value.length > 0) {
|
||||
this.formobj.image = value[0].url
|
||||
} else {
|
||||
this.formobj.image = ''
|
||||
}
|
||||
this.hideUploadBtn = value.length == 1
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn)
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.brandName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "品牌名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.brandCode == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "品牌代码不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.letter == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "首字母大写不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveBrands(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.imgList = []
|
||||
this.hideUploadBtn = true
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
brandName: '',
|
||||
brandCode: '',
|
||||
remarks: '',
|
||||
letter: '',
|
||||
image: "",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
console.log("this.imgList", this.imgList)
|
||||
this.hideUploadBtn = this.imgList.length == 1
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
req.initBrands(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
this.imgList = []
|
||||
if (resp.data.image != '') {
|
||||
this.imgList.push({
|
||||
url: resp.data.image
|
||||
})
|
||||
}
|
||||
|
||||
this.hideUploadBtn = this.imgList.length == 1
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
this.imgList = []
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
/deep/.hide .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
313
src/views/goods/brands/index.vue
Normal file
313
src/views/goods/brands/index.vue
Normal file
@@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="品牌列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="品牌名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">品牌列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="品牌Logo" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-popover placement="left" trigger="click" width="300">
|
||||
<img :src="scope.row.image" width="100%">
|
||||
<img slot="reference" :src="scope.row.image" :alt="scope.row.image"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px">
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="brandName" label="品牌名称" align="center" />
|
||||
<el-table-column prop="brandCode" label="品牌代码" align="center" />
|
||||
<el-table-column prop="letter" label="首字母大写" align="center" />
|
||||
<el-table-column prop="remarks" label="品牌备注" align="center" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/brand.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './brandsAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
386
src/views/goods/category/categoryAdd.vue
Normal file
386
src/views/goods/category/categoryAdd.vue
Normal file
@@ -0,0 +1,386 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品类别</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">选择父级类别</div>
|
||||
<el-form-item>
|
||||
<el-select v-model="formobj.pname" placeholder="请选择父级类别" class="addinputw addinputInfo"
|
||||
@change="selectGoodsTypeChange">
|
||||
<el-option v-for="item in goodsTypeList" :key="item.sid" :label="item.goodsTypeName"
|
||||
:value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 类别名称</div>
|
||||
<el-form-item prop="goodsTypeName">
|
||||
<el-input v-model="formobj.goodsTypeName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 类别编码</div>
|
||||
<el-form-item prop="goodsTypeCode">
|
||||
<el-input v-model="formobj.goodsTypeCode" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty">提成比例</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.percentageRate" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">提成金额</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.percentageAmount" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty"><span class="must">*</span> 出库规则</div>
|
||||
<el-form-item prop="outStockRuleVaule">
|
||||
<el-select v-model="formobj.outStockRuleVaule" placeholder="请选择出库规则" class="addinputw addinputInfo"
|
||||
@change="selectOutStockRuleChange">
|
||||
<el-option v-for="item in outStockRuleList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span>排序</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
<!-- <el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text">选择父级类别:</span>
|
||||
<el-select v-model="formobj.pname" placeholder="请选择父级类别" class="item_input" @change="selectGoodsTypeChange">
|
||||
<el-option v-for="item in goodsTypeList" :key="item.sid" :label="item.goodsTypeName" :value="item.sid" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 类别名称:</span>
|
||||
<el-input v-model="formobj.goodsTypeName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 类别编码:</span>
|
||||
<el-input v-model="formobj.goodsTypeCode" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">提成比例:</span>
|
||||
<el-input v-model="formobj.percentageRate" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">提成金额:</span>
|
||||
<el-input v-model="formobj.percentageAmount" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 出库规则:</span>
|
||||
<el-select v-model="formobj.outStockRuleValue" placeholder="请选择出库规则" class="item_input"
|
||||
@change="selectOutStockRuleChange">
|
||||
<el-option v-for="item in outStockRuleList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 类别排序:</span>
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">类别备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/category.js'
|
||||
import {
|
||||
typeValues
|
||||
} from '@/api/Common/dictcommons.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
goodsTypeName: '',
|
||||
goodsTypeCode: '',
|
||||
percentageRate: '',
|
||||
percentageAmount: '',
|
||||
outStockRule: '',
|
||||
outStockRuleVaule: '',
|
||||
sids: '',
|
||||
pname: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
goodsTypeList: [],
|
||||
outStockRuleList: [],
|
||||
rules: {
|
||||
goodsTypeName: [{
|
||||
required: true,
|
||||
message: '类别名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
goodsTypeCode: [{
|
||||
required: true,
|
||||
message: '类别编码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
outStockRuleVaule: [{
|
||||
required: true,
|
||||
message: '请选择出库规则',
|
||||
trigger: 'change'
|
||||
}],
|
||||
sortNo: [{
|
||||
required: true,
|
||||
message: '排序不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
console.log('>>>>>>>>>initData')
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('orgsid'),
|
||||
}
|
||||
|
||||
req.getAllType(parpams).then(resp => {
|
||||
this.goodsTypeList = resp.data
|
||||
})
|
||||
|
||||
var params = {
|
||||
type: "goodsOutRule",
|
||||
psid: '0'
|
||||
}
|
||||
|
||||
typeValues(params).then(resp => {
|
||||
console.log('>>>>>>>>>typeValues', resp)
|
||||
this.outStockRuleList = resp.data
|
||||
}).catch(() => {})
|
||||
|
||||
},
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.goodsTypeName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "类别名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.goodsTypeCode == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "类别编码不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.outStockRule == '' || this.formobj.outStockRuleValue == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "请选择出库规则"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.sortNo == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "类别排序不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveTypes(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
goodsTypeName: '',
|
||||
goodsTypeCode: '',
|
||||
percentageRate: '',
|
||||
percentageAmount: '',
|
||||
outStockRule: '',
|
||||
outStockRuleValue: '',
|
||||
sids: '',
|
||||
pname: '',
|
||||
sortNo: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
this.initData()
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
this.initData()
|
||||
req.initTypes(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectGoodsTypeChange(val) {
|
||||
|
||||
const choose = this.goodsTypeList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectGoodsTypeChange', choose)
|
||||
this.formobj.sids = choose[0].sid
|
||||
this.formobj.pName = choose[0].goodsTypeName
|
||||
},
|
||||
|
||||
selectOutStockRuleChange(val) {
|
||||
console.log('>>>>>>>>>selectOutStockRuleChange', val)
|
||||
const choose = this.outStockRuleList.filter((item) => item.dictKey == val)
|
||||
console.log('>>>>>>>>>selectOutStockRuleChange', choose)
|
||||
this.formobj.outStockRule = choose[0].dictKey
|
||||
this.formobj.outStockRuleVaule = choose[0].dictValue
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
380
src/views/goods/category/index.vue
Normal file
380
src/views/goods/category/index.vue
Normal file
@@ -0,0 +1,380 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="商品类别" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="类别名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="类别编码">
|
||||
<el-input v-model="queryParams.params.code" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否一物一码">
|
||||
<el-select v-model="queryParams.params.goodID" placeholder="请选择" @change="selectIsGoodIDChange">
|
||||
<el-option v-for="item in isGoodIDList" :key="item.sid" :label="item.name" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库规则">
|
||||
<el-select v-model="queryParams.params.outStockRule" placeholder="请选择"
|
||||
@change="selectOutStockRuleChange">
|
||||
<el-option v-for="item in outStockRuleList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">类别列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否一物一码" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isGoodsID" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="0" @change="enableChange2(scope.row.sid,scope.row.isGoodsID)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsTypeName" label="类别名称" align="center" />
|
||||
<el-table-column prop="goodsTypeCode" label="类别编码" align="center" />
|
||||
<el-table-column prop="pname" label="上级类别" align="center" />
|
||||
<el-table-column prop="percentageRate" label="提成比例" align="center" />
|
||||
<el-table-column prop="percentageAmount" label="提成金额" align="center" />
|
||||
<el-table-column prop="outStockRuleVaule" label="出库规则" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/category.js'
|
||||
import {
|
||||
typeValues
|
||||
} from '@/api/Common/dictcommons.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './categoryAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
code: '',
|
||||
goodID: '',
|
||||
outStockRule: '',
|
||||
}
|
||||
},
|
||||
isGoodIDList: [{
|
||||
sid: "0",
|
||||
name: '否'
|
||||
},
|
||||
{
|
||||
sid: "1",
|
||||
name: '是'
|
||||
}
|
||||
],
|
||||
outStockRuleList: [],
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
this.getDictValue()
|
||||
},
|
||||
methods: {
|
||||
getDictValue() {
|
||||
|
||||
var params = {
|
||||
type: "goodsOutRule",
|
||||
psid: '0'
|
||||
}
|
||||
|
||||
typeValues(params).then(resp => {
|
||||
console.log('>>>>>>>>>typeValues', resp)
|
||||
this.outStockRuleList = resp.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
selectIsGoodIDChange(val) {
|
||||
|
||||
},
|
||||
selectOutStockRuleChange(val) {
|
||||
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: '',
|
||||
code: '',
|
||||
goodID: '',
|
||||
outStockRule: '',
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
enableChange2(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsGoodsID(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
248
src/views/goods/factory/factoryAdd.vue
Normal file
248
src/views/goods/factory/factoryAdd.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>厂家信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 厂家名称</div>
|
||||
<el-form-item prop="manufacturerName">
|
||||
<el-input v-model="formobj.manufacturerName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty"><span class="must">*</span> 厂家编码</div>
|
||||
<el-form-item prop="manufacturerCode">
|
||||
<el-input v-model="formobj.manufacturerCode" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 排序</div>
|
||||
<el-form-item prop="sortNo">
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
<!-- <el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 厂家名称:</span>
|
||||
<el-input v-model="formobj.manufacturerName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 厂家编码:</span>
|
||||
<el-input v-model="formobj.manufacturerCode" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 厂家排序:</span>
|
||||
<el-input v-model="formobj.sortNo" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">厂家备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/factory.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
manufacturerName: '',
|
||||
manufacturerCode: '',
|
||||
sortNo: '',
|
||||
remarks: "",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
rules: {
|
||||
manufacturerName: [{
|
||||
required: true,
|
||||
message: '厂家名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
manufacturerCode: [{
|
||||
required: true,
|
||||
message: '厂家编码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
sortNo: [{
|
||||
required: true,
|
||||
message: '排序不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.manufacturerName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "厂家名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.manufacturerCode == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "厂家编码不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// if (this.formobj.sortNo == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "厂家排序不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveFacturer(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
manufacturerName: '',
|
||||
manufacturerCode: '',
|
||||
sortNo: '',
|
||||
remarks: "",
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
req.initFacturer(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
302
src/views/goods/factory/index.vue
Normal file
302
src/views/goods/factory/index.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="厂家列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="厂家名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">厂家列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="manufacturerName" label="厂家名称" align="center" />
|
||||
<el-table-column prop="manufacturerCode" label="厂家编码" align="center" />
|
||||
<el-table-column prop="sortNo" label="排序" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/factory.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './factoryAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
1162
src/views/goods/goods/goodsAdd.vue
Normal file
1162
src/views/goods/goods/goodsAdd.vue
Normal file
File diff suppressed because it is too large
Load Diff
518
src/views/goods/goods/goodsAdd2.vue
Normal file
518
src/views/goods/goods/goodsAdd2.vue
Normal file
@@ -0,0 +1,518 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 商品名称</div>
|
||||
<el-form-item prop="goodsName">
|
||||
<el-input v-model="formobj.goodsName" placeholder="商品名称" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 商品编码</div>
|
||||
<el-form-item prop="goodsCode">
|
||||
<el-input v-model="formobj.goodsCode" placeholder="商品编码" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">条形码</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.barCode" placeholder="由系统自动生成" :readonly="true" class="addinputw addinputInfo"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"> 拼音缩写</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.goodsPY" placeholder="由系统自动生成" :readonly="true" class="addinputw addinputInfo"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 计量单位</div>
|
||||
<el-form-item prop="goodsUnitName">
|
||||
<el-select v-model="formobj.goodsUnitName" placeholder="请选择计量单位" class="addinputw"
|
||||
@change="selectunitNameChange">
|
||||
<el-option v-for="item in unitNameList" :key="item.sid" :label="item.unitName" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 商品类别</div>
|
||||
<el-form-item prop="goodsTypeName">
|
||||
<el-select v-model="formobj.goodsTypeName" placeholder="请选择商品类别" class="addinputw"
|
||||
@change="selectCateChange">
|
||||
<el-option v-for="item in cateList" :key="item.sid" :label="item.goodsTypeName" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">规格</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.indexes" placeholder="规格" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">保质期(天)</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.shelfLife " placeholder="保质期(天)" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 品牌</div>
|
||||
<el-form-item prop="brandName">
|
||||
<el-select v-model="formobj.brandName" placeholder="请选择品牌" class="addinputw" @change="selectBrandChange">
|
||||
<el-option v-for="item in brandList" :key="item.sid" :label="item.brandName" :value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<div class="span-sty"><span class="must">*</span> 厂家</div>
|
||||
<el-form-item prop="manufacturerName">
|
||||
<el-select v-model="formobj.manufacturerName" placeholder="请选择厂家" class="addinputw"
|
||||
@change="selectfacturerChange">
|
||||
<el-option v-for="item in facturerList" :key="item.sid" :label="item.manufacturerName"
|
||||
:value="item.sid" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">原厂标志</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isOriginalFactory" size="small" class="addinputw"
|
||||
@change="selectIsOriginalFactory">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 库存上限</div>
|
||||
<el-form-item prop="inventoryAlertUpperLimit">
|
||||
<el-input v-model="formobj.inventoryAlertUpperLimit" placeholder="库存上限" class="addinputw addinputInfo"
|
||||
clearable oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty"><span class="must">*</span> 库存下限</div>
|
||||
<el-form-item prop="inventoryAlertLowerLimit">
|
||||
<el-input v-model="formobj.inventoryAlertLowerLimit" placeholder="库存下限" class="addinputw addinputInfo"
|
||||
clearable oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty"><span class="must">*</span> 排序</div>
|
||||
<el-form-item prop="sortNo">
|
||||
<el-input v-model="formobj.sortNo" placeholder="排序" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.skuRemarks" placeholder="备注" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">锁定销售定价</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isLockingSalesPrice" size="small" class="addinputw"
|
||||
@change="selectIsLockingSalesPrice">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">销售底价</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.minimumSalesPrice" placeholder="销售底价" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">三包价格</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.standardPurchasePrice" placeholder="三包价格" class="addinputw addinputInfo"
|
||||
clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">首保价格</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.agencyPrice" placeholder="首保价格" class="addinputw addinputInfo" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品图片</div>
|
||||
<el-form-item>
|
||||
<upload-img ref="uploadImg" class="addinputw addinputInfo" v-model="imgList" :limit="50" bucket="map"
|
||||
:upload-data="{ type: '0001' }" @change="backData" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
import req2 from '@/api/goods/brand.js'
|
||||
import req3 from '@/api/goods/category.js'
|
||||
import req4 from '@/api/goods/factory.js'
|
||||
import req5 from '@/api/goods/unit.js'
|
||||
import uploadImg from '@/components/uploadFile/uploadImg'
|
||||
export default {
|
||||
components: {
|
||||
uploadImg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
activeNames: ['1'],
|
||||
imgList: [],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
"sid": "",
|
||||
"userSid": window.sessionStorage.getItem('userSid'),
|
||||
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||
"goodsName": "",
|
||||
"goodsCode": "",
|
||||
"goodsPY": "",
|
||||
"barCode": "",
|
||||
"goodsUnitSid": "",
|
||||
"goodsUnitName": "",
|
||||
"goodsTypeSid": "",
|
||||
"goodsTypeName": "",
|
||||
"indexes": "",
|
||||
"shelfLife": "",
|
||||
"brandSid": "",
|
||||
"brandName": "",
|
||||
"manufacturerSid": "",
|
||||
"manufacturerName": "",
|
||||
"isOriginalFactory": "2",
|
||||
"isOriginalFactoryValue": "",
|
||||
"sortNo": "",
|
||||
"skuRemarks": "",
|
||||
"inventoryAlertUpperLimit": "",
|
||||
"inventoryAlertLowerLimit": "",
|
||||
"isLockingSalesPrice": "2",
|
||||
"isLockingSalesPriceValue": "",
|
||||
"minimumSalesPrice": "",
|
||||
"standardPurchasePrice": "",
|
||||
"agencyPrice": "",
|
||||
"picPath": []
|
||||
},
|
||||
brandList: [],
|
||||
cateList: [],
|
||||
facturerList: [],
|
||||
unitNameList: [],
|
||||
rules: {
|
||||
goodsName: [{
|
||||
required: true,
|
||||
message: '商品名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
goodsCode: [{
|
||||
required: true,
|
||||
message: '商品编码不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
goodsUnitName: [{
|
||||
required: true,
|
||||
message: '请选择计量单位',
|
||||
trigger: 'change'
|
||||
}],
|
||||
goodsTypeName: [{
|
||||
required: true,
|
||||
message: '请选择商品类别',
|
||||
trigger: 'change'
|
||||
}],
|
||||
brandName: [{
|
||||
required: true,
|
||||
message: '请选择商品品牌',
|
||||
trigger: 'change'
|
||||
}],
|
||||
manufacturerName: [{
|
||||
required: true,
|
||||
message: '请选择商品厂家',
|
||||
trigger: 'change'
|
||||
}],
|
||||
sortNo: [{
|
||||
required: true,
|
||||
message: '商品排序不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
inventoryAlertUpperLimit: [{
|
||||
required: true,
|
||||
message: '商品上限不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
inventoryAlertLowerLimitt: [{
|
||||
required: true,
|
||||
message: '商品下限不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
selectIsOriginalFactory(val) {
|
||||
console.log('selectIsOriginalFactory》》》》', val)
|
||||
|
||||
this.formobj.isOriginalFactoryValue = val == '1' ? '是' : '否'
|
||||
|
||||
},
|
||||
selectIsLockingSalesPrice(val) {
|
||||
console.log('selectIsLockingSalesPrice》》》》', val)
|
||||
|
||||
this.formobj.isLockingSalesPriceValue = val == '1' ? '是' : '否'
|
||||
|
||||
},
|
||||
initData() {
|
||||
var parpams = {
|
||||
orgPath: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
req2.getAllBrand(parpams).then(resp => {
|
||||
this.brandList = resp.data
|
||||
})
|
||||
req3.getAllType(parpams).then(resp => {
|
||||
this.cateList = resp.data
|
||||
})
|
||||
req4.getAllFacturer(parpams).then(resp => {
|
||||
this.facturerList = resp.data
|
||||
})
|
||||
req5.getAllUnit(parpams).then(resp => {
|
||||
this.unitNameList = resp.data
|
||||
})
|
||||
},
|
||||
backData(value) {
|
||||
console.log('backData》》》》', value)
|
||||
console.log('imgList', this.imgList)
|
||||
|
||||
this.formobj.picPath = this.imgList
|
||||
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
req.saveGoods(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
"sid": "",
|
||||
"userSid": window.sessionStorage.getItem('userSid'),
|
||||
"orgPath": window.sessionStorage.getItem('orgSidPath'),
|
||||
"goodsName": "",
|
||||
"goodsCode": "",
|
||||
"goodsPY": "",
|
||||
"barCode": "",
|
||||
"goodsUnitSid": "",
|
||||
"goodsUnitName": "",
|
||||
"goodsTypeSid": "",
|
||||
"goodsTypeName": "",
|
||||
"indexes": "",
|
||||
"shelfLife": "",
|
||||
"brandSid": "",
|
||||
"brandName": "",
|
||||
"manufacturerSid": "",
|
||||
"manufacturerName": "",
|
||||
"isOriginalFactory": "2",
|
||||
"isOriginalFactoryValue": "",
|
||||
"sortNo": "",
|
||||
"skuRemarks": "",
|
||||
"inventoryAlertUpperLimit": "",
|
||||
"inventoryAlertLowerLimit": "",
|
||||
"isLockingSalesPrice": "2",
|
||||
"isLockingSalesPriceValue": "",
|
||||
"minimumSalesPrice": "",
|
||||
"standardPurchasePrice": "",
|
||||
"agencyPrice": "",
|
||||
"picPath": []
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
// var sid = require('uuid').v1()
|
||||
// console.log('>>>>>>>>>showAdd', sid)
|
||||
|
||||
// this.formobj.sid = sid this.$nextTick(() => {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
req.initGoods(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
selectBrandChange(val) {
|
||||
const choose = this.brandList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectBrandChange', choose)
|
||||
this.formobj.brandSid = choose[0].sid
|
||||
this.formobj.brandName = choose[0].brandName
|
||||
},
|
||||
selectCateChange(val) {
|
||||
const choose = this.cateList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectCateChange', choose)
|
||||
this.formobj.goodsTypeSid = choose[0].sid
|
||||
this.formobj.goodsTypeName = choose[0].goodsTypeName
|
||||
},
|
||||
selectfacturerChange(val) {
|
||||
const choose = this.facturerList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectfacturerChange', choose)
|
||||
this.formobj.manufacturerSid = choose[0].sid
|
||||
this.formobj.manufacturerName = choose[0].manufacturerName
|
||||
},
|
||||
selectunitNameChange(val) {
|
||||
const choose = this.unitNameList.filter((item) => item.sid == val)
|
||||
console.log('>>>>>>>>>selectunitNameChange', choose)
|
||||
this.formobj.goodsUnitSid = choose[0].sid
|
||||
this.formobj.goodsUnitName = choose[0].unitName
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
585
src/views/goods/goods/goodsInfo.vue
Normal file
585
src/views/goods/goods/goodsInfo.vue
Normal file
@@ -0,0 +1,585 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品名称</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品简称</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsShortName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品副标题</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.subTitle}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row>
|
||||
|
||||
|
||||
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品拼音缩写</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsPY}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品编码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品条形码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.barCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品品牌</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.brandName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品类别</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.typeName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品单位</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsUnitName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品厂家</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.manufacturerName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">厂家货号</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.factoryCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否上架</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isListed" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">上架</el-radio>
|
||||
<el-radio :label="'2'">下架</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">外部编码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.externalCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">国标码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.nationalStandardCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">税率</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.taxRate}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<!-- <el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">保质期天</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.shelfLife}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品排序</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.sortNo}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">商品备注</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.remarks}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品详细说明</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.goodsExplain}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品描述</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.goodsDescription}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品通用规格参数</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.genericSpec}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">商品特有规格参数</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.baseGoodsSpuDetail.specialSpec}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
<div class="title titleOne">
|
||||
<div>规格列表</div>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="formobj.baseGoodsSkus" border>
|
||||
<!-- <el-table-column type="selection" align="center" width="50"/> -->
|
||||
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
|
||||
<el-table-column label="规格代码" prop="goodsSkuCode" align="center" />
|
||||
<el-table-column label="商品标题" prop="title" align="center" />
|
||||
<el-table-column label="外部编码" prop="externalCode" align="center" />
|
||||
<el-table-column label="特有规格属性" prop="indexes" align="center" />
|
||||
<el-table-column label="特有规格参数" prop="ownSpec" align="center" />
|
||||
<el-table-column label="规格明细" wid align="center" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini"
|
||||
@click="showGoodsSkuDttail(scope.row.baseGoodsSkuExtend)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-dialog title="查看规格明细" :visible.sync="dialogVisible" :before-close="handleClose">
|
||||
|
||||
<el-form ref="dataForm1" class="formaddcopy02" style="margin-top: -40px;" :model="itemInfo">
|
||||
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">最后采购价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.finalPurchasePrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">安全库存天数</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.safetyStockDays}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否原厂</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isOriginalFactory" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否库存警戒</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isInventoryAlert" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">库存警戒上线</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.inventoryAlertUpperLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">库存警戒下线</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.inventoryAlertLowerLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">成本价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.costPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">吊牌价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.tagPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">销售单价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.salesPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">标准进价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.standardPurchasePrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">代理价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.agencyPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">折扣</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.discount}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">最低零售价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.minimumSalesPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">是否积分兑换</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isIntegralExchange" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">积分数量</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.integralAmount}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">锁定销售价格</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="itemInfo.isLockingSalesPrice" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">排序</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.sortNo}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{itemInfo.remarks}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">规格图片</div>
|
||||
<el-form-item>
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item,index) in itemInfo.urls" :key="index" class="addinputInfo">
|
||||
<el-popover placement="left" trigger="click" width="300">
|
||||
<img :src="item.url" width="100%" />
|
||||
<img slot="reference" :src="item.url" :alt="item.url"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||
</el-popover>
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
|
||||
<el-button type="primary" style="margin-top: 20px;" @click="handleClose">关 闭</el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
activeNames: ['1'],
|
||||
imgList: [],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
goodsName: "",
|
||||
goodsCode: "",
|
||||
brandSid: "",
|
||||
brand: "",
|
||||
goodsTypeSid: "",
|
||||
typeName: "",
|
||||
manufacturersid: "",
|
||||
manufacturer: "",
|
||||
externalCode: '',
|
||||
factoryCode: '',
|
||||
taxRate: '',
|
||||
shelfLife: '',
|
||||
baseGoodsSpuDetail: {
|
||||
goodsExplain: "",
|
||||
goodsDescription: ""
|
||||
},
|
||||
baseGoodsSkuDtos: []
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
dialogVisible: false,
|
||||
dialogVisible2: false,
|
||||
itemInfo: {},
|
||||
orderInfo: {}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.imgList = []
|
||||
this.hideUploadBtn = true
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
brand: "",
|
||||
brandSid: "",
|
||||
typeName: "",
|
||||
goodsTypeSid: "",
|
||||
manufacturer: "",
|
||||
manufacturerSid: "",
|
||||
goodsName: '',
|
||||
goodsCode: '',
|
||||
barcode: '',
|
||||
producer: '',
|
||||
unit: '',
|
||||
specification: '',
|
||||
remarks: '',
|
||||
baseGoodsSpuDetail: {
|
||||
goodsExplain: "",
|
||||
goodsDescription: ""
|
||||
},
|
||||
baseGoodsSku: []
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
showEdit(row) {
|
||||
req.initGoods(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
showGoodsSkuDttail(goodsSkuDto) {
|
||||
console.log('>>>>>>>>>showGoodsSkuDttail', goodsSkuDto)
|
||||
|
||||
this.dialogVisible = true
|
||||
this.itemInfo = goodsSkuDto
|
||||
},
|
||||
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
handleClose2() {
|
||||
this.dialogVisible2 = false
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
270
src/views/goods/goods/goodsInfo2.vue
Normal file
270
src/views/goods/goods/goodsInfo2.vue
Normal file
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||
<div class="title">
|
||||
<div>基础信息</div>
|
||||
</div>
|
||||
<el-row class="first_row">
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品名称</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品编码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品条形码</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.barCode}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品拼音缩写</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsPY}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品单位</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsUnitName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品类别</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.goodsTypeName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">规格</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.indexes}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">保质期(天)</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.shelfLife}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品品牌</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.brandName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<div class="span-sty">商品厂家</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.manufacturerName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">原厂标志</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isOriginalFactory" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">商品排序</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.sortNo}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty">商品备注</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.skuRemarks}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">库存上限</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.inventoryAlertUpperLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<div class="span-sty">库存下限</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.inventoryAlertLowerLimit}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">锁定销售定价</div>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="formobj.isLockingSalesPrice" :disabled="true" size="small" class="addinputw">
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
<el-radio :label="'2'">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">销售底价</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.minimumSalesPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">三包价格</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.standardPurchasePrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="span-sty">首保价格</div>
|
||||
<el-form-item>
|
||||
<span class="addinputInfo">{{formobj.agencyPrice}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="24">
|
||||
<div class="span-sty">规格图片</div>
|
||||
<el-form-item>
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(item,index) in formobj.picPath" :key="index" class="addinputInfo">
|
||||
<el-popover placement="left" trigger="click" width="300">
|
||||
<img :src="item.url" width="100%" />
|
||||
<img slot="reference" :src="item.url" :alt="item.url"
|
||||
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||
</el-popover>
|
||||
</span>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formobj: {},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {},
|
||||
indexMethod(index) {
|
||||
return index + 1
|
||||
},
|
||||
showEdit(row) {
|
||||
req.initGoods(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
446
src/views/goods/goods/index.vue
Normal file
446
src/views/goods/goods/index.vue
Normal file
@@ -0,0 +1,446 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="商品列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="商品名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit" :hidden="false">商品列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column width="50" type="selection" align="center" />
|
||||
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<el-table-column label="操作" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">详情</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsName" label="商品名称" align="center" />
|
||||
<el-table-column prop="goodsCode" label="商品编码" align="center" />
|
||||
<el-table-column prop="barCode" label="商品条码" align="center" />
|
||||
<el-table-column prop="brandName" label="商品品牌" align="center" />
|
||||
<el-table-column prop="typeName" label="商品类别" align="center" />
|
||||
<el-table-column prop="goodsUnitName" label="商品单位" align="center" />
|
||||
<el-table-column prop="manufacturerName" label="商品厂家" align="center" />
|
||||
<el-table-column prop="nationalStandardCode" label="国标码" align="center" />
|
||||
<el-table-column prop="taxRate" label="税率" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
<!-- 详情部分组件 -->
|
||||
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||
|
||||
<!-- 导入 -->
|
||||
<el-dialog :visible.sync="dialogVisible" width="60%" :show-close="false">
|
||||
<div style="margin-top: -40px;">
|
||||
<el-button size="medium" type="text" style="font-weight: bold" @click="downLoad">下载商品导入明细模板</el-button>
|
||||
|
||||
</div>
|
||||
<div style="margin-top: 10px;font-weight: bold">导入的EXCEL中的抬头的顺序和名字请保持一致!否则导入数据不正确。</div>
|
||||
<div style="margin-top: 5px;font-weight: bold">导入之前,请仔细检查数据中不能存在"\这些特殊字符。</div>
|
||||
<div style="margin-top: 5px;font-weight: bold">只能导入xls或者xlsx文件,如果导入内容较多,请耐心等待响应。</div>
|
||||
<el-card class="box-card" style="margin-top: 10px;">
|
||||
<div>
|
||||
<el-upload ref="upload" class="upload-demo" accept=".xls,.xlsx" name="file" :action="updateAction"
|
||||
:on-success="handleSuccess" :file-list="fileList" :auto-upload="false" :multiple="false" :limit="1"
|
||||
:data="uploadData" :headers="headers">
|
||||
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div>
|
||||
<h3>文件上传结果</h3>
|
||||
<el-card class="box-card">
|
||||
<div>{{ uploadResultMesssage }}</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
|
||||
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/goods.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './goodsAdd.vue'
|
||||
import divInfo from './goodsInfo.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd,
|
||||
divInfo,
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
btndisabled: false,
|
||||
updateAction: process.env.VUE_APP_BASE_API + '/oms/apiadmin/base/basegoodsspu/importExcel',
|
||||
fileList: [],
|
||||
uploadSuccess: false,
|
||||
uploadResultMesssage: '',
|
||||
uploadData: {
|
||||
sid: ''
|
||||
},
|
||||
headers: {
|
||||
token: window.sessionStorage.getItem('token')
|
||||
},
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'success',
|
||||
size: 'small',
|
||||
icon: '',
|
||||
btnKey: 'doImport',
|
||||
btnLabel: '导入商品'
|
||||
}, {
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
downLoad() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.downloadExcel().then((resp) => {
|
||||
loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const fileName = '商品导入明细模版' + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
elink.download = fileName
|
||||
elink.style.display = 'nonde'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
submitUpload() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
handleSuccess(resp, file, fileList) {
|
||||
const _this = this
|
||||
_this.uploadResultMesssage = resp.msg
|
||||
_this.uploadSuccess = resp.success
|
||||
|
||||
},
|
||||
handleConfirm() {
|
||||
if (!this.uploadSuccess) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'error',
|
||||
message: '请先上传商品导入明细'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.dialogVisible = false
|
||||
this.loadList()
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case "doImport":
|
||||
this.doImport()
|
||||
break
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
doImport() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 4
|
||||
this.$refs['divinfo'].showEdit(row)
|
||||
},
|
||||
toRelevancyInfo(row) {
|
||||
const tip = '请确认是否删除所选品牌?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteGoods(row.sid).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
302
src/views/goods/unit/index.vue
Normal file
302
src/views/goods/unit/index.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-show="viewState == 1">
|
||||
<button-bar ref="btnbar" view-title="计量单位" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<div class="main-content">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="计量单位名称">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">计量单位列表</div>
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||
@selection-change="selectionLineChangeHandle">
|
||||
<el-table-column fixed width="50" type="selection" align="center" />
|
||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||
<!-- <el-table-column label="操作" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="是否可用" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-text="是" inactive-text="否" active-value="1"
|
||||
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unitName" label="计量单位名称" align="center" />
|
||||
<el-table-column prop="remarks" label="计量单位备注" align="center" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
<div class="pages">
|
||||
<div class="tit" />
|
||||
<!-- 翻页 -->
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/unit.js'
|
||||
import ButtonBar from '@/components/ButtonBar'
|
||||
import Pagination from '@/components/pagination'
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './unitAdd.vue'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
Pagination,
|
||||
pageye,
|
||||
divAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'toAdd',
|
||||
btnLabel: '新增'
|
||||
},
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
icon: 'edit',
|
||||
btnKey: 'toEdit',
|
||||
btnLabel: '编辑'
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
icon: 'plus',
|
||||
btnKey: 'doDel',
|
||||
btnLabel: '删除'
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
icon: 'cross',
|
||||
btnKey: 'doClose',
|
||||
btnLabel: '关闭'
|
||||
}
|
||||
],
|
||||
queryParams: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
this.loadList()
|
||||
},
|
||||
methods: {
|
||||
selectionLineChangeHandle(val) {
|
||||
console.log("val", val);
|
||||
|
||||
this.selectionList = val
|
||||
|
||||
const aa = []
|
||||
val.forEach(element => {
|
||||
aa.push(element.sid)
|
||||
})
|
||||
this.sids = aa
|
||||
},
|
||||
// 搜索条件效果
|
||||
clicksearchShow() {
|
||||
this.isSearchShow = !this.isSearchShow
|
||||
if (this.isSearchShow) {
|
||||
this.searchxianshitit = '隐藏查询条件'
|
||||
} else {
|
||||
this.searchxianshitit = '显示查询条件'
|
||||
}
|
||||
},
|
||||
btnHandle(btnKey) {
|
||||
switch (btnKey) {
|
||||
case 'toAdd':
|
||||
this.toAdd()
|
||||
break
|
||||
case 'toEdit':
|
||||
this.toEdit()
|
||||
break
|
||||
case 'doDel':
|
||||
this.doDel()
|
||||
break
|
||||
case 'doClose':
|
||||
this.doClose()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
loadList() {
|
||||
this.tableLoading = true
|
||||
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.queryParams.params.orgPath = window.sessionStorage.getItem('orgSidPath')
|
||||
this.queryParams.params.menuUrl = this.$route.path
|
||||
req.listPage(this.queryParams).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.success) {
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
this.dataList = data.records
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
this.queryParams.total = 0
|
||||
}
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
// 序号
|
||||
indexMethod(index) {
|
||||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||
var pageindex = index + 1 + pagestart
|
||||
return pageindex
|
||||
},
|
||||
dosearch() {
|
||||
this.queryParams.current = 1
|
||||
this.loadList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
},
|
||||
toAdd() {
|
||||
this.viewState = 2
|
||||
this.$refs['divadd'].showAdd()
|
||||
},
|
||||
|
||||
doClose() {
|
||||
this.$store.dispatch('tagsView/delView', this.$route)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toEdit() {
|
||||
|
||||
if (this.selectionList.length != 1) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: "请选择一条数据。",
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(this.selectionList[0])
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
if (this.sids.length > 0) {
|
||||
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
||||
this.$confirm(tip, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
req.deleteBySids(this.sids).then((resp) => {
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.loadList()
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(() => {})
|
||||
} else {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '请至少选择一条记录进行删除操作'
|
||||
})
|
||||
}
|
||||
},
|
||||
resetState() {
|
||||
this.viewState = 1
|
||||
},
|
||||
enableChange(sid, state) {
|
||||
console.log('sid', sid)
|
||||
console.log('state', state)
|
||||
req.updateIsEnable(sid, state).then((resp) => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '状态已更新',
|
||||
showClose: true
|
||||
})
|
||||
} else { // 根据resp.code进行异常情况处理
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
188
src/views/goods/unit/unitAdd.vue
Normal file
188
src/views/goods/unit/unitAdd.vue
Normal file
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>计量单位信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
|
||||
|
||||
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||
|
||||
<el-row class="first_row">
|
||||
<el-col :span="8">
|
||||
|
||||
<div class="span-sty"><span class="must">*</span> 计量单位名称</div>
|
||||
<el-form-item prop="unitName">
|
||||
<el-input v-model="formobj.unitName" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="16">
|
||||
<div class="span-sty">备注</div>
|
||||
<el-form-item>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- <el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text"><span class="must">*</span> 计量单位名称:</span>
|
||||
<el-input v-model="formobj.unitName" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">计量单位备注:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
</el-card> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/goods/unit.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: '',
|
||||
unitName: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
},
|
||||
rules: {
|
||||
unitName: [{
|
||||
required: true,
|
||||
message: '计量单位名称不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.initData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
saveOrUpdate() {
|
||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||
|
||||
// if (this.formobj.unitName == '') {
|
||||
// this.$message({
|
||||
// showClose: true,
|
||||
// type: 'warning',
|
||||
// message: "计量单位名称不能为空"
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
this.$refs['form_obj'].validate((valid) => {
|
||||
if (valid) {
|
||||
req.saveUnits(this.formobj)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: resp.msg
|
||||
})
|
||||
this.handleReturn('true')
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
handleReturn(isreload) {
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.formobj = {
|
||||
sid: '',
|
||||
unitName: '',
|
||||
remarks: '',
|
||||
orgPath: window.sessionStorage.getItem('orgSidPath'),
|
||||
useOrgSid: window.sessionStorage.getItem('defaultDeptSid'),
|
||||
userSid: window.sessionStorage.getItem('userSid'),
|
||||
createOrgSid: window.sessionStorage.getItem('orgSid'),
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
showAdd() {
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
},
|
||||
showEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form_obj'].clearValidate()
|
||||
})
|
||||
|
||||
req.initUnits(row.sid)
|
||||
.then(resp => {
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .el-form-item__error {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.span-sty {
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
.addinputInfo {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
|
||||
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||
margin-left: 120px !important;
|
||||
width: calc(100% - 115px);
|
||||
}
|
||||
|
||||
.first_row {
|
||||
border-top: 1px solid #E0E3EB;
|
||||
}
|
||||
|
||||
.titleOne {
|
||||
padding: 7px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -97,7 +97,7 @@
|
||||
<el-option hidden :key="form.psid" :label="form.pname" :value="form.pname"></el-option>
|
||||
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
||||
:props="defaultProps" @check-change="checkchange" @node-click="departmentClick">
|
||||
:props="defaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
<el-option hidden :key="form.psid" :label="form.pname" :value="form.pname"></el-option>
|
||||
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
||||
:props="defaultProps" @check-change="checkchange" @node-click="departmentClick">
|
||||
:props="defaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
</td>
|
||||
@@ -399,8 +399,8 @@
|
||||
this.form.psid = '0'
|
||||
this.form.pname = '顶级菜单'
|
||||
} else {
|
||||
this.form.psid = data.sid
|
||||
this.form.pname = data.name
|
||||
this.form.psid = data.psid
|
||||
this.form.pname = data.pname
|
||||
}
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
@@ -477,9 +477,9 @@
|
||||
this.form.isShow = '1'
|
||||
this.form.menuType = '0'
|
||||
// this.form.psid = row.sid || 0
|
||||
this.form.sourceName = 'wms'
|
||||
this.form.sourceName = 'oms'
|
||||
this.form.sourceSid = 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
this.form.pname = ''
|
||||
this.form.pname = '顶级菜单'
|
||||
this.form.psid = '0'
|
||||
// this.sourceMenus()
|
||||
} else {
|
||||
|
||||
@@ -442,8 +442,8 @@
|
||||
this.roleForm.roleSid = []
|
||||
this.roleDialog = true
|
||||
this.roleForm.sid = row.sid
|
||||
this.roleForm.userSid = window.sessionStorage.getItem('userSid')
|
||||
this.roleForm.orgsid = window.sessionStorage.getItem('orgSid')
|
||||
this.roleForm.userSid = row.sid
|
||||
this.roleForm.orgSid = window.sessionStorage.getItem('orgSid')
|
||||
setRole(this.roleForm).then(res => {
|
||||
this.roleList = res.data
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
@@ -499,6 +499,38 @@
|
||||
},
|
||||
save() {
|
||||
this.form.orgSid = this.form.orgSid == '' ? window.sessionStorage.getItem('orgSid') : this.form.orgSid
|
||||
|
||||
if (this.form.userName == '') {
|
||||
this.$message({
|
||||
message: '账号不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.form.name == '') {
|
||||
this.$message({
|
||||
message: '姓名不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.form.sysStaffOrg.orgSid == '' || this.form.sysStaffOrg.orgName == '') {
|
||||
this.$message({
|
||||
message: '部门不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.form.sysUserRoles.length == 0) {
|
||||
this.$message({
|
||||
message: '角色不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
userUpdata(this.form).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.$message({
|
||||
@@ -528,6 +560,7 @@
|
||||
},
|
||||
// 修改用户信息
|
||||
userinfoChange(row) {
|
||||
row.defaultDeptSid = window.sessionStorage.getItem('defaultDeptSid')
|
||||
initUserInfo(row).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.editDialog = true
|
||||
|
||||
Reference in New Issue
Block a user