Browse Source
# Conflicts: # yxt-oa/src/main/java/com/yxt/anrui/oa/feign/file/OaFileEnum.javazhanglei
160 changed files with 7610 additions and 612 deletions
@ -0,0 +1,34 @@ |
|||||
|
package com.yxt.anrui.flowable.api.flow3; |
||||
|
|
||||
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
||||
|
import com.yxt.anrui.flowable.api.flow2.FlowFeignback; |
||||
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/2/12 |
||||
|
**/ |
||||
|
@FeignClient( |
||||
|
contextId = "anrui-flowable-Flow3", |
||||
|
name = "anrui-flowable", |
||||
|
path = "v3/flow", |
||||
|
fallback = Flow3Feignback.class) |
||||
|
public interface Flow3Feign { |
||||
|
|
||||
|
@ApiOperation(value = "启动流程") |
||||
|
@PostMapping(value = "/startProcess") |
||||
|
@ResponseBody |
||||
|
ResultBean<UpdateFlowFieldVo> startProcess(@RequestBody BusinessVariables dto); |
||||
|
|
||||
|
@ApiOperation(value = "处理流程") |
||||
|
@PostMapping(value = "/handleProsess") |
||||
|
@ResponseBody |
||||
|
ResultBean<UpdateFlowFieldVo> handleProsess(@RequestBody BusinessVariables bv); |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.yxt.anrui.flowable.api.flow3; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/2/12 |
||||
|
**/ |
||||
|
@Component |
||||
|
public class Flow3Feignback { |
||||
|
} |
@ -0,0 +1,366 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
export function typeValues(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/dictcommons/typeValues', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取数据字典(根据分组)
|
||||
|
export function getTypeValueList(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/dictcommons/getTypeValueList', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取所有分公司
|
||||
|
export function selectOrgSidList(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysorganization/selectOrgSidList', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据当前登录人orgSidPath(全路径sid)查询分公司
|
||||
|
export function getOrgSidByPath(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysstafforg/getOrgSidByPath', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据分公司sid查询分公司
|
||||
|
export function fetchBySid(sid) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysorganization/fetchBySid/' + sid, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据分公司全路径Sid获取分公司下开票信息(采购系统不能为空)
|
||||
|
// 开票单位
|
||||
|
export function getInvoicingList(data) { |
||||
|
return request({ |
||||
|
url: '/fin/v1/fincompanyinvoicing/getInvoicingList', |
||||
|
method: 'GET', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据分公司Sid获取分公司下所有的部门
|
||||
|
export function getListDeptByOrgSid(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysorganization/getListDeptByOrgSid/' + data, |
||||
|
method: 'GET' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据分公司Sid获取分公司下部门对应的采购系统
|
||||
|
export function fetchDetailsByUseOrgSid(data) { |
||||
|
return request({ |
||||
|
url: '/base/v1/basepurchasesystem/fetchDetailsByUseOrgSid/' + data, |
||||
|
method: 'GET' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据部门sid查询部门信息
|
||||
|
export function fetchByDepSid(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysorganization/selectBySid', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查当前部门所属一级站内的所有合作二级站
|
||||
|
export function tranFive(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysorganization//tranFive/' + data, |
||||
|
method: 'GET' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 调出一级站-调入当前一级站内所有二级站
|
||||
|
export function tranOne(data) { |
||||
|
return request({ |
||||
|
// baseURL: "http://127.0.0.1:4523/m1/4061550-0-default",
|
||||
|
url: '/portal/v1/sysorganization/tranOne/' + data, |
||||
|
method: 'GET' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 调出一级站-调入当前分公司内所有一级站,不包含自身
|
||||
|
export function tranTwo(data) { |
||||
|
return request({ |
||||
|
// baseURL: "http://127.0.0.1:4523/m1/4061550-0-default",
|
||||
|
url: '/portal/v1/sysorganization/tranTwo/' + data, |
||||
|
method: 'GET' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 调出一级站-调入当前选择分公司内所有一级站,不包含自身
|
||||
|
export function tranThree(data) { |
||||
|
return request({ |
||||
|
// baseURL: "http://127.0.0.1:4523/m1/4061550-0-default",
|
||||
|
url: '/portal/v1/sysorganization/tranThree/' + data.sid + "/" + data.deptSid, |
||||
|
method: 'GET', |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 调出二级站-调入上级一级站内所有二级站,不包含自身
|
||||
|
export function tranfour(data) { |
||||
|
return request({ |
||||
|
// baseURL: "http://127.0.0.1:4523/m1/4061550-0-default",
|
||||
|
url: '/portal/v1/sysorganization/tranfour/' + data, |
||||
|
method: 'GET' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取所有岗位
|
||||
|
export function postName(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/syspost/selectList', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据当前登录用户sid获取本分公司下的销售部门和销售专员
|
||||
|
export function selectOrgList(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysorganization/selectOrgList', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据当前登录用户的全路径查询财务部门下的所有人
|
||||
|
export function selFianceByOrgSidPath(data) { |
||||
|
return request({ |
||||
|
// baseURL: "http://127.0.0.1:4523/m1/4061550-0-default",
|
||||
|
url: '/portal/v1/sysstafforg/selFianceByOrgSidPath', |
||||
|
method: 'post', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据当前登录用户部门sid获取本部门下角色为维修技师的人员
|
||||
|
export function getUserByDeptSid(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysuser/getUserByDeptSid', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 当前用户创建申请时判断该用户是否有该菜单的操作权限
|
||||
|
export function selectHaveMessage(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysuser/selectHaveMessage ', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据当前登录用户的角色获取菜单分页列表页面右上角按钮的隐藏
|
||||
|
export function getButtonPermissions(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysfunction/getButtonPermissions', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取集团所有在职人员
|
||||
|
export function selectStaffListss() { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysstaffinfo/selectStaffListss', |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 根据当前登录用户的全路径查询相应部门下的所有人
|
||||
|
export function selAllByOrgSidPath(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/sysstafforg/selAllByOrgSidPath', |
||||
|
method: 'post', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 分公司全路径sid获取工种
|
||||
|
export function getServiceType(data) { |
||||
|
return request({ |
||||
|
url: '/as/v1/AsServiceItem/getServiceType', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 分公司全路径sid获取科目
|
||||
|
export function selSubjectInfo(data) { |
||||
|
return request({ |
||||
|
url: '/as/v1/asservicepackage/selSubjectInfo', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 分公司全路径sid获取班组
|
||||
|
export function getGroupList(data) { |
||||
|
return request({ |
||||
|
url: '/as/v1/asservicegroup/getGroupList', |
||||
|
method: 'post', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 部门sid获取索赔厂家
|
||||
|
export function getListByUseOrgSid(data) { |
||||
|
return request({ |
||||
|
url: '/as/v1/asserviceclaimanu/getListByUseOrgSid', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 部门sid获取维修项目(已备案且已启用的)
|
||||
|
export function getServiceItemListPage(data) { |
||||
|
return request({ |
||||
|
url: '/as/v1/AsServiceItem/getServiceItemListPage', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询分页列表 -- 客户列表
|
||||
|
export function customerList(params) { |
||||
|
return request({ |
||||
|
url: '/as/v1/ascustomervehicle/customerList', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取省
|
||||
|
export function getProvince() { |
||||
|
return request({ |
||||
|
url: '/portal/v1/regions/getProvince', |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
// 根据省sid获取该省的所有市
|
||||
|
export function getCity(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/regions/getCity', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
// 根据市sid获取该市的所有县区
|
||||
|
export function getCounty(data) { |
||||
|
return request({ |
||||
|
url: '/portal/v1/regions/getCounty', |
||||
|
method: 'get', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 获取售后服务--基础信息--供应商信息
|
||||
|
// 开票名称
|
||||
|
export function choiceSupplierInfo(data) { |
||||
|
return request({ |
||||
|
url: '/pms/v1/pmssupplierinfo/choiceSupplierInfo', |
||||
|
method: 'post', |
||||
|
params: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询分页列表 -- 商品列表 -- 从商品管理中获取数据
|
||||
|
export function chooseproducts(params) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodssku/getGoodsListPage', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询分页列表 -- 商品列表 -- 从商品售价列表中获取数据
|
||||
|
export function listPageSales(params) { |
||||
|
return request({ |
||||
|
url: '/sms/apiadmin/v1/smssalesbill/listPageSales', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询分页列表 -- 商品列表 -- 根据部门sid从库存商品中获取
|
||||
|
export function selInvenGoodsByUseOrgSid(params) { |
||||
|
return request({ |
||||
|
url: '/wms/apiadmin/inventory/wmsinventory/selInvenGoodsByUseOrgSid', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询分页列表 -- 商品列表
|
||||
|
export function getInventoryList(params) { |
||||
|
return request({ |
||||
|
url: '/wms/apiadmin/WmsOutBill/getInventoryList', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询分页列表 -- 维修工单列表
|
||||
|
export function getAsBusrepairBill(params) { |
||||
|
return request({ |
||||
|
url: '/as/v1/AsBusrepairBill/listPage', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
// 查询分页列表 --商品类别列表
|
||||
|
export function getGoodsCategory(params) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodstype/selectByUseOrgSid', |
||||
|
method: 'post', |
||||
|
data: params, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
export default { |
||||
|
// 查询分页列表
|
||||
|
listPage: function(data) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodsspu/oaGoodsListPage', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 商品-- 删除
|
||||
|
deleteBySids: function(data) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodsspu/delGoodsBySids', |
||||
|
method: 'DELETE', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 初始化
|
||||
|
initGoods: function(data) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodsspu/goodsDetails/' + data, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
}, |
||||
|
saveOrUpdate: function(data) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodsspu/saveOrUpdateOaGoods', |
||||
|
method: 'post', |
||||
|
data: data, |
||||
|
headers: { |
||||
|
'Content-Type': 'application/json' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 计量单位查询
|
||||
|
getUnit: function(params) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodsunit/listAll', |
||||
|
method: 'get', |
||||
|
params: params |
||||
|
}) |
||||
|
}, |
||||
|
// 厂家查询
|
||||
|
getFacturer: function(params) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basemanufacturer/listAll', |
||||
|
method: 'get', |
||||
|
params: params |
||||
|
}) |
||||
|
}, |
||||
|
// 商品类别查询
|
||||
|
getType: function(params) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodstype/listAll', |
||||
|
method: 'get', |
||||
|
params: params |
||||
|
}) |
||||
|
}, |
||||
|
// 商品品牌查询
|
||||
|
getBrand: function(params) { |
||||
|
return request({ |
||||
|
url: '/yxtbase/apiadmin/base/basegoodsbrand/listAll', |
||||
|
method: 'get', |
||||
|
params: params |
||||
|
}) |
||||
|
}, |
||||
|
} |
@ -0,0 +1,231 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken" |
||||
|
:action="uploadFile" :accept="accept" list-type="picture-card" |
||||
|
:file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview" |
||||
|
:on-progress="uploadProgrees" |
||||
|
:on-error="uploadError" :on-success="uploadImgSuccess_FuJian"> |
||||
|
<i class="el-icon-plus avatar-uploader-icon"/> |
||||
|
</el-upload> |
||||
|
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" title="查看图片"> |
||||
|
<img width="100%" :src="dialogImageUrl" alt=""> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { uploadFile } from '@/api/Common/Upload' |
||||
|
import { getStorage } from '@/utils/auth.js' |
||||
|
|
||||
|
export default { |
||||
|
model: { |
||||
|
prop: 'name', |
||||
|
event: 'change' |
||||
|
}, |
||||
|
props: { |
||||
|
placeholder: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
bucket: { |
||||
|
type: String, |
||||
|
default: 'abc' |
||||
|
}, |
||||
|
// 长度 |
||||
|
width: { |
||||
|
type: String, |
||||
|
default: '270px' |
||||
|
}, |
||||
|
limit: { |
||||
|
type: Number, |
||||
|
default: 1 |
||||
|
}, |
||||
|
accept: { |
||||
|
type: String, |
||||
|
default: |
||||
|
'.jpg,.jpeg,.png,' |
||||
|
}, |
||||
|
// 文件名称 |
||||
|
name: { |
||||
|
type: Array, |
||||
|
required: true |
||||
|
}, |
||||
|
uploadData: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dialogImageUrl: '', |
||||
|
dialogVisible: false, |
||||
|
accessToken: null, |
||||
|
uploadFile: uploadFile, |
||||
|
fileList_FuJian: [], |
||||
|
enclosure: '', |
||||
|
file_add: '', |
||||
|
file_catch: '', |
||||
|
files: [], |
||||
|
files_list: [], |
||||
|
filedUrl: '', |
||||
|
// fileUrl: fileUrl, |
||||
|
// showpicture:false, |
||||
|
isview: false, |
||||
|
nameArr: '', |
||||
|
loadding: false, |
||||
|
stateName: '' |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
name: { |
||||
|
deep: true, |
||||
|
immediate: true, |
||||
|
handler(newVal, oldVal) { |
||||
|
console.log('aaaa1', newVal) |
||||
|
console.log('aaaa2', oldVal) |
||||
|
this.files = newVal |
||||
|
console.log('aaaa2this.files', this.files) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.Init() |
||||
|
}) |
||||
|
}, |
||||
|
created() { |
||||
|
this.uploadFile = uploadFile // 接口 |
||||
|
this.accessToken = { |
||||
|
token: getStorage() |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 页面第一次加载 |
||||
|
Init() { |
||||
|
if (this.name !== undefined) { |
||||
|
this.files = [] |
||||
|
for (var i = 0; i < this.name.length; i++) { |
||||
|
if (this.name[i].url !== null && this.name[i].url !== undefined) { |
||||
|
this.files.push({ |
||||
|
name: this.name[i].name, |
||||
|
url: this.name[i].url |
||||
|
}) |
||||
|
} else { |
||||
|
this.files.push({ |
||||
|
name: this.name[i], |
||||
|
url: this.name[i] |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
// 上传方案--成功后执行 |
||||
|
uploadImgSuccess_FuJian(response, file, fileList) { |
||||
|
console.log('您选择的file:', file) |
||||
|
if (file.response.code === '200') { |
||||
|
this.loadding = false |
||||
|
// 返显图片 |
||||
|
this.filedUrl = this.fileUrl + file.response.data |
||||
|
// var uid = file.response.data |
||||
|
this.files.push({ |
||||
|
name: file.response.data.sourceFileName, |
||||
|
url: file.response.data.fullUrl, |
||||
|
filePath: file.response.data.filePath, |
||||
|
size: file.response.data.size |
||||
|
}) |
||||
|
this.$emit('change', this.files) |
||||
|
this.$emit('eett', this.files) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
removeImage(file, ImageFileList) { |
||||
|
this.files.splice(this.files.indexOf(file), 1) |
||||
|
const imgFiles = [] |
||||
|
|
||||
|
this.files.forEach((o) => { |
||||
|
imgFiles.push(o.url) |
||||
|
}) |
||||
|
this.$emit('fileChange', this.files) |
||||
|
this.$emit('change', this.files) |
||||
|
}, |
||||
|
handleRemove(file, fileList) { |
||||
|
console.log('file:' + JSON.stringify(file)) |
||||
|
console.log('fileList:' + JSON.stringify(fileList)) |
||||
|
this.enclosure = '' |
||||
|
// 1. 保存新增文件id(this.file_add) |
||||
|
this.getNewFileId(fileList) |
||||
|
// 2. 保存数据库读取的已有文件id(this.file_catch) |
||||
|
this.getCatchFileId(file) |
||||
|
// 3. 保存并拼接id |
||||
|
this.getFileId() |
||||
|
// 4. 返回拼接id |
||||
|
this.$emit('change', this.enclosure) |
||||
|
}, |
||||
|
// 返回this.file_add(新上传文件的id拼接集合) |
||||
|
getNewFileId(fileList) { |
||||
|
// debugger |
||||
|
this.file_add = '' |
||||
|
for (var i = 0; i < fileList.length; i++) { |
||||
|
if (fileList[i].response && fileList[i].response.code === '200') { |
||||
|
this.file_add = this.file_add + fileList[i].response.data + ',' |
||||
|
} |
||||
|
} |
||||
|
if (this.file_add !== '') { |
||||
|
this.file_add = this.file_add.substring(0, this.file_add.length - 1) |
||||
|
} |
||||
|
// console.log('1. this.file_add: ' + this.file_add) |
||||
|
}, |
||||
|
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
||||
|
getCatchFileId(file) { |
||||
|
for (var i = 0; i < this.files_list.length; i++) { |
||||
|
if (this.file_catch !== '') { |
||||
|
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
||||
|
if (this.files_list[i].name === file.name) { |
||||
|
// 2. 拆开file_catch到fils_arry |
||||
|
var fils_arry = this.file_catch.split(',') |
||||
|
// 3. 从fils_arry去除 this.files_list[i].id |
||||
|
var arry = [] |
||||
|
fils_arry.forEach((element) => { |
||||
|
// 不加载文件里面的 |
||||
|
if (element !== this.files_list[i].id) { |
||||
|
arry.push(element) |
||||
|
} |
||||
|
}) |
||||
|
// 4. 重新拼接成file_catch |
||||
|
this.file_catch = arry.join(',') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
// console.log('2. this.file_catch:' + this.file_catch) |
||||
|
}, |
||||
|
// 保存并拼接id |
||||
|
getFileId() { |
||||
|
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
||||
|
if (this.file_catch !== '') { |
||||
|
if (this.file_add !== '') { |
||||
|
this.enclosure = this.file_catch + ',' + this.file_add |
||||
|
} else { |
||||
|
this.enclosure = this.file_catch |
||||
|
} |
||||
|
} else { |
||||
|
this.enclosure = this.file_add |
||||
|
} |
||||
|
}, |
||||
|
handlePictureCardPreview(file) { |
||||
|
this.dialogVisible = true |
||||
|
this.dialogImageUrl = file.url |
||||
|
}, |
||||
|
// 上传失败 |
||||
|
uploadError() { |
||||
|
this.loadding = false |
||||
|
}, |
||||
|
uploadProgrees(event, file, fileList) { |
||||
|
if (Number(event.percent) > 0) { |
||||
|
this.loadding = true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped></style> |
@ -0,0 +1,377 @@ |
|||||
|
<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.createOrgName" placeholder="" clearable /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="商品名称"> |
||||
|
<el-input v-model="queryParams.params.goodsName" placeholder="" clearable /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="商品编码"> |
||||
|
<el-input v-model="queryParams.params.goodsCode" placeholder="" clearable /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="拼音缩写"> |
||||
|
<el-input v-model="queryParams.params.goodsPY" placeholder="" clearable /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="商品类别"> |
||||
|
<el-select v-model="queryParams.params.goodsTypeName" placeholder="请选择" class="addinputw addinputInfo" @change="selectCateChange"> |
||||
|
<el-option v-for="item in goodsTypeList" :key="item.sid" :label="item.goodsTypeName" :value="item.sid" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="品牌"> |
||||
|
<el-select v-model="queryParams.params.brandName" placeholder="请选择" class="addinputw addinputInfo" @change="selectBrandChange"> |
||||
|
<el-option v-for="item in brandList" :key="item.sid" :label="item.brandName" :value="item.sid" /> |
||||
|
</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" :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 fixed width="50" type="selection" align="center" /> |
||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" /> |
||||
|
<el-table-column fixed 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 fixed prop="goodsName" label="商品名称" width="120" align="center" /> |
||||
|
<el-table-column fixed prop="goodsCode" label="商品编码" width="120" align="center" /> |
||||
|
<el-table-column prop="goodsPY" label="拼音缩写" width="100" align="center" /> |
||||
|
<el-table-column prop="barCode" label="条形码" width="100" align="center" /> |
||||
|
<el-table-column prop="goodsLevelValue" label="商品等级" width="100" align="center" /> |
||||
|
<el-table-column prop="goodsTypeName" label="商品类别" width="100" align="center" /> |
||||
|
<el-table-column prop="brandName" label="品牌" width="100" align="center" /> |
||||
|
<el-table-column prop="indexes" label="规格" width="100" align="center" /> |
||||
|
<el-table-column prop="goodsUnitName" label="计量单位" width="100" align="center" /> |
||||
|
<el-table-column prop="shelfLife" label="保质期(天)" width="100" align="center" /> |
||||
|
<el-table-column prop="sortNo" label="排序号" width="100" align="center" /> |
||||
|
<el-table-column prop="inventoryAlertUpperLimit" label="库存上限" width="100" align="center" /> |
||||
|
<el-table-column prop="inventoryAlertLowerLimit" label="库存下限" width="100" align="center" /> |
||||
|
<el-table-column label="商品图片" align="center" width="100"> |
||||
|
<template slot-scope="scope"> |
||||
|
<div style="color: #1890FF; text-decoration: underline ;" v-show="scope.row.picPath.length > 0" @click="showImage(scope.row.picPath)">查看 |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</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 title="商品图片" :visible.sync="dialogVisible" :before-close="handleClose"> |
||||
|
<el-form ref="dataForm1" class="formadd" style="margin-top: -30px;"> |
||||
|
<el-row class="first_row"> |
||||
|
<el-col :span="24" class="trightb"> |
||||
|
<el-image style="width: 120px;height: 120px; margin: 10px; background: #f0f;" v-for="(item,index) in fileList" :key="index" :src="item.url" :preview-src-list="[item.url]"> |
||||
|
</el-image> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import req from '@/api/commodity/commodity' |
||||
|
import ButtonBar from '@/components/ButtonBar' |
||||
|
import Pagination from '@/components/pagination' |
||||
|
import divAdd from './commodityAdd.vue' |
||||
|
import divInfo from './commodityInfo.vue' |
||||
|
import { getOrgSidByPath } from '@/api/Common/dictcommons' |
||||
|
export default { |
||||
|
name: 'Commodity', |
||||
|
components: { |
||||
|
ButtonBar, |
||||
|
Pagination, |
||||
|
divAdd, |
||||
|
divInfo |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dialogVisible: false, |
||||
|
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: { |
||||
|
useOrgName: '', |
||||
|
createOrgName: '', |
||||
|
goodsName: '', |
||||
|
goodsCode: '', |
||||
|
goodsPY: '', |
||||
|
goodsTypeSid: '', |
||||
|
goodsTypeName: '', |
||||
|
brandSid: '', |
||||
|
brandName: '', |
||||
|
userSid: '', |
||||
|
orgPath: '', |
||||
|
menuUrl: '' |
||||
|
} |
||||
|
}, |
||||
|
sids: [], |
||||
|
selectionList: [], |
||||
|
brandList: [], |
||||
|
goodsTypeList: [], |
||||
|
fileList: [] |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$refs['btnbar'].setButtonList(this.btnList) |
||||
|
}, |
||||
|
created() { |
||||
|
this.loadList() |
||||
|
this.initData() |
||||
|
}, |
||||
|
methods: { |
||||
|
initData() { |
||||
|
var parpams = { useOrgSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) } |
||||
|
// 品牌 |
||||
|
req.getBrand(parpams).then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.brandList = resp.data |
||||
|
} |
||||
|
}) |
||||
|
// 类别 |
||||
|
req.getType(parpams).then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.goodsTypeList = resp.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
selectBrandChange(val) { |
||||
|
const choose = this.brandList.filter((item) => item.sid === val) |
||||
|
this.queryParams.params.brandSid = choose[0].sid |
||||
|
this.queryParams.params.brandName = choose[0].brandName |
||||
|
}, |
||||
|
selectCateChange(val) { |
||||
|
const choose = this.goodsTypeList.filter((item) => item.sid === val) |
||||
|
this.queryParams.params.goodsTypeSid = choose[0].sid |
||||
|
this.queryParams.params.goodsTypeName = choose[0].goodsTypeName |
||||
|
}, |
||||
|
// 搜索条件效果 |
||||
|
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 |
||||
|
} |
||||
|
}, |
||||
|
selectionLineChangeHandle(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('defaultOrgPath') |
||||
|
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: { |
||||
|
useOrgName: '', |
||||
|
createOrgName: '', |
||||
|
goodsName: '', |
||||
|
goodsCode: '', |
||||
|
goodsPY: '', |
||||
|
goodsTypeSid: '', |
||||
|
goodsTypeName: '', |
||||
|
brandSid: '', |
||||
|
brandName: '', |
||||
|
userSid: '', |
||||
|
orgPath: '', |
||||
|
menuUrl: '' |
||||
|
} |
||||
|
} |
||||
|
this.loadList() |
||||
|
}, |
||||
|
toAdd() { |
||||
|
this.viewState = 2 |
||||
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.$refs['divadd'].showAdd(res.data, window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
toEdit() { |
||||
|
if (this.selectionList.length === 1) { |
||||
|
this.viewState = 3 |
||||
|
this.$refs['divadd'].showEdit(this.selectionList[0]) |
||||
|
} else { |
||||
|
this.$message({ type: 'warning', message: '请选择一条数据进行操作', showClose: true }) |
||||
|
return |
||||
|
} |
||||
|
}, |
||||
|
doClose() { |
||||
|
this.$store.dispatch('tagsView/delView', this.$route) |
||||
|
this.$router.go(-1) |
||||
|
}, |
||||
|
toRelevancy(row) { |
||||
|
this.viewState = 4 |
||||
|
this.$refs['divinfo'].showInfo(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 |
||||
|
}, |
||||
|
showImage(paths) { |
||||
|
this.fileList = paths |
||||
|
this.dialogVisible = true |
||||
|
}, |
||||
|
handleClose() { |
||||
|
this.dialogVisible = false |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
</style> |
@ -0,0 +1,392 @@ |
|||||
|
<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 style="border-top: 1px solid #e0e3eb"> |
||||
|
<el-col :span="6"> |
||||
|
<div class="span-sty"><span class="icon">*</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="icon">*</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.goodsPY" 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.barCode" 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="icon">*</span>商品等级</div> |
||||
|
<el-form-item prop="goodsLevelKey"> |
||||
|
<el-select v-model="formobj.goodsLevelKey" placeholder="请选择商品等级" class="addinputw" @change="levelChange"> |
||||
|
<el-option v-for="item in goodsLevel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<div class="span-sty"><span class="icon">*</span>商品类型</div> |
||||
|
<el-form-item prop="goodsClassKey"> |
||||
|
<el-select v-model="formobj.goodsClassKey" placeholder="请选择商品等级" class="addinputw" @change="classChange"> |
||||
|
<el-option v-for="item in goodsClass_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<div class="span-sty"><span class="icon">*</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"><span class="icon">*</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-row> |
||||
|
<el-row> |
||||
|
<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"><span class="icon">*</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">保质期(天)</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-col :span="6"> |
||||
|
<div class="span-sty"><span class="icon">*</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-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<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"><span class="icon">*</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="6"> |
||||
|
<div class="span-sty"><span class="icon">*</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-col :span="12"> |
||||
|
<div class="span-sty"><span class="icon">*</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-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/commodity/commodity' |
||||
|
import { typeValues, getTypeValueList } from '@/api/Common/dictcommons' |
||||
|
import uploadImg from '@/components/uploadFile/uploadImg' |
||||
|
|
||||
|
export default { |
||||
|
name: 'CommodityAdd', |
||||
|
components: { |
||||
|
uploadImg |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
imgList: [], |
||||
|
submitdisabled: false, |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
userSid: '', |
||||
|
orgPath: '', |
||||
|
useOrgSid: '', |
||||
|
createOrgSid: '', |
||||
|
goodsName: '', |
||||
|
goodsCode: '', |
||||
|
goodsPY: '', |
||||
|
barCode: '', |
||||
|
goodsUnitSid: '', |
||||
|
goodsUnitName: '', |
||||
|
goodsTypeSid: '', |
||||
|
goodsTypeName: '', |
||||
|
indexes: '', |
||||
|
shelfLife: '', |
||||
|
brandSid: '', |
||||
|
brandName: '', |
||||
|
manufacturerSid: '', |
||||
|
manufacturerName: '', |
||||
|
sortNo: '', |
||||
|
skuRemarks: '', |
||||
|
inventoryAlertUpperLimit: '', |
||||
|
inventoryAlertLowerLimit: '', |
||||
|
goodsClassKey: '', // 商品类型key |
||||
|
goodsClassValue: '', // 商品类型 |
||||
|
goodsLevelKey: '', // 商品等级key |
||||
|
goodsLevelValue: '', // 商品等级 |
||||
|
picPath: [] |
||||
|
}, |
||||
|
brandList: [], |
||||
|
cateList: [], |
||||
|
facturerList: [], |
||||
|
unitNameList: [], |
||||
|
goodsLevel_list: [], |
||||
|
goodsClass_list: [], |
||||
|
rules: { |
||||
|
goodsName: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }], |
||||
|
goodsCode: [{ required: true, message: '商品编码不能为空', trigger: 'blur' }], |
||||
|
goodsUnitName: [{ required: true, message: '请选择计量单位', trigger: 'change' }], |
||||
|
goodsLevelKey: [{ required: true, message: '请选择商品等级', trigger: 'change' }], |
||||
|
goodsClassKey: [{ 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' }] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
initData() { |
||||
|
req.getBrand({ useOrgSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then(resp => { |
||||
|
this.brandList = resp.data |
||||
|
}) |
||||
|
req.getType({ useOrgSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then(resp => { |
||||
|
this.cateList = resp.data |
||||
|
}) |
||||
|
req.getFacturer({ useOrgSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then(resp => { |
||||
|
this.facturerList = resp.data |
||||
|
}) |
||||
|
req.getUnit({ useOrgSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then(resp => { |
||||
|
this.unitNameList = resp.data |
||||
|
}) |
||||
|
typeValues({ type: 'goodsLevel' }).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.goodsLevel_list = res.data |
||||
|
} |
||||
|
}) |
||||
|
getTypeValueList({ type: 'goodsClass', groupNum: 'xzgl' }).then((res) => { |
||||
|
if (res.success) { |
||||
|
this.goodsClass_list = res.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
showAdd(orgSid, deptSid) { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['form_obj'].clearValidate() |
||||
|
}) |
||||
|
this.formobj.userSid = window.sessionStorage.getItem('userSid') |
||||
|
this.formobj.useOrgSid = deptSid |
||||
|
this.formobj.createOrgSid = orgSid |
||||
|
this.initData() |
||||
|
}, |
||||
|
showEdit(row) { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['form_obj'].clearValidate() |
||||
|
}) |
||||
|
req.initGoods(row.sid).then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.formobj = resp.data |
||||
|
this.initData() |
||||
|
for (var i = 0; i < resp.data.picPath.length; i++) { |
||||
|
var item = resp.data.picPath[i] |
||||
|
this.imgList.push({ |
||||
|
url: item.url |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}).catch(e => { |
||||
|
this.formobj = row |
||||
|
}) |
||||
|
}, |
||||
|
selectBrandChange(val) { |
||||
|
const choose = this.brandList.filter((item) => item.sid === val) |
||||
|
if (choose !== null && choose.length > 0) { |
||||
|
this.formobj.brandSid = choose[0].sid |
||||
|
this.formobj.brandName = choose[0].brandName |
||||
|
} else { |
||||
|
this.formobj.brandSid = '' |
||||
|
this.formobj.brandName = '' |
||||
|
} |
||||
|
}, |
||||
|
levelChange(val) { |
||||
|
const choose = this.goodsLevel_list.filter((item) => item.dictKey === val) |
||||
|
if (choose !== null && choose.length > 0) { |
||||
|
this.formobj.goodsLevelValue = choose[0].dictValue |
||||
|
} else { |
||||
|
this.formobj.goodsLevelValue = '' |
||||
|
} |
||||
|
}, |
||||
|
classChange(val) { |
||||
|
const choose = this.goodsClass_list.filter((item) => item.dictKey === val) |
||||
|
if (choose !== null && choose.length > 0) { |
||||
|
this.formobj.goodsClassValue = choose[0].dictValue |
||||
|
} else { |
||||
|
this.formobj.goodsClassValue = '' |
||||
|
} |
||||
|
}, |
||||
|
selectCateChange(val) { |
||||
|
const choose = this.cateList.filter((item) => item.sid === val) |
||||
|
if (choose !== null && choose.length > 0) { |
||||
|
this.formobj.goodsTypeSid = choose[0].sid |
||||
|
this.formobj.goodsTypeName = choose[0].goodsTypeName |
||||
|
} else { |
||||
|
this.formobj.goodsTypeSid = '' |
||||
|
this.formobj.goodsTypeName = '' |
||||
|
} |
||||
|
}, |
||||
|
selectfacturerChange(val) { |
||||
|
const choose = this.facturerList.filter((item) => item.sid === val) |
||||
|
if (choose !== null && choose.length > 0) { |
||||
|
this.formobj.manufacturerSid = choose[0].sid |
||||
|
this.formobj.manufacturerName = choose[0].manufacturerName |
||||
|
} else { |
||||
|
this.formobj.manufacturerSid = '' |
||||
|
this.formobj.manufacturerName = '' |
||||
|
} |
||||
|
}, |
||||
|
selectunitNameChange(val) { |
||||
|
const choose = this.unitNameList.filter((item) => item.sid === val) |
||||
|
if (choose !== null && choose.length > 0) { |
||||
|
this.formobj.goodsUnitSid = choose[0].sid |
||||
|
this.formobj.goodsUnitName = choose[0].unitName |
||||
|
} else { |
||||
|
this.formobj.goodsUnitSid = '' |
||||
|
this.formobj.goodsUnitName = '' |
||||
|
} |
||||
|
}, |
||||
|
backData(value) { |
||||
|
console.log('backData》》》》', value) |
||||
|
console.log('imgList', this.imgList) |
||||
|
this.formobj.picPath = this.imgList |
||||
|
}, |
||||
|
saveOrUpdate() { |
||||
|
this.$refs['form_obj'].validate((valid) => { |
||||
|
if (valid) { |
||||
|
req.saveOrUpdate(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: '', |
||||
|
orgPath: '', |
||||
|
useOrgSid: '', |
||||
|
createOrgSid: '', |
||||
|
goodsName: '', |
||||
|
goodsCode: '', |
||||
|
goodsPY: '', |
||||
|
barCode: '', |
||||
|
goodsUnitSid: '', |
||||
|
goodsUnitName: '', |
||||
|
goodsTypeSid: '', |
||||
|
goodsTypeName: '', |
||||
|
indexes: '', |
||||
|
shelfLife: '', |
||||
|
brandSid: '', |
||||
|
brandName: '', |
||||
|
manufacturerSid: '', |
||||
|
manufacturerName: '', |
||||
|
sortNo: '', |
||||
|
skuRemarks: '', |
||||
|
inventoryAlertUpperLimit: '', |
||||
|
inventoryAlertLowerLimit: '', |
||||
|
goodsClassKey: '', // 商品类型key |
||||
|
goodsClassValue: '', // 商品类型 |
||||
|
goodsLevelKey: '', // 商品等级key |
||||
|
goodsLevelValue: '', // 商品等级 |
||||
|
picPath: [] |
||||
|
} |
||||
|
this.imgList = [] |
||||
|
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; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,203 @@ |
|||||
|
<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" :rules="rules" class="formaddcopy02"> |
||||
|
<el-row style="border-top: 1px solid #e0e3eb"> |
||||
|
<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.goodsPY }}</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-row> |
||||
|
<el-row> |
||||
|
<el-col :span="6"> |
||||
|
<div class="span-sty">商品等级</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.goodsLevelValue }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<div class="span-sty">商品类型</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.goodsClassValue }}</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.brandName }}</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.indexes }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<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.shelfLife }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<div class="span-sty">厂家</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.manufacturerName }}</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.skuRemarks }}</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.inventoryAlertUpperLimit }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<div class="span-sty">库存下限</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.inventoryAlertLowerLimit }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<div class="span-sty">排序</div> |
||||
|
<el-form-item><span class="addinputInfo">{{ formobj.sortNo }}</span></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<div class="span-sty">商品图片</div> |
||||
|
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px" v-for="(item, index) in formobj.picPath" :key="index" :src="item" :preview-src-list="formobj.picPath" /></el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import req from '@/api/commodity/commodity' |
||||
|
|
||||
|
export default { |
||||
|
name: 'CommodityInfo', |
||||
|
data() { |
||||
|
return { |
||||
|
formobj: { |
||||
|
sid: '', |
||||
|
userSid: '', |
||||
|
orgPath: '', |
||||
|
useOrgSid: '', |
||||
|
createOrgSid: '', |
||||
|
goodsName: '', |
||||
|
goodsCode: '', |
||||
|
goodsPY: '', |
||||
|
barCode: '', |
||||
|
goodsUnitSid: '', |
||||
|
goodsUnitName: '', |
||||
|
goodsTypeSid: '', |
||||
|
goodsTypeName: '', |
||||
|
indexes: '', |
||||
|
shelfLife: '', |
||||
|
brandSid: '', |
||||
|
brandName: '', |
||||
|
manufacturerSid: '', |
||||
|
manufacturerName: '', |
||||
|
sortNo: '', |
||||
|
skuRemarks: '', |
||||
|
inventoryAlertUpperLimit: '', |
||||
|
inventoryAlertLowerLimit: '', |
||||
|
goodsClassKey: '', // 商品类型key |
||||
|
goodsClassValue: '', // 商品类型 |
||||
|
goodsLevelKey: '', // 商品等级key |
||||
|
goodsLevelValue: '', // 商品等级 |
||||
|
picPath: [] |
||||
|
}, |
||||
|
rules: {} |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
showInfo(row) { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs['form_obj'].clearValidate() |
||||
|
}) |
||||
|
req.initGoods(row.sid).then(resp => { |
||||
|
if (resp.success) { |
||||
|
this.formobj = resp.data |
||||
|
if (this.formobj.picPath.length > 0) { |
||||
|
const aa = [] |
||||
|
this.formobj.picPath.forEach((e) => { |
||||
|
aa.push(e.url) |
||||
|
}) |
||||
|
this.formobj.asTechTitleApplyFileList = aa |
||||
|
} |
||||
|
} |
||||
|
}).catch(e => { |
||||
|
this.formobj = row |
||||
|
}) |
||||
|
}, |
||||
|
handleReturn() { |
||||
|
this.formobj = { |
||||
|
sid: '', |
||||
|
userSid: '', |
||||
|
orgPath: '', |
||||
|
useOrgSid: '', |
||||
|
createOrgSid: '', |
||||
|
goodsName: '', |
||||
|
goodsCode: '', |
||||
|
goodsPY: '', |
||||
|
barCode: '', |
||||
|
goodsUnitSid: '', |
||||
|
goodsUnitName: '', |
||||
|
goodsTypeSid: '', |
||||
|
goodsTypeName: '', |
||||
|
indexes: '', |
||||
|
shelfLife: '', |
||||
|
brandSid: '', |
||||
|
brandName: '', |
||||
|
manufacturerSid: '', |
||||
|
manufacturerName: '', |
||||
|
sortNo: '', |
||||
|
skuRemarks: '', |
||||
|
inventoryAlertUpperLimit: '', |
||||
|
inventoryAlertLowerLimit: '', |
||||
|
goodsClassKey: '', // 商品类型key |
||||
|
goodsClassValue: '', // 商品类型 |
||||
|
goodsLevelKey: '', // 商品等级key |
||||
|
goodsLevelValue: '', // 商品等级 |
||||
|
picPath: [] |
||||
|
} |
||||
|
this.$emit('doback') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.span-sty { |
||||
|
width: 130px !important; |
||||
|
} |
||||
|
.addinputInfo { |
||||
|
margin-left: 120px !important; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.anrui.terminal.api.as.storechange; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class AppStoreChangeDto implements Dto { |
||||
|
|
||||
|
@ApiModelProperty("库存sid") |
||||
|
private String sid; |
||||
|
@ApiModelProperty("移位数量") |
||||
|
private String count; |
||||
|
@ApiModelProperty("最大移位数量") |
||||
|
private String maxCount; |
||||
|
@ApiModelProperty("移位库位sid") |
||||
|
private String houseCode2; |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.yxt.anrui.terminal.api.as.storechange; |
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author |
||||
|
* @Date |
||||
|
* @Description |
||||
|
*/ |
||||
|
@FeignClient( |
||||
|
contextId = "terminal-AppStoreChange", |
||||
|
name = "anrui-terminal", |
||||
|
path = "v1/storeChange") |
||||
|
public interface AppStoreChangeFeign { |
||||
|
|
||||
|
@ApiOperation("标签扫描") |
||||
|
@GetMapping("/scan") |
||||
|
@ResponseBody |
||||
|
public ResultBean<AppStoreChangeScanVo> scan(@RequestParam("content") String content, @RequestParam("type") String type, @RequestParam("orgPath") String orgPath, @RequestParam(value = "storeSid", required = false) String storeSid); |
||||
|
|
||||
|
@ApiOperation("保存") |
||||
|
@PostMapping("/save") |
||||
|
@ResponseBody |
||||
|
public ResultBean save(@RequestBody List<AppStoreChangeDto> dto); |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.yxt.anrui.terminal.api.as.storechange; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class AppStoreChangeScanVo implements Vo { |
||||
|
|
||||
|
@ApiModelProperty("0商品码,1库位码") |
||||
|
private String type; |
||||
|
@ApiModelProperty("商品sid") |
||||
|
private String sid; |
||||
|
@ApiModelProperty("商品下的库存表里的sid集合") |
||||
|
private List<String> storeSids; |
||||
|
@ApiModelProperty("库位码") |
||||
|
private String houseCode; |
||||
|
@ApiModelProperty("库区名+库位名") |
||||
|
private String houseName; |
||||
|
@ApiModelProperty("仓库地址") |
||||
|
private String houseAddress; |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.terminal.biz.as.storechange; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.as.storechange.AppStoreChangeDto; |
||||
|
import com.yxt.anrui.terminal.api.as.storechange.AppStoreChangeFeign; |
||||
|
import com.yxt.anrui.terminal.api.as.storechange.AppStoreChangeScanVo; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("v1/storeChange") |
||||
|
public class AppStoreChangeRest implements AppStoreChangeFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private AppStoreChangeService appStoreChangeService; |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<AppStoreChangeScanVo> scan(String content, String type, String orgPath, String storeSid) { |
||||
|
return appStoreChangeService.scan(content, type, orgPath, storeSid); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean save(List<AppStoreChangeDto> dto) { |
||||
|
return appStoreChangeService.save(dto); |
||||
|
} |
||||
|
} |
@ -0,0 +1,191 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.terminal.biz.as.storechange; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
||||
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
||||
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
||||
|
import com.yxt.anrui.terminal.api.as.firstshelves.*; |
||||
|
import com.yxt.anrui.terminal.api.as.storechange.AppStoreChangeDto; |
||||
|
import com.yxt.anrui.terminal.api.as.storechange.AppStoreChangeScanVo; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsInventory.WmsInventory; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsInventory.WmsInventoryFeign; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsInventory.WmsInventorySaveDto; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsInventory.WmsStoreChangeDto; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsgoodstag.GoodsTagListQuery; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsgoodstag.WmsGoodsTag; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsgoodstag.WmsGoodsTagFeign; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsinitialdetail.WmsInitialDetail; |
||||
|
import com.yxt.anrui.terminal.fegin.wmsinitialdetail.WmsInitialDetailFeign; |
||||
|
import com.yxt.anrui.terminal.fegin.wmswarehouserack.WmsHouseInfoVo; |
||||
|
import com.yxt.anrui.terminal.fegin.wmswarehouserack.WmsWarehouseRackFeign; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
@Service |
||||
|
public class AppStoreChangeService { |
||||
|
|
||||
|
@Resource |
||||
|
private WmsGoodsTagFeign wmsGoodsTagFeign; |
||||
|
@Resource |
||||
|
private WmsWarehouseRackFeign wmsWarehouseRackFeign; |
||||
|
@Resource |
||||
|
private WmsInventoryFeign wmsInventoryFeign; |
||||
|
@Resource |
||||
|
private WmsInitialDetailFeign wmsInitialDetailFeign; |
||||
|
@Autowired |
||||
|
private SysStaffOrgFeign sysStaffOrgFeign; |
||||
|
@Autowired |
||||
|
private SysOrganizationFeign sysOrganizationFeign; |
||||
|
|
||||
|
public ResultBean<AppFirstShelvesVo> list(PagerQuery<AppFirstShelvesQuery> pagerQuery) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerQuery<GoodsTagListQuery> pagerQuery1 = new PagerQuery<>(); |
||||
|
GoodsTagListQuery params = new GoodsTagListQuery(); |
||||
|
AppFirstShelvesQuery params1 = pagerQuery.getParams(); |
||||
|
params.setUserSid(params1.getUserSid()); |
||||
|
params.setOrgPath(params1.getOrgPath()); |
||||
|
params.setMenuSid(params1.getMenuSid()); |
||||
|
params.setName(params1.getName()); |
||||
|
pagerQuery1.setParams(params); |
||||
|
pagerQuery1.setSize(1000); |
||||
|
PagerVo<WmsGoodsTag> data = wmsGoodsTagFeign.goodsTagList(pagerQuery1).getData(); |
||||
|
AppFirstShelvesVo appFirstShelvesVo = new AppFirstShelvesVo(); |
||||
|
List<AppFirstShelvesGoodsVo> goods = new ArrayList<>(); |
||||
|
List<WmsGoodsTag> list = data.getRecords(); |
||||
|
for (WmsGoodsTag wmsGoodsTag : list) { |
||||
|
AppFirstShelvesGoodsVo appFirstShelvesGoodsVo = new AppFirstShelvesGoodsVo(); |
||||
|
appFirstShelvesGoodsVo.setSid(wmsGoodsTag.getSid()); |
||||
|
appFirstShelvesGoodsVo.setName(wmsGoodsTag.getGoodsSkuTitle()); |
||||
|
appFirstShelvesGoodsVo.set_id(wmsGoodsTag.getGoodsID()); |
||||
|
appFirstShelvesGoodsVo.setNum(wmsGoodsTag.getGoodsCount()); |
||||
|
appFirstShelvesGoodsVo.setUnit(wmsGoodsTag.getUnit()); |
||||
|
appFirstShelvesGoodsVo.setSpecs(wmsGoodsTag.getGoodsSkuOwnSpec()); |
||||
|
goods.add(appFirstShelvesGoodsVo); |
||||
|
} |
||||
|
appFirstShelvesVo.setGoods(goods); |
||||
|
return rb.success().setData(appFirstShelvesVo); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<AppStoreChangeScanVo> scan(String content, String type, String orgPath, String storeSid) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
String deptSid = ""; |
||||
|
if (StringUtils.isNotBlank(orgPath)) { |
||||
|
List<String> split = Arrays.asList(orgPath.split("/")); |
||||
|
if (split.size() > 1) { |
||||
|
//获取本级sid获取本级部门信息
|
||||
|
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
||||
|
deptSid = sysOrganization1.getSid(); |
||||
|
} else { |
||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
||||
|
deptSid = sysOrganization.getSid(); |
||||
|
} |
||||
|
} |
||||
|
AppStoreChangeScanVo appStoreChangeScanVo = new AppStoreChangeScanVo(); |
||||
|
if ("0".equals(type)) {//商品码
|
||||
|
if (content.contains("#")) { |
||||
|
return rb.setMsg("请扫描商品码"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(storeSid)) { |
||||
|
List<WmsInventory> wmsInventoryList = wmsInventoryFeign.selByGoodsIDAndUseOrgSid(content, deptSid).getData(); |
||||
|
if (wmsInventoryList == null) { |
||||
|
return rb.setMsg("当前商品不可移位"); |
||||
|
} |
||||
|
appStoreChangeScanVo.setType(type); |
||||
|
appStoreChangeScanVo.setSid(wmsInventoryList.get(0).getGoodsSpuSid()); |
||||
|
appStoreChangeScanVo.setStoreSids(wmsInventoryList.stream().map(WmsInventory::getSid).collect(Collectors.toList())); |
||||
|
} else { |
||||
|
List<WmsInventory> wmsInventoryList = wmsInventoryFeign.selByGoodsIDAndUseOrgSidAndWarehouseSid(content, deptSid, storeSid).getData(); |
||||
|
if (wmsInventoryList == null) { |
||||
|
return rb.setMsg("当前商品不可移位"); |
||||
|
} |
||||
|
appStoreChangeScanVo.setType(type); |
||||
|
appStoreChangeScanVo.setSid(wmsInventoryList.get(0).getGoodsSpuSid()); |
||||
|
appStoreChangeScanVo.setStoreSids(wmsInventoryList.stream().map(WmsInventory::getSid).collect(Collectors.toList())); |
||||
|
} |
||||
|
} else if ("1".equals(type)) {//库位码
|
||||
|
if (!content.contains("#")) { |
||||
|
return rb.setMsg("请扫描库位码"); |
||||
|
} |
||||
|
String[] split = content.split("#"); |
||||
|
String houseCode = split[0]; |
||||
|
ResultBean<WmsHouseInfoVo> wmsHouseInfoVoResultBean = wmsWarehouseRackFeign.selHouseInfoByFullCode(houseCode); |
||||
|
if (wmsHouseInfoVoResultBean.getSuccess()) { |
||||
|
WmsHouseInfoVo houseInfoVo = wmsHouseInfoVoResultBean.getData(); |
||||
|
if (null != houseInfoVo) { |
||||
|
String houseName = ""; |
||||
|
String areaName = ""; |
||||
|
String rackName = ""; |
||||
|
String zoneName = ""; |
||||
|
if (StringUtils.isNotBlank(houseInfoVo.getWarehouseName())) { |
||||
|
houseName = houseInfoVo.getWarehouseName(); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(houseInfoVo.getWareAreaName())) { |
||||
|
areaName = houseInfoVo.getWareAreaName(); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(houseInfoVo.getWarehouseRackName())) { |
||||
|
rackName = houseInfoVo.getWarehouseRackName(); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(houseInfoVo.getWarehouseZoneName())) { |
||||
|
zoneName = houseInfoVo.getWarehouseZoneName(); |
||||
|
} |
||||
|
appStoreChangeScanVo.setHouseName(houseName + "-" + zoneName + "-" + areaName); |
||||
|
appStoreChangeScanVo.setHouseAddress(houseInfoVo.getWarehouseRackCode()); |
||||
|
appStoreChangeScanVo.setHouseCode(houseCode); |
||||
|
appStoreChangeScanVo.setType(type); |
||||
|
} else { |
||||
|
return rb.setMsg("扫描库位码为空"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return rb.success().setData(appStoreChangeScanVo); |
||||
|
} |
||||
|
|
||||
|
public ResultBean save(List<AppStoreChangeDto> dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<WmsStoreChangeDto> wmsStoreChangeDtos = new ArrayList<>(); |
||||
|
for (AppStoreChangeDto appStoreChangeDto : dto) { |
||||
|
WmsStoreChangeDto wmsStoreChangeDto = new WmsStoreChangeDto(); |
||||
|
BeanUtil.copyProperties(appStoreChangeDto,wmsStoreChangeDto); |
||||
|
wmsStoreChangeDtos.add(wmsStoreChangeDto); |
||||
|
} |
||||
|
wmsInventoryFeign.saveKnyw(wmsStoreChangeDtos); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
package com.yxt.anrui.terminal.fegin.wmsInventory; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
@Data |
||||
|
public class WmsInventory extends BaseEntity { |
||||
|
|
||||
|
@ApiModelProperty("批次号") |
||||
|
private String batchNumber; |
||||
|
@ApiModelProperty("商品ID(唯一编码,入库时生成,生成规则为商品编码+YYMMdd+4位流水)") |
||||
|
private String goodsID; |
||||
|
@ApiModelProperty("商品基础信息sid") |
||||
|
private String goodsSpuSid; |
||||
|
@ApiModelProperty("商品名称") |
||||
|
private String goodsSpuName; |
||||
|
@ApiModelProperty("商品Skusid") |
||||
|
private String goodsSkuSid; |
||||
|
@ApiModelProperty("商品Sku名称") |
||||
|
private String goodsSkuTitle; |
||||
|
@ApiModelProperty("商品编码(图号)") |
||||
|
private String goodsSkuCode; |
||||
|
@ApiModelProperty("规格型号") |
||||
|
private String goodsSkuOwnSpec; |
||||
|
@ApiModelProperty("计量单位") |
||||
|
private String unit; |
||||
|
@ApiModelProperty("现有量") |
||||
|
private BigDecimal count; |
||||
|
@ApiModelProperty("分配量(锁定数量,出库申请通过,但未实际出库)") |
||||
|
private BigDecimal allocateCount; |
||||
|
@ApiModelProperty("拣货量") |
||||
|
private BigDecimal pickCount; |
||||
|
@ApiModelProperty("冻结量") |
||||
|
private BigDecimal freezeCount; |
||||
|
@ApiModelProperty("入库单价") |
||||
|
private BigDecimal cost; |
||||
|
@ApiModelProperty("税率") |
||||
|
private BigDecimal taxRate; |
||||
|
@ApiModelProperty("仓库sid") |
||||
|
private String warehouseSid; |
||||
|
@ApiModelProperty("仓库名称") |
||||
|
private String warehouseName; |
||||
|
@ApiModelProperty("库位sid") |
||||
|
private String warehouseRackSid; |
||||
|
@ApiModelProperty("库位编码") |
||||
|
private String warehouseRackCode; |
||||
|
@ApiModelProperty("首次入库日期-计算库龄的依据") |
||||
|
private Date firstInDate; |
||||
|
@ApiModelProperty("创建组织sid") |
||||
|
private String createOrgSid; |
||||
|
@ApiModelProperty("使用组织sid") |
||||
|
private String useOrgSid; |
||||
|
@ApiModelProperty("厂家订单号") |
||||
|
private String manufactorBillNo; |
||||
|
@ApiModelProperty("厂家sid") |
||||
|
private String manufacturerSid; // 库位sid
|
||||
|
@ApiModelProperty("厂家名称") |
||||
|
private String manufacturerName; // 库位编号
|
||||
|
@ApiModelProperty("客户/供应商sid,出库是为客户,入库时为供应商") |
||||
|
private String supplierSid; |
||||
|
@ApiModelProperty("客户/供应商名称") |
||||
|
private String supplierName; |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.anrui.terminal.fegin.wmsInventory; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class WmsStoreChangeDto implements Dto { |
||||
|
|
||||
|
@ApiModelProperty("库存sid") |
||||
|
private String sid; |
||||
|
@ApiModelProperty("移位数量") |
||||
|
private String count; |
||||
|
@ApiModelProperty("最大移位数量") |
||||
|
private String maxCount; |
||||
|
@ApiModelProperty("移位库位sid") |
||||
|
private String houseCode2; |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.yxt.base.biz.base.basegoodsspu; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/1/16 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class YxtBaseFormCommon { |
||||
|
|
||||
|
private String id; |
||||
|
private String dictValue; |
||||
|
|
||||
|
private Map<String, Object> extra; |
||||
|
|
||||
|
// 静态方法,直接通过方法创建对象并赋值
|
||||
|
public static YxtBaseFormCommon of(String id, String dictValue) { |
||||
|
YxtBaseFormCommon formCommon = new YxtBaseFormCommon(); |
||||
|
formCommon.setId(id); |
||||
|
formCommon.setDictValue(dictValue); |
||||
|
return formCommon; |
||||
|
} |
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
package com.yxt.anrui.oa.api; |
||||
|
|
||||
|
import com.yxt.anrui.oa.biz.adallocateassetapply.AdAllocateAssetApplyDetailVo; |
||||
|
import com.yxt.anrui.oa.biz.adallocateassetapply.AdAllocateAssetApplyDto; |
||||
|
import com.yxt.anrui.oa.biz.adallocateassetapply.AdAllocateAssetApplyService; |
||||
|
import com.yxt.anrui.oa.biz.adallocateassetapply.AdAllocateAssetApplyVo; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.CompleteDto; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.NodeQuery; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.TaskDto; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.cloud.openfeign.SpringQueryMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("v1/AdAllocateAssetApply") |
||||
|
public class AdAllocateAssetApplyRest { |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private AdAllocateAssetApplyService adAllocateAssetApplyService; |
||||
|
|
||||
|
@ApiOperation("初始化(新增或修改)") |
||||
|
@GetMapping({"/getInit", "/getInit/{sid}"}) |
||||
|
public ResultBean<AdAllocateAssetApplyVo> getInit( |
||||
|
@PathVariable(value = "sid", required = false) String sid, |
||||
|
@RequestParam(value = "userSid", required = false) String userSid, |
||||
|
@RequestParam(value = "orgPath", required = false) String orgPath) { |
||||
|
ResultBean<AdAllocateAssetApplyVo> rb = ResultBean.fireFail(); |
||||
|
if (sid == null || sid.isEmpty()) { |
||||
|
// 执行新增初始化
|
||||
|
if (userSid == null || orgPath == null) { |
||||
|
return rb.setMsg("userSid和orgPath不能为空"); |
||||
|
} |
||||
|
return adAllocateAssetApplyService.getSaveInit(userSid, orgPath); |
||||
|
} else { |
||||
|
// 执行修改初始化
|
||||
|
return adAllocateAssetApplyService.getUpdateInit(sid); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("新增或修改") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean save(@RequestBody AdAllocateAssetApplyDto dto) { |
||||
|
return adAllocateAssetApplyService.saveOrUpdateDto(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("根据sid批量删除") |
||||
|
@DeleteMapping("/delBySids") |
||||
|
public ResultBean delBySids(@RequestBody String[] sids) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
adAllocateAssetApplyService.delAll(sids); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("详情") |
||||
|
@GetMapping("/details/{sid}") |
||||
|
ResultBean<AdAllocateAssetApplyDetailVo> details(@PathVariable("sid") String sid |
||||
|
, @RequestParam(value = "application", required = false) String application) { |
||||
|
return adAllocateAssetApplyService.details(sid,application); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("提交审批流程") |
||||
|
@PostMapping("/submit") |
||||
|
public ResultBean submit(@RequestBody @Valid AdAllocateAssetApplyDto dto) { |
||||
|
return adAllocateAssetApplyService.submit(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "办理(同意)") |
||||
|
@PutMapping("/complete") |
||||
|
public ResultBean complete(@Valid @RequestBody CompleteDto dto) { |
||||
|
return adAllocateAssetApplyService.complete(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "驳回任务") |
||||
|
@PutMapping(value = "/reject") |
||||
|
public ResultBean reject(@Valid @RequestBody TaskDto dto) { |
||||
|
return adAllocateAssetApplyService.reject(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("获取流程操作标题") |
||||
|
@GetMapping("/getFlowOperateTitle") |
||||
|
@ResponseBody |
||||
|
ResultBean<String> getFlowOperateTitle(@SpringQueryMap NodeQuery query) { |
||||
|
return adAllocateAssetApplyService.getFlowOperateTitle(query); |
||||
|
} |
||||
|
|
||||
|
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue