Compare commits
10 Commits
b8758fb3f2
...
66d3ffd0d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66d3ffd0d0 | ||
|
|
547660462b | ||
|
|
0d49485cf9 | ||
|
|
928178bc1f | ||
|
|
e4c6207fa7 | ||
|
|
5768ca646e | ||
|
|
6be053a5c1 | ||
|
|
43d50cdaf0 | ||
|
|
9990a3c4f3 | ||
|
|
1065be3c47 |
@@ -580,7 +580,7 @@ INSERT INTO `jsh_msg` VALUES (2, '标题1', '内容1', '2019-09-10 00:11:39', '
|
||||
DROP TABLE IF EXISTS `jsh_orga_user_rel`;
|
||||
CREATE TABLE `jsh_orga_user_rel` (
|
||||
`id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`orga_id` bigint(0) NOT NULL COMMENT '机构id',
|
||||
`orga_id` bigint(0) NULL DEFAULT NULL COMMENT '机构id',
|
||||
`user_id` bigint(0) NOT NULL COMMENT '用户id',
|
||||
`user_blng_orga_dspl_seq` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户在所属机构中显示顺序',
|
||||
`delete_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
|
||||
|
||||
@@ -190,8 +190,8 @@ select '060301', '销售订单', '0603', '../materials/sale_orders_list.html', b
|
||||
-- ----------------------------
|
||||
-- 改管理员的功能权限
|
||||
-- ----------------------------
|
||||
update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4',
|
||||
Value = '[13][12][16][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][242][33][199][243][41][200][201][202][40][232][233][197][203][204][205][206][212]'
|
||||
update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4',
|
||||
Value = '[13][12][16][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][242][33][199][243][41][200][201][202][40][232][233][197][203][204][205][206][212]'
|
||||
where Id = 5;
|
||||
|
||||
-- ----------------------------
|
||||
@@ -1744,4 +1744,11 @@ create index material_id on jsh_serial_number(material_id) using btree;
|
||||
create index depot_id on jsh_serial_number(depot_id) using btree;
|
||||
create index type on jsh_user_business(type) using btree;
|
||||
create index key_id on jsh_user_business(key_id) using btree;
|
||||
create index tenant_id on jsh_user_business(tenant_id) using btree;
|
||||
create index tenant_id on jsh_user_business(tenant_id) using btree;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
-- 时间 2026年1月31日
|
||||
-- by jishenghua
|
||||
-- 给jsh_user表的orga_id字段改为非必填
|
||||
-- --------------------------------------------------------
|
||||
alter table jsh_orga_user_rel change orga_id orga_id bigint(0) NULL DEFAULT NULL COMMENT '机构id';
|
||||
|
||||
@@ -215,6 +215,7 @@ public class DepotItemController {
|
||||
BigDecimal totalAllPrice = BigDecimal.ZERO;
|
||||
BigDecimal totalTaxMoney = BigDecimal.ZERO;
|
||||
BigDecimal totalTaxLastMoney = BigDecimal.ZERO;
|
||||
BigDecimal totalFinishNumber = BigDecimal.ZERO;
|
||||
BigDecimal totalWeight = BigDecimal.ZERO;
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
@@ -252,7 +253,8 @@ public class DepotItemController {
|
||||
item.put("operNumber", diEx.getOperNumber());
|
||||
item.put("basicNumber", diEx.getBasicNumber());
|
||||
item.put("preNumber", diEx.getOperNumber()); //原数量
|
||||
item.put("finishNumber", depotItemService.getFinishNumber(diEx.getMaterialExtendId(), diEx.getId(), diEx.getHeaderId(), unitInfo, materialUnit, linkType)); //已入库|已出库
|
||||
BigDecimal finishNumber = depotItemService.getFinishNumber(diEx.getMaterialExtendId(), diEx.getId(), diEx.getHeaderId(), unitInfo, materialUnit, linkType);
|
||||
item.put("finishNumber", finishNumber); //已入库|已出库
|
||||
item.put("purchaseDecimal", roleService.parseBillPriceByLimit(diEx.getPurchaseDecimal(), billCategory, priceLimit, request)); //采购价
|
||||
if("basic".equals(linkType) || "1".equals(isReadOnly)) {
|
||||
//正常情况显示金额,而以销定购的情况不能显示金额
|
||||
@@ -288,6 +290,7 @@ public class DepotItemController {
|
||||
totalAllPrice = totalAllPrice.add(diEx.getAllPrice()==null?BigDecimal.ZERO:diEx.getAllPrice());
|
||||
totalTaxMoney = totalTaxMoney.add(diEx.getTaxMoney()==null?BigDecimal.ZERO:diEx.getTaxMoney());
|
||||
totalTaxLastMoney = totalTaxLastMoney.add(diEx.getTaxLastMoney()==null?BigDecimal.ZERO:diEx.getTaxLastMoney());
|
||||
totalFinishNumber = totalFinishNumber.add(finishNumber);
|
||||
totalWeight = totalWeight.add(allWeight);
|
||||
}
|
||||
if(StringUtil.isNotEmpty(isReadOnly) && "1".equals(isReadOnly)) {
|
||||
@@ -296,6 +299,7 @@ public class DepotItemController {
|
||||
footItem.put("allPrice", roleService.parseBillPriceByLimit(totalAllPrice, billCategory, priceLimit, request));
|
||||
footItem.put("taxMoney", roleService.parseBillPriceByLimit(totalTaxMoney, billCategory, priceLimit, request));
|
||||
footItem.put("taxLastMoney", roleService.parseBillPriceByLimit(totalTaxLastMoney, billCategory, priceLimit, request));
|
||||
footItem.put("finishNumber", totalFinishNumber);
|
||||
footItem.put("weight", totalWeight);
|
||||
dataArray.add(footItem);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ public class FunctionController extends BaseController {
|
||||
if("admin".equals(userInfo.getLoginName())) {
|
||||
funIdList = null;
|
||||
}
|
||||
List<Function> dataListFun = functionService.findRoleFunction("0", funIdList);
|
||||
List<Function> dataListFun = functionService.findRoleFunction("0", null);
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 0);
|
||||
@@ -255,15 +255,20 @@ public class FunctionController extends BaseController {
|
||||
//根据条件从列表里面移除"系统管理"
|
||||
List<Function> dataList = new ArrayList<>();
|
||||
for (Function fun : dataListFun) {
|
||||
List<Function> childrenList = functionService.getRoleFunction(fun.getNumber());
|
||||
String token = request.getHeader("X-Access-Token");
|
||||
Long tenantId = Tools.getTenantIdByToken(token);
|
||||
if (tenantId!=0L) {
|
||||
if(!("系统管理").equals(fun.getName())) {
|
||||
dataList.add(fun);
|
||||
if(!childrenList.isEmpty()) {
|
||||
dataList.add(fun);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//超管
|
||||
dataList.add(fun);
|
||||
if(!childrenList.isEmpty()) {
|
||||
dataList.add(fun);
|
||||
}
|
||||
}
|
||||
}
|
||||
dataArray = getFunctionList(dataList, type, keyId, funIdList);
|
||||
|
||||
@@ -233,8 +233,7 @@ public class UserController extends BaseController {
|
||||
HttpServletRequest request) throws Exception {
|
||||
Map<String, Object> objectMap = new HashMap<>();
|
||||
Long id = jsonObject.getLong("id");
|
||||
String password = "123456";
|
||||
String md5Pwd = Tools.md5Encryp(password);
|
||||
String md5Pwd = jsonObject.getString("password");
|
||||
int update = userService.resetPwd(md5Pwd, id, request);
|
||||
if(update > 0) {
|
||||
return returnJson(objectMap, SUCCESS, ErpInfo.OK.code);
|
||||
|
||||
@@ -553,10 +553,6 @@ public class UserService {
|
||||
ubObj.put("value", "[" + ue.getRoleId() + "]");
|
||||
userBusinessService.insertUserBusiness(ubObj, request);
|
||||
}
|
||||
if(ue.getOrgaId()==null){
|
||||
//如果没有选择机构,就不建机构和用户的关联关系
|
||||
return;
|
||||
}
|
||||
if(ue.getOrgaId()!=null && "1".equals(ue.getLeaderFlag())){
|
||||
//检查当前机构是否存在经理
|
||||
List<User> checkList = userMapperEx.getListByOrgaId(ue.getId(), ue.getOrgaId());
|
||||
@@ -585,12 +581,10 @@ public class UserService {
|
||||
public UserEx addUser(UserEx ue) throws Exception{
|
||||
/**
|
||||
* 新增用户默认设置
|
||||
* 1、密码默认123456
|
||||
* 2是否系统自带默认为非系统自带
|
||||
* 3是否管理者默认为员工
|
||||
* 4默认用户状态为正常
|
||||
* 1是否系统自带默认为非系统自带
|
||||
* 2是否管理者默认为员工
|
||||
* 3默认用户状态为正常
|
||||
* */
|
||||
ue.setPassword(Tools.md5Encryp(BusinessConstants.USER_DEFAULT_PASSWORD));
|
||||
ue.setIsystem(BusinessConstants.USER_NOT_SYSTEM);
|
||||
if(ue.getIsmanager()==null){
|
||||
ue.setIsmanager(BusinessConstants.USER_NOT_MANAGER);
|
||||
@@ -707,10 +701,6 @@ public class UserService {
|
||||
userBusinessService.insertUserBusiness(ubObj, request);
|
||||
}
|
||||
}
|
||||
if (ue.getOrgaId() == null) {
|
||||
//如果没有选择机构,就不建机构和用户的关联关系
|
||||
return;
|
||||
}
|
||||
if(ue.getOrgaId()!=null && "1".equals(ue.getLeaderFlag())){
|
||||
//检查当前机构是否存在经理
|
||||
List<User> checkList = userMapperEx.getListByOrgaId(ue.getId(), ue.getOrgaId());
|
||||
|
||||
@@ -276,7 +276,12 @@
|
||||
order by oper_time desc,number desc
|
||||
</if>
|
||||
<if test="column != 'createTime'">
|
||||
order by ${column} ${order}
|
||||
<if test="column == 'barCode' or column == 'operNumber' or column == 'unitPrice' or column == 'allPrice' or column == 'taxMoney'">
|
||||
order by ${column}
|
||||
<if test="order == 'asc' or order == 'desc'">
|
||||
${order}
|
||||
</if>
|
||||
</if>
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
@@ -495,7 +500,12 @@
|
||||
order by materialId desc
|
||||
</if>
|
||||
<if test="column != 'createTime'">
|
||||
order by ${column} ${order}
|
||||
<if test="column == 'barCode' or column == 'numSum' or column == 'priceSum'">
|
||||
order by ${column}
|
||||
<if test="order == 'asc' or order == 'desc'">
|
||||
${order}
|
||||
</if>
|
||||
</if>
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
@@ -701,7 +711,12 @@
|
||||
order by oper_time desc,number desc
|
||||
</if>
|
||||
<if test="column != 'createTime'">
|
||||
order by ${column} ${order}
|
||||
<if test="column == 'barCode' or column == 'operNumber' or column == 'unitPrice' or column == 'allPrice'">
|
||||
order by ${column}
|
||||
<if test="order == 'asc' or order == 'desc'">
|
||||
${order}
|
||||
</if>
|
||||
</if>
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
@@ -1425,4 +1440,4 @@
|
||||
and dh.pay_type = '预付款'
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -698,7 +698,12 @@
|
||||
order by m.id desc
|
||||
</if>
|
||||
<if test="column != 'createTime'">
|
||||
order by ${column} ${order}
|
||||
<if test="column == 'mBarCode' or column == 'purchaseDecimal' or column == 'currentStock' or column == 'currentStockPrice' or column == 'currentWeight'">
|
||||
order by ${column}
|
||||
<if test="order == 'asc' or order == 'desc'">
|
||||
${order}
|
||||
</if>
|
||||
</if>
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
<update id="updateOrgaUserRel" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel" >
|
||||
update jsh_orga_user_rel
|
||||
<set >
|
||||
<if test="orgaId != null" >
|
||||
orga_id = #{orgaId},
|
||||
</if>
|
||||
orga_id = #{orgaId},
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
@@ -41,4 +39,4 @@
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -20,6 +20,7 @@ const editUser = (params)=>putAction("/user/updateUser",params);
|
||||
const getUserList = (params)=>getAction("/user/getUserList",params);
|
||||
const getUserBtnByCurrentUser = (params)=>getAction("/user/getUserBtnByCurrentUser",params);
|
||||
const queryPermissionsByUser = (params)=>postAction("/function/findMenuByPNumber",params);
|
||||
const resetPwd = (params)=>postAction("/user/resetPwd",params);
|
||||
//机构管理
|
||||
const queryOrganizationTreeList = (params)=>getAction("/organization/getOrganizationTree",params);
|
||||
const getAllOrganizationTreeByUser = (params)=>getAction("/organization/getAllOrganizationTreeByUser",params);
|
||||
@@ -131,6 +132,7 @@ export {
|
||||
getUserList,
|
||||
getUserBtnByCurrentUser,
|
||||
queryPermissionsByUser,
|
||||
resetPwd,
|
||||
queryOrganizationTreeList,
|
||||
getAllOrganizationTreeByUser,
|
||||
queryOrganizationById,
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
}
|
||||
let reg = /^(?=.*[a-z])(?=.*\d).{6,}$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error('密码由6位数字、小写字母组成!'))
|
||||
callback(new Error('用户密码至少要有数字和小写字母,并且长度至少6位!'))
|
||||
}
|
||||
callback()
|
||||
},
|
||||
|
||||
@@ -75,6 +75,15 @@
|
||||
<a-input placeholder="请输入关联订单" v-model="queryParam.linkNumber"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="结算账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select placeholder="请选择结算账户" showSearch allow-clear optionFilterProp="children" v-model="queryParam.accountId">
|
||||
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select placeholder="请选择单据状态" allow-clear v-model="queryParam.status">
|
||||
@@ -235,6 +244,7 @@
|
||||
depotId: undefined,
|
||||
linkApply: "",
|
||||
linkNumber: "",
|
||||
accountId: undefined,
|
||||
creator: undefined,
|
||||
status: undefined,
|
||||
remark: ""
|
||||
@@ -310,6 +320,7 @@
|
||||
this.initSystemConfig()
|
||||
this.initSupplier()
|
||||
this.initUser()
|
||||
this.initAccount()
|
||||
this.initQuickBtn()
|
||||
this.getDepotByCurrentUser()
|
||||
},
|
||||
|
||||
@@ -66,6 +66,15 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="结算账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select placeholder="请选择结算账户" showSearch allow-clear optionFilterProp="children" v-model="queryParam.accountId">
|
||||
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-form-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select placeholder="请选择单据状态" allow-clear v-model="queryParam.status">
|
||||
@@ -240,6 +249,7 @@
|
||||
subType: "销售订单",
|
||||
organId: undefined,
|
||||
depotId: undefined,
|
||||
accountId: undefined,
|
||||
creator: undefined,
|
||||
status: undefined,
|
||||
salesMan: undefined,
|
||||
@@ -316,6 +326,7 @@
|
||||
this.initCustomer()
|
||||
this.initSalesman()
|
||||
this.initUser()
|
||||
this.initAccount()
|
||||
this.getSystemConfig()
|
||||
this.initQuickBtn()
|
||||
this.getDepotByCurrentUser()
|
||||
|
||||
@@ -980,90 +980,85 @@
|
||||
},
|
||||
autoSkuList(skuOneData, skuTwoData, skuThreeData) {
|
||||
let unit = this.form.getFieldValue('unit')
|
||||
if(unit) {
|
||||
//计算多属性已经选择了几个
|
||||
let skuArr = []
|
||||
if(this.getNumByField('skuOne')) {
|
||||
skuArr.push(skuOneData)
|
||||
}
|
||||
if(this.getNumByField('skuTwo')) {
|
||||
skuArr.push(skuTwoData)
|
||||
}
|
||||
if(this.getNumByField('skuThree')) {
|
||||
skuArr.push(skuThreeData)
|
||||
}
|
||||
let skuArrOne = skuArr[0]
|
||||
let skuArrTwo = skuArr[1]
|
||||
let skuArrThree = skuArr[2]
|
||||
let count = this.getNumByField('skuOne') + this.getNumByField('skuTwo') + this.getNumByField('skuThree')
|
||||
let barCodeSku = []
|
||||
if(count === 1) {
|
||||
let skuArrOnly = []
|
||||
if(this.getNumByField('skuOne')) {
|
||||
skuArrOnly = skuOneData
|
||||
} else if(this.getNumByField('skuTwo')) {
|
||||
skuArrOnly = skuTwoData
|
||||
} else if(this.getNumByField('skuThree')) {
|
||||
skuArrOnly = skuThreeData
|
||||
}
|
||||
for (let i = 0; i < skuArrOnly.length; i++) {
|
||||
barCodeSku.push(skuArrOnly[i])
|
||||
}
|
||||
} else if(count === 2) {
|
||||
for (let i = 0; i < skuArrOne.length; i++) {
|
||||
for (let j = 0; j < skuArrTwo.length; j++) {
|
||||
barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j])
|
||||
}
|
||||
}
|
||||
} else if(count === 3) {
|
||||
for (let i = 0; i < skuArrOne.length; i++) {
|
||||
for (let j = 0; j < skuArrTwo.length; j++) {
|
||||
for (let k = 0; k < skuArrThree.length; k++) {
|
||||
barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j] + '/' + skuArrThree[k])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let meTableData = []
|
||||
getMaxBarCode({}).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
let k = 0
|
||||
let maxBarCode = res.data.barCode
|
||||
for (let i = 0; i < barCodeSku.length; i++) {
|
||||
let currentBarCode = ''
|
||||
let currentId = ''
|
||||
let purchaseDecimal = ''
|
||||
let commodityDecimal = ''
|
||||
let wholesaleDecimal = ''
|
||||
let lowDecimal = ''
|
||||
for (let j = 0; j < this.meOldDataSource.length; j++) {
|
||||
if(barCodeSku[i] === this.meOldDataSource[j].sku) {
|
||||
currentBarCode = this.meOldDataSource[j].barCode
|
||||
currentId = this.meOldDataSource[j].id
|
||||
purchaseDecimal = this.meOldDataSource[j].purchaseDecimal
|
||||
commodityDecimal = this.meOldDataSource[j].commodityDecimal
|
||||
wholesaleDecimal = this.meOldDataSource[j].wholesaleDecimal
|
||||
lowDecimal = this.meOldDataSource[j].lowDecimal
|
||||
}
|
||||
}
|
||||
if(currentBarCode) {
|
||||
//此时说明该sku之前就存在
|
||||
meTableData.push({id: currentId, barCode: currentBarCode, commodityUnit: unit, sku: barCodeSku[i],
|
||||
purchaseDecimal: purchaseDecimal, commodityDecimal: commodityDecimal,
|
||||
wholesaleDecimal: wholesaleDecimal, lowDecimal: lowDecimal})
|
||||
} else {
|
||||
k = k+1
|
||||
currentBarCode = addBigNumbers(maxBarCode, k)
|
||||
meTableData.push({barCode: currentBarCode, commodityUnit: unit, sku: barCodeSku[i]})
|
||||
}
|
||||
}
|
||||
this.meTable.dataSource = meTableData
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请填写单位(注意不要勾选多单位,因为多属性商品不支持多单位)');
|
||||
this.barCodeSwitch = false;
|
||||
//计算多属性已经选择了几个
|
||||
let skuArr = []
|
||||
if(this.getNumByField('skuOne')) {
|
||||
skuArr.push(skuOneData)
|
||||
}
|
||||
if(this.getNumByField('skuTwo')) {
|
||||
skuArr.push(skuTwoData)
|
||||
}
|
||||
if(this.getNumByField('skuThree')) {
|
||||
skuArr.push(skuThreeData)
|
||||
}
|
||||
let skuArrOne = skuArr[0]
|
||||
let skuArrTwo = skuArr[1]
|
||||
let skuArrThree = skuArr[2]
|
||||
let count = this.getNumByField('skuOne') + this.getNumByField('skuTwo') + this.getNumByField('skuThree')
|
||||
let barCodeSku = []
|
||||
if(count === 1) {
|
||||
let skuArrOnly = []
|
||||
if(this.getNumByField('skuOne')) {
|
||||
skuArrOnly = skuOneData
|
||||
} else if(this.getNumByField('skuTwo')) {
|
||||
skuArrOnly = skuTwoData
|
||||
} else if(this.getNumByField('skuThree')) {
|
||||
skuArrOnly = skuThreeData
|
||||
}
|
||||
for (let i = 0; i < skuArrOnly.length; i++) {
|
||||
barCodeSku.push(skuArrOnly[i])
|
||||
}
|
||||
} else if(count === 2) {
|
||||
for (let i = 0; i < skuArrOne.length; i++) {
|
||||
for (let j = 0; j < skuArrTwo.length; j++) {
|
||||
barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j])
|
||||
}
|
||||
}
|
||||
} else if(count === 3) {
|
||||
for (let i = 0; i < skuArrOne.length; i++) {
|
||||
for (let j = 0; j < skuArrTwo.length; j++) {
|
||||
for (let k = 0; k < skuArrThree.length; k++) {
|
||||
barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j] + '/' + skuArrThree[k])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let meTableData = []
|
||||
getMaxBarCode({}).then((res)=>{
|
||||
if(res && res.code===200) {
|
||||
let k = 0
|
||||
let maxBarCode = res.data.barCode
|
||||
for (let i = 0; i < barCodeSku.length; i++) {
|
||||
let currentBarCode = ''
|
||||
let currentId = ''
|
||||
let purchaseDecimal = ''
|
||||
let commodityDecimal = ''
|
||||
let wholesaleDecimal = ''
|
||||
let lowDecimal = ''
|
||||
for (let j = 0; j < this.meOldDataSource.length; j++) {
|
||||
if(barCodeSku[i] === this.meOldDataSource[j].sku) {
|
||||
currentBarCode = this.meOldDataSource[j].barCode
|
||||
currentId = this.meOldDataSource[j].id
|
||||
purchaseDecimal = this.meOldDataSource[j].purchaseDecimal
|
||||
commodityDecimal = this.meOldDataSource[j].commodityDecimal
|
||||
wholesaleDecimal = this.meOldDataSource[j].wholesaleDecimal
|
||||
lowDecimal = this.meOldDataSource[j].lowDecimal
|
||||
}
|
||||
}
|
||||
if(currentBarCode) {
|
||||
//此时说明该sku之前就存在
|
||||
meTableData.push({id: currentId, barCode: currentBarCode, commodityUnit: unit, sku: barCodeSku[i],
|
||||
purchaseDecimal: purchaseDecimal, commodityDecimal: commodityDecimal,
|
||||
wholesaleDecimal: wholesaleDecimal, lowDecimal: lowDecimal})
|
||||
} else {
|
||||
k = k+1
|
||||
currentBarCode = addBigNumbers(maxBarCode, k)
|
||||
meTableData.push({barCode: currentBarCode, commodityUnit: unit, sku: barCodeSku[i]})
|
||||
}
|
||||
}
|
||||
this.meTable.dataSource = meTableData
|
||||
}
|
||||
})
|
||||
},
|
||||
getNumByField(field) {
|
||||
let num = 0
|
||||
|
||||
@@ -57,9 +57,7 @@
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
<a-divider type="vertical"/>
|
||||
<a-popconfirm title="确定重置密码为123456吗?" @confirm="() => handleReset(record.id)">
|
||||
<a>重置密码</a>
|
||||
</a-popconfirm>
|
||||
<a @click="handleResetModal(record)">重置密码</a>
|
||||
</span>
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderFlag" slot-scope="status">
|
||||
@@ -72,6 +70,7 @@
|
||||
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
|
||||
<user-depot-modal ref="userDepotModal" @ok="modalFormOk"></user-depot-modal>
|
||||
<user-customer-modal ref="userCustomerModal" @ok="modalFormOk"></user-customer-modal>
|
||||
<user-reset-modal ref="userResetModal" @ok="modalFormOk"></user-reset-modal>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -81,6 +80,7 @@
|
||||
import UserModal from './modules/UserModal'
|
||||
import UserDepotModal from './modules/UserDepotModal'
|
||||
import UserCustomerModal from './modules/UserCustomerModal'
|
||||
import UserResetModal from './modules/UserResetModal'
|
||||
import {postAction} from '@/api/manage';
|
||||
import {getCurrentSystemConfig} from '@/api/api'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
@@ -92,6 +92,7 @@
|
||||
UserModal,
|
||||
UserDepotModal,
|
||||
UserCustomerModal,
|
||||
UserResetModal,
|
||||
JInput
|
||||
},
|
||||
data() {
|
||||
@@ -175,6 +176,10 @@
|
||||
this.$refs.modalForm.isReadOnly = true
|
||||
}
|
||||
},
|
||||
handleResetModal(record) {
|
||||
this.$refs.userResetModal.edit(record);
|
||||
this.$refs.userResetModal.title = "请输入" + record.loginName + "的新密码";
|
||||
},
|
||||
handleReset(id) {
|
||||
let that = this;
|
||||
postAction(that.url.resetPwd, {id: id}).then((res) => {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@cancel="handleCancel"
|
||||
cancelText="取消"
|
||||
okText="保存"
|
||||
style="top:5%;height: 85%;">
|
||||
style="top:2%;height:95%;">
|
||||
<template slot="footer">
|
||||
<a-button key="back" v-if="isReadOnly" @click="handleCancel">
|
||||
取消
|
||||
@@ -23,8 +23,10 @@
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form" id="userModal">
|
||||
<a-form-item label="登录名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入登录名称" v-decorator.trim="[ 'loginName', validatorRules.loginName]" :readOnly="!!model.id"
|
||||
suffix="初始密码:123456" />
|
||||
<a-input placeholder="请输入登录名称" v-decorator.trim="[ 'loginName', validatorRules.loginName]" :readOnly="!!model.id" />
|
||||
</a-form-item>
|
||||
<a-form-item label="用户密码" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="!model.id">
|
||||
<a-input-password placeholder="请输入用户密码" v-decorator.trim="[ 'password', validatorRules.password]" />
|
||||
</a-form-item>
|
||||
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
||||
<a-input placeholder="请输入用户姓名" v-decorator.trim="[ 'username', validatorRules.username]" />
|
||||
@@ -71,11 +73,10 @@
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import Vue from 'vue'
|
||||
import md5 from 'md5'
|
||||
import JSelectPosition from '@/components/jeecgbiz/JSelectPosition'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { getAction } from '@/api/manage'
|
||||
import {addUser,editUser,queryOrganizationTreeList,roleAllList} from '@/api/api'
|
||||
import { disabledAuthFilter } from "@/utils/authFilter"
|
||||
import {autoJumpNextInput} from "@/utils/util"
|
||||
import {mixinDevice} from '@/utils/mixin'
|
||||
import JImageUpload from '../../../components/jeecg/JImageUpload'
|
||||
@@ -105,6 +106,12 @@
|
||||
required: true, message: '请输入登录名称!'
|
||||
}]
|
||||
},
|
||||
password: {
|
||||
rules: [
|
||||
{ required: true, message: '请输入用户密码!' },
|
||||
{ pattern: /^(?=.*[a-z])(?=.*\d).{6,}$/, message: '用户密码至少要有数字和小写字母,并且长度至少6位!' }
|
||||
]
|
||||
},
|
||||
username:{
|
||||
rules: [{
|
||||
required: true, message: '请输入用户姓名!'
|
||||
@@ -168,6 +175,7 @@
|
||||
let obj;
|
||||
if(!this.model.id){
|
||||
formData.id = this.userId;
|
||||
formData.password = md5(values.password);
|
||||
obj=addUser(formData);
|
||||
}else{
|
||||
obj=editUser(formData);
|
||||
|
||||
109
jshERP-web/src/views/system/modules/UserResetModal.vue
Normal file
109
jshERP-web/src/views/system/modules/UserResetModal.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<div ref="container">
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
:getContainer="() => $refs.container"
|
||||
:maskStyle="{'top':'93px','left':'154px'}"
|
||||
:wrapClassName="wrapClassNameInfo()"
|
||||
:mask="isDesktop()"
|
||||
:maskClosable="false"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="取消"
|
||||
okText="保存"
|
||||
style="top:25%;height:35%;">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="新密码">
|
||||
<a-input-password placeholder="请输入新密码" v-decorator.trim="[ 'password', validatorRules.password]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import md5 from 'md5'
|
||||
import pick from 'lodash.pick'
|
||||
import { resetPwd } from '@/api/api'
|
||||
import {mixinDevice} from '@/utils/mixin'
|
||||
export default {
|
||||
name: "UserResetModal",
|
||||
mixins: [mixinDevice],
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
visible: false,
|
||||
model: {},
|
||||
maskStyle: '',
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules:{
|
||||
password:{
|
||||
rules: [
|
||||
{ required: true, message: '请输入新密码!' },
|
||||
{ pattern: /^(?=.*[a-z])(?=.*\d).{6,}$/, message: '用户密码至少要有数字和小写字母,并且长度至少6位!' }
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'password'))
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
let formData = Object.assign(this.model, values);
|
||||
let bodyParam = {
|
||||
id: formData.id,
|
||||
password: md5(formData.password)
|
||||
}
|
||||
resetPwd(bodyParam).then((res)=>{
|
||||
if(res.code === 200){
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.data.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user