Browse Source

Merge remote-tracking branch 'origin/master'

master
yunuo970428 12 months ago
parent
commit
3272f32b9c
  1. 36
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  2. 55
      yxt-as-ui/src/api/goods/brand.js
  3. 61
      yxt-as-ui/src/api/goods/category.js
  4. 54
      yxt-as-ui/src/api/goods/factory.js
  5. 45
      yxt-as-ui/src/api/goods/goods.js
  6. 55
      yxt-as-ui/src/api/goods/unit.js
  7. 55
      yxt-as-ui/src/api/storage/inOutStorage.js
  8. 22
      yxt-as-ui/src/api/storage/inStorage.js
  9. 99
      yxt-as-ui/src/api/storage/outStorage.js
  10. 47
      yxt-as-ui/src/api/warehouse/goodsShelves.js
  11. 54
      yxt-as-ui/src/api/warehouse/warehouse.js
  12. 58
      yxt-as-ui/src/api/warehouse/warehouseArea.js
  13. 60
      yxt-as-ui/src/api/warehouse/warehouseAreaType.js
  14. 306
      yxt-as-ui/src/router/index.js
  15. 282
      yxt-as-ui/src/views/goods/brands/brandsAdd.vue
  16. 256
      yxt-as-ui/src/views/goods/brands/index.vue
  17. 218
      yxt-as-ui/src/views/goods/category/categoryAdd.vue
  18. 285
      yxt-as-ui/src/views/goods/category/index.vue
  19. 175
      yxt-as-ui/src/views/goods/factory/factoryAdd.vue
  20. 261
      yxt-as-ui/src/views/goods/factory/index.vue
  21. 1101
      yxt-as-ui/src/views/goods/goods/goodsAdd.vue
  22. 945
      yxt-as-ui/src/views/goods/goods/goodsInfo.vue
  23. 289
      yxt-as-ui/src/views/goods/goods/index.vue
  24. 245
      yxt-as-ui/src/views/goods/unit/index.vue
  25. 208
      yxt-as-ui/src/views/goods/unit/unitAdd.vue
  26. 396
      yxt-as-ui/src/views/storage/inOutStorage/index.vue
  27. 1143
      yxt-as-ui/src/views/storage/inStorage/inStorageAdd.vue
  28. 308
      yxt-as-ui/src/views/storage/inStorage/inStorageInfo.vue
  29. 241
      yxt-as-ui/src/views/storage/inStorage/index.vue
  30. 291
      yxt-as-ui/src/views/storage/outStorage/distributionAdd.vue
  31. 335
      yxt-as-ui/src/views/storage/outStorage/index.vue
  32. 529
      yxt-as-ui/src/views/storage/outStorage/outStorageAdd.vue
  33. 231
      yxt-as-ui/src/views/storage/outStorage/outStorageInfo.vue
  34. 223
      yxt-as-ui/src/views/warehouse/goodsShelves/goodsShelvesAdd.vue
  35. 262
      yxt-as-ui/src/views/warehouse/goodsShelves/index.vue
  36. 265
      yxt-as-ui/src/views/warehouse/warehouse/index.vue
  37. 240
      yxt-as-ui/src/views/warehouse/warehouse/warehouseAdd.vue
  38. 264
      yxt-as-ui/src/views/warehouse/warehouseArea/index.vue
  39. 234
      yxt-as-ui/src/views/warehouse/warehouseArea/warehouseAreaAdd.vue
  40. 261
      yxt-as-ui/src/views/warehouse/warehouseAreaType/index.vue
  41. 163
      yxt-as-ui/src/views/warehouse/warehouseAreaType/warehouseAreaTypeAdd.vue
  42. 2
      yxt-base-biz/src/main/java/com/yxt/base/apiadmin/base/BaseSupplierInfoRest.java
  43. 4
      yxt-base-biz/src/main/java/com/yxt/base/biz/base/basesupplierinfo/BaseSupplierInfo.java
  44. 3
      yxt-base-biz/src/main/java/com/yxt/base/biz/base/basesupplierinfo/BaseSupplierInfoDetailsVo.java
  45. 3
      yxt-base-biz/src/main/java/com/yxt/base/biz/base/basesupplierinfo/BaseSupplierInfoDto.java
  46. 10
      yxt-pms-biz/src/main/java/com/yxt/pms/apiadmin/pms/PmsSupplierTypeRest.java
  47. 3
      yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssupplierinfo/PmsSupplierInfoDto.java
  48. 68
      yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssupplierinfo/PmsSupplierInfoService.java
  49. 54
      yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssuppliertype/PmsSupplierTypeDown.java
  50. 3
      yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssuppliertype/PmsSupplierTypeMapper.java
  51. 8
      yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssuppliertype/PmsSupplierTypeService.java
  52. 3
      yxt-pms-biz/src/main/java/com/yxt/pms/feign/yxtbase/supplier/BaseSupplierInfoDto.java

36
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java

@ -1329,13 +1329,13 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if (confirmation == null) {
return rb.setMsg("该申请不存在");
}
if ("2".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 2) {
return rb.setMsg("该申请已驳回,不允许重复操作");
}
if ("3".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 3) {
return rb.setMsg("该申请已审核通过,不允许驳回");
}
if ("4".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 4) {
return rb.setMsg("该申请已撤回,不允许驳回");
}
if (confirmation.getFirst() == 1) {
@ -1397,13 +1397,13 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if (confirmation == null) {
return rb.setMsg("该申请不存在");
}
if ("3".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 3) {
return rb.setMsg("该申请已审核通过,不允许重复操作");
}
if ("2".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 2) {
return rb.setMsg("该申请已驳回,不允许确认");
}
if ("4".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 4) {
return rb.setMsg("该申请已撤回,不允许确认");
}
confirmation.setAuditState(3);
@ -3333,13 +3333,13 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if (confirmation == null) {
return rb.setMsg("该申请不存在");
}
if ("3".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 3) {
return rb.setMsg("该申请已审核通过,不允许撤回");
}
if ("4".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 4) {
return rb.setMsg("该申请已撤回,不允许重复撤回");
}
if ("2".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 2) {
return rb.setMsg("该申请已驳回,不允许撤回");
}
if (!userSid.equals(confirmation.getCreateBySid())) {
@ -3724,13 +3724,13 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if (confirmation == null) {
return rb.setMsg("该申请不存在");
}
if ("3".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 3) {
return rb.setMsg("该申请已审核通过,不允许撤回");
}
if ("4".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 4) {
return rb.setMsg("该申请已撤回,不允许重复撤回");
}
if ("2".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 2) {
return rb.setMsg("该申请已驳回,不允许撤回");
}
if (!userSid.equals(confirmation.getCreateBySid())) {
@ -3762,13 +3762,13 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if (confirmation == null) {
return rb.setMsg("该申请不存在");
}
if ("2".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 2) {
return rb.setMsg("该申请已驳回,不允许重复操作");
}
if ("3".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 3) {
return rb.setMsg("该申请已审核通过,不允许驳回");
}
if ("4".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 4) {
return rb.setMsg("该申请已撤回,不允许驳回");
}
if (confirmation.getFirst() == 1) {
@ -3804,13 +3804,13 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if (confirmation == null) {
return rb.setMsg("该申请不存在");
}
if ("3".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 3) {
return rb.setMsg("该申请已审核通过,不允许重复操作");
}
if ("2".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 2) {
return rb.setMsg("该申请已驳回,不允许确认");
}
if ("4".equals(confirmation.getAuditState())) {
if (confirmation.getAuditState() == 4) {
return rb.setMsg("该申请已撤回,不允许确认");
}
String collectionTypeKey = confirmation.getCollectionTypeKey(); //收款方式

55
yxt-as-ui/src/api/goods/brand.js

@ -0,0 +1,55 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsbrand/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 类别查询
getAllBrand: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsbrand/listAll',
method: 'get'
})
},
// 修改是否可用状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsbrand/updateIsEnable/'+sid+"/"+isEnable
});
},
// 新增、保存
saveBrands: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsbrand/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initBrands: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsbrand/initialization/' + data,
method: 'get'
});
},
}

61
yxt-as-ui/src/api/goods/category.js

@ -0,0 +1,61 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basegoodstype/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 类别查询
getAllType: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basegoodstype/listAll',
method: 'get'
})
},
// 修改是否可用状态
updateIsEnable: function(sid, isEnable) {
return request({
url: '/yxtbase/apiadmin/base/basegoodstype/updateIsEnable/' + sid + "/" + isEnable
});
},
// 修改是否一品一码
updateIsGoodsID: function(sid, isGoodsID) {
return request({
url: '/yxtbase/apiadmin/base/basegoodstype/updateIsGoodsID/' + sid + "/" + isGoodsID
});
},
// 新增、保存
saveTypes: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basegoodstype/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initTypes: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basegoodstype/initialization/' + data,
method: 'get'
});
},
}

54
yxt-as-ui/src/api/goods/factory.js

@ -0,0 +1,54 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basemanufacturer/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 厂家查询
getAllFacturer: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basemanufacturer/listAll',
method: 'get'
})
},
// 修改是否可用状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/yxtbase/apiadmin/base/basemanufacturer/updateIsEnable/'+sid+"/"+isEnable
});
},
// 新增、保存
saveFacturer: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basemanufacturer/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initFacturer: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basemanufacturer/initialization/' + data,
method: 'get'
});
},
}

45
yxt-as-ui/src/api/goods/goods.js

@ -0,0 +1,45 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsspu/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 修改是否可用状态
updateIsEnable: function(sid, isEnable) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsspu/updateIsEnable/' + sid + "/" + isEnable
});
},
// 新增、保存
saveGoods: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsspu/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initGoods: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsspu/initialization/' + data,
method: 'get'
});
},
}

55
yxt-as-ui/src/api/goods/unit.js

@ -0,0 +1,55 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsunit/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 单位查询
getAllUnit: function(params) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsunit/listAll',
method: 'get'
})
},
// 修改是否可用状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsunit/updateIsEnable/'+sid+"/"+isEnable
});
},
// 新增、保存
saveUnits: function(data) {
return request({
url: '/yxtbase/apiadmin/base/basegoodsunit/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initUnits: function(data) {
return request({
url: '/base/basegoodsunit/initialization/' + data,
method: 'get'
});
},
}

55
yxt-as-ui/src/api/storage/inOutStorage.js

@ -0,0 +1,55 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/wms/apiadmin/inventory/wmsinventoryrecord/pageList',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 导出报表
exportExcel: function(data) {
return request({
url: '/wms/apiadmin/inventory/wmsinventoryrecord/exportExcel',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 选择供应商
choiceSupplier: function(params) {
return request({
url: '/wms/apiadmin/base/basesupplierinfo/choiceSupplierInfo',
method: 'post',
data: params,
})
},
// 查询所有仓库
getWarehouses: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehouseinfo/selectAll',
method: 'get'
})
},
// 根据仓库查询库位
getWarehouseareas: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehousearea/selectAll',
method: 'get',
data: data,
});
},
}

22
yxt-as-ui/src/api/storage/inStorage.js

@ -0,0 +1,22 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/inventory/wmsinventorybill/listPage',
method: 'post',
data: params,
})
},
// 选择商品列表
getAllGoods: function(params) {
return request({
url: '/base/basegoodssku/getSelectList',
method: 'get'
})
},
}

99
yxt-as-ui/src/api/storage/outStorage.js

@ -0,0 +1,99 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/wms/apiadmin/WmsOutBill/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 详情初始化
init: function(data) {
return request({
url: '/wms/apiadmin/WmsOutBill/details',
method: 'get',
data: data
});
},
// 初始配货单
initDistribution: function(data) {
return request({
url: '/wms/apiadmin/WmsDistributeBill/getInit',
method: 'get',
data: data
});
},
// 新增、保存
save: function(data) {
return request({
url: '/wms/apiadmin/WmsOutBill/saveOrUpdateOutBill',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 确认
submit: function(data) {
return request({
url: '/wms/apiadmin/WmsOutBill/confirm',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 新增、保存 配货单
saveDistribution: function(data) {
return request({
url: '/wms/apiadmin/WmsDistributeBill/saveOrUpdateBill',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
deleteBySids: function(data) {
return request({
url: '/wms/apiadmin/WmsShelfBill/delBySids',
method: 'DELETE',
data: data,
headers: {
'Content-Type': 'application/json'
}
})
},
// 查询分页列表
getGoodsListPage: function(params) {
return request({
url: '/wms/apiadmin/WmsOutBill/getInventoryList',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
}

47
yxt-as-ui/src/api/warehouse/goodsShelves.js

@ -0,0 +1,47 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehouserack/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 修改是否可用状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/wms/apiadmin/base/wmswarehouserack/updateIsEnable/'+sid+"/"+isEnable
});
},
// 新增、保存
saveGoodsShelves: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehouserack/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initGoodsShelves: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehouserack/initialization/' + data,
method: 'get'
});
},
}

54
yxt-as-ui/src/api/warehouse/warehouse.js

@ -0,0 +1,54 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehouseinfo/listPage',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
},
// 仓库查询
getAllWarehouse: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehouseinfo/listAll',
method: 'get',
headers: {
'Content-Type': 'application/json'
}
})
},
// 修改是否可用状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/wms/apiadmin/base/wmswarehouseinfo/updateStatus/'+sid+"/"+isEnable
});
},
// 新增、保存
saveWarehouse: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehouseinfo/saveOrUpdate',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
});
},
// 初始化
initWarehouse: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehouseinfo/initialization/' + data,
method: 'get'
});
},
}

58
yxt-as-ui/src/api/warehouse/warehouseArea.js

@ -0,0 +1,58 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehousearea/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 库区查询
getAllWarehousearea: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehousearea/listAll',
method: 'get',
headers: {
'Content-Type': 'application/json'
}
})
},
// 修改是否可用状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/wms/apiadmin/base/wmswarehousearea/updateIsEnable/'+sid+"/"+isEnable
});
},
// 新增、保存
saveWarehousearea: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehousearea/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initWarehousearea: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehousearea/initialization/' + data,
method: 'get'
});
},
}

60
yxt-as-ui/src/api/warehouse/warehouseAreaType.js

@ -0,0 +1,60 @@
import request from '@/utils/request'
export default {
// 查询分页列表
listPage: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehouseareatype/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 库位查询
getAllWarehouseareatype: function(params) {
return request({
url: '/wms/apiadmin/base/wmswarehouseareatype/listAll',
method: 'get',
headers: {
'Content-Type': 'application/json'
}
})
},
// 修改是否可用状态
updateIsEnable: function(sid,isEnable) {
return request({
url: '/wms/apiadmin/base/wmswarehouseareatype/updateIsEnable/'+sid+"/"+isEnable
});
},
// 新增、保存
saveWarehousearea: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehouseareatype/saveOrUpdate',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
});
},
// 初始化
initWarehousearea: function(data) {
return request({
url: '/wms/apiadmin/base/wmswarehouseareatype/initialization/' + data,
method: 'get'
});
},
}

306
yxt-as-ui/src/router/index.js

@ -7,8 +7,7 @@ Vue.use(Router)
import Layout from '@/layout'
/* 所有角色可以访问/没有权限要求的基页 */
export const constantRoutes = [
{
export const constantRoutes = [{
path: '/redirect',
component: Layout,
hidden: true,
@ -17,26 +16,26 @@ export const constantRoutes = [
component: () => import('@/views/redirect/index.vue')
}]
},
{
path: '/',
redirect: 'index'
},
{
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
},
{
path: '/',
redirect: 'index'
},
{
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
},
{
path: '/404',
component: () =>
@ -50,48 +49,68 @@ export const constantRoutes = [
meta: {
title: '业务'
},
children: [
{
children: [{
path: '/preregistration/preregistration',
component: () => import('@/views/operation/preregistration/preregistration.vue'),
name: 'Preregistration',
meta: { title: '预约登记', noCache: true }
meta: {
title: '预约登记',
noCache: true
}
},
{
path: '/repairbill/repairbill',
component: () => import('@/views/operation/repairbill/repairbill.vue'),
name: 'RepairBill',
meta: { title: '维修开单管理(登记)', noCache: true }
meta: {
title: '维修开单管理(登记)',
noCache: true
}
},
{
path: '/repairbill/repairbillBySendWork',
component: () => import('@/views/operation/repairbill/repairbillBySendWork.vue'),
name: 'RepairBillBySendWork',
meta: { title: '维修开单管理(派工)', noCache: true }
meta: {
title: '维修开单管理(派工)',
noCache: true
}
},
{
path: '/repairbill/repairbillByMaintain',
component: () => import('@/views/operation/repairbill/repairbillByMaintain.vue'),
name: 'RepairBillByMaintain',
meta: { title: '维修开单管理(维修)', noCache: true }
meta: {
title: '维修开单管理(维修)',
noCache: true
}
},
{
path: '/repairbill/repairbillByBeCompleted',
component: () => import('@/views/operation/repairbill/repairbillByBeCompleted.vue'),
name: 'RepairBillByBeCompleted',
meta: { title: '维修开单管理(竣工)', noCache: true }
meta: {
title: '维修开单管理(竣工)',
noCache: true
}
},
{
path: '/repairbill/repairbillBySettleAccounts',
component: () => import('@/views/operation/repairbill/repairbillBySettleAccounts.vue'),
name: 'RepairBillBySettleAccounts',
meta: { title: '维修开单管理(结算)', noCache: true }
meta: {
title: '维修开单管理(结算)',
noCache: true
}
},
{
path: '/repairbill/repairbillBYLeaveFactory',
component: () => import('@/views/operation/repairbill/repairbillBYLeaveFactory.vue'),
name: 'RepairBillBYLeaveFactory',
meta: { title: '维修开单管理(出厂)', noCache: true }
meta: {
title: '维修开单管理(出厂)',
noCache: true
}
},
// {
// path: '/workslrsettlement/workslrsettlement',
@ -101,7 +120,107 @@ export const constantRoutes = [
// },
]
},
{
path: '/operation',
component: Layout,
redirect: '/operation',
meta: {
title: '仓库管理'
},
children: [{
path: '/goodsShelves/index',
component: () => import('@/views/warehouse/goodsShelves/index.vue'),
name: 'GoodsShelves',
meta: {
title: '库位管理',
noCache: true
}
},
{
path: '/warehouseArea/index',
component: () => import('@/views/warehouse/warehouseArea/index.vue'),
name: 'WarehouseArea',
meta: {
title: '库区管理',
noCache: true
}
},
{
path: '/warehouseAreaType/index',
component: () => import('@/views/warehouse/warehouseAreaType/index.vue'),
name: 'WarehouseAreaType',
meta: {
title: '库区类型管理',
noCache: true
}
},
{
path: '/warehouse/index',
component: () => import('@/views/warehouse/warehouse/index.vue'),
name: 'Warehouse',
meta: {
title: '仓库管理',
noCache: true
}
},
]
},
{
path: '/goods',
component: Layout,
redirect: '/goods',
meta: {
title: '商品管理'
},
children: [{
path: '/brands/index',
component: () => import('@/views/goods/brands/index.vue'),
name: 'Brands',
meta: {
title: '品牌管理',
noCache: true
}
},
{
path: '/category/index',
component: () => import('@/views/goods/category/index.vue'),
name: 'Category',
meta: {
title: '类别管理',
noCache: true
}
},
{
path: '/factory/index',
component: () => import('@/views/goods/factory/index.vue'),
name: 'Factory',
meta: {
title: '厂家管理',
noCache: true
}
},
{
path: '/goods/index',
component: () => import('@/views/goods/goods/index.vue'),
name: 'Goods',
meta: {
title: '商品管理',
noCache: true
}
},
{
path: '/unit/index',
component: () => import('@/views/goods/unit/index.vue'),
name: 'Unit',
meta: {
title: '单位管理',
noCache: true
}
},
]
},
{
path: '/storage',
component: Layout,
@ -109,18 +228,32 @@ export const constantRoutes = [
meta: {
title: '仓储'
},
children: [
children: [{
path: 'outStorage',
name: 'outStorage',
component: () => import('@/views/storage/outStorage/index'),
meta: {
title: '出库管理',
noCache: true
}
},
{
path: '/inventory/inventory',
component: () => import('@/views/storage/inventory/inventory.vue'),
name: 'Inventory',
meta: { title: '库存查询', noCache: true }
meta: {
title: '库存查询',
noCache: true
}
},
{
path: '/inventory/inventoryRefer',
component: () => import('@/views/storage/inventory/inventoryRefer.vue'),
name: 'InventoryRefer',
meta: { title: '出入库查询', noCache: true }
meta: {
title: '出入库查询',
noCache: true
}
},
{
path: '/stocktaking/index',
@ -231,18 +364,23 @@ export const constantRoutes = [
meta: {
title: '采购'
},
children: [
{
children: [{
path: '/procurement/procurement',
component: () => import('@/views/purchase/procurement/procurement.vue'),
name: 'Procurement',
meta: { title: '采购开单', noCache: true }
meta: {
title: '采购开单',
noCache: true
}
},
{
path: '/purchasereturn/purchasereturn',
component: () => import('@/views/purchase/purchasereturn/purchasereturn.vue'),
name: 'PurchaseReturn',
meta: { title: '采购退货', noCache: true }
meta: {
title: '采购退货',
noCache: true
}
}
]
},
@ -253,48 +391,68 @@ export const constantRoutes = [
meta: {
title: '报表'
},
children: [
{
children: [{
path: '/salesstatement/merchandisesalesdetail',
component: () => import('@/views/statement/salesstatement/merchandisesalesdetail.vue'),
name: 'MerchandiseSalesDetail',
meta: { title: '销售明细商品', noCache: true }
meta: {
title: '销售明细商品',
noCache: true
}
},
{
path: '/salesstatement/merchandisesalessummary',
component: () => import('@/views/statement/salesstatement/merchandisesalessummary.vue'),
name: 'MerchandiseSalesSummary',
meta: { title: '销售汇总商品', noCache: true }
meta: {
title: '销售汇总商品',
noCache: true
}
},
{
path: '/salesstatement/salestrendreport',
component: () => import('@/views/statement/salesstatement/salestrendreport.vue'),
name: 'SalesTrendReport',
meta: { title: '销售价趋势报表', noCache: true }
meta: {
title: '销售价趋势报表',
noCache: true
}
},
{
path: '/warehousereport/inventorystatistics',
component: () => import('@/views/statement/warehousereport/inventorystatistics.vue'),
name: 'InventoryStatistics',
meta: { title: '库存统计', noCache: true }
meta: {
title: '库存统计',
noCache: true
}
},
{
path: '/warehousereport/receiptandreceiptrecord',
component: () => import('@/views/statement/warehousereport/receiptandreceiptrecord.vue'),
name: 'ReceiptAndReceiptRecord',
meta: { title: '收发存明细报表', noCache: true }
meta: {
title: '收发存明细报表',
noCache: true
}
},
{
path: '/purchasereport/detailedpurchasereport',
component: () => import('@/views/statement/purchasereport/detailedpurchasereport.vue'),
name: 'DetailedPurchaseReport',
meta: { title: '采购明细报表', noCache: true }
meta: {
title: '采购明细报表',
noCache: true
}
},
{
path: '/purchasereport/purchasesummaryreport',
component: () => import('@/views/statement/purchasereport/purchasesummaryreport.vue'),
name: 'PurchaseSummaryReport',
meta: { title: '采购汇总报表', noCache: true }
meta: {
title: '采购汇总报表',
noCache: true
}
}
]
},
@ -305,48 +463,68 @@ export const constantRoutes = [
meta: {
title: '基础信息'
},
children: [
{
children: [{
path: '/maintenanceitem/maintenanceitem',
component: () => import('@/views/basicinformation/maintenanceitem/maintenanceitem.vue'),
name: 'MaintenanceItem',
meta: { title: '维修项目管理', noCache: true }
meta: {
title: '维修项目管理',
noCache: true
}
},
{
path: '/additionitem/additionitem',
component: () => import('@/views/basicinformation/additionitem/additionitem.vue'),
name: 'AdditionItem',
meta: { title: '附加项目管理', noCache: true }
meta: {
title: '附加项目管理',
noCache: true
}
},
{
path: '/setmeal/setmeal',
component: () => import('@/views/basicinformation/setmeal/setmeal.vue'),
name: 'Setmeal',
meta: { title: '套餐管理', noCache: true }
meta: {
title: '套餐管理',
noCache: true
}
},
{
path: '/profession/profession',
component: () => import('@/views/basicinformation/profession/profession.vue'),
name: 'Profession',
meta: { title: '工种管理', noCache: true }
meta: {
title: '工种管理',
noCache: true
}
},
{
path: '/subjects/subjects',
component: () => import('@/views/basicinformation/subjects/subjects.vue'),
name: 'Subjects',
meta: { title: '科目管理', noCache: true }
meta: {
title: '科目管理',
noCache: true
}
},
{
path: '/team/team',
component: () => import('@/views/basicinformation/team/team.vue'),
name: 'Team',
meta: { title: '班组管理', noCache: true }
meta: {
title: '班组管理',
noCache: true
}
},
{
path: '/suppliertype/suppliertype',
component: () => import('@/views/basicinformation/suppliertype/suppliertype.vue'),
name: 'SupplierType',
meta: { title: '供应商类型管理', noCache: true }
meta: {
title: '供应商类型管理',
noCache: true
}
},
{
path: '/supplier/supplier',
@ -356,22 +534,24 @@ export const constantRoutes = [
}
]
},
// 404 page must be placed at the end !!!
// { path: '*', redirect: '/404', hidden: true }
// 404 page must be placed at the end !!!
// { path: '*', redirect: '/404', hidden: true }
]
const createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
// mode: 'history', // require service support
scrollBehavior: () => ({
y: 0
}),
routes: constantRoutes
})
const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router

282
yxt-as-ui/src/views/goods/brands/brandsAdd.vue

@ -0,0 +1,282 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>商品信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">品牌名称</span>
<el-input v-model="formobj.brandName" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">品牌代码</span>
<el-input v-model="formobj.brandCode" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">首字母大写</span>
<el-input v-model="formobj.letter" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">品牌备注</span>
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
</div>
<!-- <div class="item">
<span class="item_text">品牌故事</span>
<el-input v-model="formobj.brandStory" placeholder="" class="item_input" clearable />
</div> -->
<!-- <div class="item" style="margin-bottom: 100px;margin-top: 100px;">
<div style="flex: 1;display: flex;flex-direction: row;align-items: center;">
<span class="item_text2" >品牌Logo</span>
<upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px;" class="item_input2" :limit="1"
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" @change="backData" />
</div>
<div style="flex: 1;display: flex;flex-direction: row;align-items: center;">
<span class="item_text2">专区大图</span>
<upload ref="uploadImg2" v-model="imgList2" style="margin-top: 20px;" class="item_input2" :limit="1"
bucket="map" :class="{ hide: hideUploadBtn2 }" :upload-data="{ type: '0001' }" @change="backData2" />
</div>
</div> -->
<div class="item" style="margin-bottom: 100px;margin-top: 100px;">
<span class="item_text">品牌Logo</span>
<!-- <upload ref="uploadImg" v-model="imgList" style="" class="item_input" :limit="1"
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" @change="backData" />
-->
<upload-img ref="uploadImg" class="item_input" v-model="formobj.image" :limit="50" bucket="map"
:upload-data="{ type: '0001' }" />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/goods/brand.js'
import uploadImg from '@/components/uploadFile/uploadImg'
export default {
components: {
uploadImg
},
data() {
return {
imgList: [],
imgList2: [],
submitdisabled: false,
formobj: {
sid: '',
brandName: '',
brandCode: '',
remarks: '',
letter: '',
image: "",
},
hideUploadBtn: false,
hideUploadBtn2: false
}
},
created() {
// this.initData()
},
methods: {
backData(value) {
console.log('backData》》》》', value)
console.log('imgList', this.imgList)
if (this.imgList.length > 0) {
this.formobj.image = this.imgList[0].url
} else {
this.formobj.image = ''
}
this.hideUploadBtn = this.imgList.length != 0
console.log('this.hideUploadBtn', this.hideUploadBtn)
},
backData2(value) {
console.log('backData2》》》》', value)
console.log('imgList2', this.imgList2)
if (this.imgList2.length > 0) {
this.formobj.bigPic = this.imgList2[0].url
} else {
this.formobj.bigPic = ''
}
this.hideUploadBtn2 = this.imgList2.length != 0
console.log('this.hideUploadBtn2', this.hideUploadBtn2)
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveBrands(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.imgList2 = []
this.hideUploadBtn = true
this.hideUploadBtn2 = true
this.formobj = {
sid: '',
brandName: '',
brandCode: '',
remarks: '',
letter: '',
image: "",
}
this.$emit('doback')
},
showAdd() {
console.log("this.imgList", this.imgList)
console.log("this.imgList2", this.imgList2)
this.hideUploadBtn = this.imgList.length != 0
this.hideUploadBtn2 = this.imgList2.length != 0
},
showEdit(row) {
req.initBrands(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
this.imgList = []
this.imgList2 = []
if (resp.data.image != '') {
this.imgList.push({
url: resp.data.image
})
}
if (resp.data.bigPic != '') {
this.imgList2.push({
url: resp.data.bigPic
})
}
this.hideUploadBtn = this.imgList.length != 0
this.hideUploadBtn2 = this.imgList2.length != 0
}
})
.catch(e => {
this.formobj = row
this.imgList = []
this.imgList2 = []
})
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_text2 {
flex: 1;
font-size: 18px;
text-align: right;
}
.item_input2 {
flex: 1;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

256
yxt-as-ui/src/views/goods/brands/index.vue

@ -0,0 +1,256 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="品牌列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="品牌名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">品牌列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column label="品牌Logo" align="center">
<template slot-scope="scope">
<el-popover placement="left" trigger="click" width="300">
<img :src="scope.row.image" width="100%">
<img slot="reference" :src="scope.row.image" :alt="scope.row.image"
style="max-height: 70px;max-width: 70px; padding: 5px">
</el-popover>
</template>
</el-table-column>
<el-table-column prop="brandName" label="品牌名称" align="center" />
<el-table-column prop="brandCode" label="品牌代码" align="center" />
<el-table-column prop="letter" label="首字母大写" align="center" />
<el-table-column prop="remarks" label="品牌备注" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/goods/brand.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './brandsAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

218
yxt-as-ui/src/views/goods/category/categoryAdd.vue

@ -0,0 +1,218 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>类别信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">选择父级类别</span>
<el-select v-model="formobj.pname" placeholder="请选择父级类别" class="item_input" @change="selectGoodsTypeChange">
<el-option v-for="item in goodsTypeList" :key="item.sid" :label="item.goodsTypeName" :value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">类别名称</span>
<el-input v-model="formobj.goodsTypeName" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">类别编码</span>
<el-input v-model="formobj.goodsTypeCode" placeholder="" class="item_input" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
</div>
<div class="item">
<span class="item_text">提成比例</span>
<el-input v-model="formobj.percentageRate" placeholder="" class="item_input" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
</div>
<div class="item">
<span class="item_text">提成金额</span>
<el-input v-model="formobj.percentageAmount" placeholder="" class="item_input" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
</div>
<div class="item">
<span class="item_text">类别排序</span>
<el-input v-model="formobj.sortNo" placeholder="" class="item_input" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
</div>
<div class="item">
<span class="item_text">类别备注</span>
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/goods/category.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
goodsTypeName: '',
goodsTypeCode: '',
percentageRate: '',
percentageAmount: '',
sids: '',
pname: '',
sortNo: '',
remarks: '',
},
goodsTypeList: [],
}
},
created() {
this.initData()
},
methods: {
initData() {
console.log('>>>>>>>>>initData')
req.getAllType().then(resp => {
this.goodsTypeList = resp.data
})
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveTypes(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
goodsTypeName: '',
goodsTypeCode: '',
percentageRate: '',
percentageAmount: '',
sids: '',
pname: '',
sortNo: '',
remarks: '',
}
this.$emit('doback')
},
showAdd() {},
showEdit(row) {
req.initTypes(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
selectGoodsTypeChange(val) {
const choose = this.goodsTypeList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectGoodsTypeChange', choose)
this.formobj.sids = choose[0].sid
this.formobj.pName = choose[0].goodsTypeName
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

285
yxt-as-ui/src/views/goods/category/index.vue

@ -0,0 +1,285 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="类别列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="类别名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="dosearch"
>查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">类别列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column label="是否一品一码" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isGoodsID" active-text="" inactive-text="" active-value="1"
inactive-value="0" @change="enableChange2(scope.row.sid,scope.row.isGoodsID)" />
</template>
</el-table-column>
<el-table-column prop="goodsTypeName" label="类别名称" align="center" />
<el-table-column prop="goodsTypeCode" label="类别编码" align="center" />
<el-table-column prop="pname" label="上级类别" align="center" />
<el-table-column prop="percentageRate" label="提成比例" align="center" />
<el-table-column prop="percentageAmount" label="提成金额" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/goods/category.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './categoryAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
enableChange2(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsGoodsID(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

175
yxt-as-ui/src/views/goods/factory/factoryAdd.vue

@ -0,0 +1,175 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>厂家信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">厂家名称</span>
<el-input v-model="formobj.manufacturerName" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">厂家编码</span>
<el-input v-model="formobj.manufacturerCode" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">厂家排序</span>
<el-input v-model="formobj.sortNo" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">厂家备注</span>
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/goods/factory.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
manufacturerName: '',
manufacturerCode: '',
sortNo: '',
remarks: ""
},
}
},
created() {},
methods: {
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveFacturer(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
manufacturerName: '',
manufacturerCode: '',
sortNo: '',
remarks: ""
}
this.$emit('doback')
},
showAdd() {},
showEdit(row) {
req.initFacturer(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

261
yxt-as-ui/src/views/goods/factory/index.vue

@ -0,0 +1,261 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="厂家列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="厂家名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="dosearch"
>查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">厂家列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="manufacturerName" label="厂家名称" align="center" />
<el-table-column prop="manufacturerCode" label="厂家编码" align="center" />
<el-table-column prop="sortNo" label="排序" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/goods/factory.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './factoryAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
}
}
</script>
<style scoped>
</style>

1101
yxt-as-ui/src/views/goods/goods/goodsAdd.vue

File diff suppressed because it is too large

945
yxt-as-ui/src/views/goods/goods/goodsInfo.vue

@ -0,0 +1,945 @@
<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="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>基础信息</div>
</div>
<el-row class="first_row">
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">商品名称</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.goodsName" placeholder="商品名称" class="addinputw" style="width:100%" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">商品编码</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.barCode" placeholder="商品编码" style="width: 100%;" class="addinputw" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">商品品牌</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-select v-model="formobj.brandName" placeholder="请选择商品品牌" class="addinputw" style="width: 100%;"
@change="selectBrandChange">
<el-option v-for="item in brandList" :key="item.sid" :label="item.brandName" :value="item.sid" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">商品类别</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-select v-model="formobj.typeName" placeholder="请选择商品类别" class="addinputw" style="width: 100%;"
@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-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">商品厂家</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-select v-model="formobj.manufacturerName" placeholder="请选择商品厂家" class="addinputw" style="width: 100%;"
@change="selectfacturerChange">
<el-option v-for="item in facturerList" :key="item.sid" :label="item.manufacturerName"
:value="item.sid" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">厂家货号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.factoryCode" placeholder="商品名称" style="width: 100%;" class="addinputw"
clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">外部编码</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.externalCode" placeholder="外部编码" style="width: 100%;" class="addinputw"
clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">国标码</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.nationalStandardCode" placeholder="国标码" style="width: 100%;" class="addinputw"
clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">税率</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.taxRate" placeholder="税率" style="width: 100%;" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">保质期天</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.shelfLife" placeholder="保质期天" style="width: 100%;" class="addinputw"
clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">商品详细说明</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item class="trightb_item">
<el-input v-model="formobj.baseGoodsSpuDetail.goodsExplain" type="textarea" :rows="4"
style="width: 100%;margin-bottom: 5px;;" placeholder="商品详细说明" class="addinputw" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">商品描述</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item class="trightb_item">
<el-input v-model="formobj.baseGoodsSpuDetail.goodsDescription" type="textarea" :rows="4"
style="width: 100%;margin-bottom: 5px;;" placeholder="商品描述" class="addinputw" clearable />
</el-form-item>
</el-col>
</el-row>
<el-collapse v-model="activeNames" style="margin-top: 20px;">
<el-collapse-item name="1">
<template slot="title">
规格列表<span class="span" @click.stop="add()">添加</span>
</template>
<el-table v-loading="listLoading" :data="formobj.baseGoodsSkus" border style="width: 100%;"
:row-style="{height: '40px'}">
<!-- <el-table-column type="selection" align="center" width="50"/> -->
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
<el-table-column label="是否可用" align="center" width="200">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column label="规格代码" prop="goodsSkuCode" align="center" />
<el-table-column label="标题" prop="title" align="center" />
<el-table-column label="外部编码" prop="externalCode" align="center" />
<el-table-column label="规格明细" wid align="center" width="250">
<template slot-scope="scope">
<el-button type="primary" size="mini"
@click="showGoodsSkuDttail(scope.row.baseGoodsSkuExtend)">查看</el-button>
<el-button type="primary" size="mini"
@click="editGoodsSkuDttail(scope.row.baseGoodsSkuExtend)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</el-collapse-item>
</el-collapse>
</el-form>
<el-dialog title="查看规格明细" :visible.sync="dialogVisible" :before-close="handleClose">
<el-form ref="dataForm1" class="formadd" style="margin-top: -40px;" :model="itemInfo">
<el-row class="first_row">
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">最后采购价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.finalPurchasePrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">安全库存天数</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.safetyStockDays}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">是否原厂</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.isOriginalFactory}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">是否库存警戒</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.isInventoryAlert}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库存警戒上线</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.inventoryAlertUpperLimit}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库存警戒下线</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.inventoryAlertLowerLimit}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">成本价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.costPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">吊牌价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.tagPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">销售单价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.salesPrice}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">标准进价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.standardPurchasePrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">代理价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.agencyPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">折扣</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.discount}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">最低零售价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.minimumSalesPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">是否积分兑换</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.isIntegralExchange}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">积分数量</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.integralAmount}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">规格图片</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item class="trightb_item">
<template slot-scope="scope">
<span v-for="(item,index) in itemInfo.urls" :key="index">
<el-popover placement="left" trigger="click" width="300">
<img :src="item" width="100%" />
<img slot="reference" :src="item" :alt="item"
style="max-height: 70px;max-width: 70px; padding: 5px" />
</el-popover>
</span>
</template>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
<el-button type="primary" style="margin-top: 20px;" @click="handleClose"> </el-button>
</div>
</el-dialog>
<el-dialog title="编辑规格明细" :visible.sync="dialogVisible2" :before-close="handleClose2">
<el-form ref="dataForm2" class="formadd" style="margin-top: -40px;" :model="orderInfo">
<el-row class="first_row">
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">最后采购价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.finalPurchasePrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">安全库存天数</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.safetyStockDays}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">是否原厂</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.isOriginalFactory}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">是否库存警戒</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.isInventoryAlert}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库存警戒上线</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.inventoryAlertUpperLimit}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">库存警戒下线</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.inventoryAlertLowerLimit}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">成本价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.costPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">吊牌价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.tagPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">销售单价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.salesPrice}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">标准进价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.standardPurchasePrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">代理价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.agencyPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">折扣</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.discount}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">最低零售价</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.minimumSalesPrice}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">是否积分兑换</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.isIntegralExchange}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">积分数量</span>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="trightb_item">
<span slot="label">{{itemInfo.integralAmount}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">规格图片</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item class="trightb_item">
<!-- <upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px; z-index: 1000;" class="item_input" :limit="9"
bucket="map" :class="{ hide: false }" :upload-data="{ type: '0001' }" @change="backData" /> -->
<upload-img ref="uploadImg" class="item_input" v-model="itemInfo.urls" :limit="50" bucket="map"
:upload-data="{ type: '0001' }" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
<el-button type="primary" style="margin-top: 20px;" @click="handleClose2"> </el-button>
</div>
</el-dialog>
<!-- <el-card class="box-card">
<div class="item">
<span class="item_text">选择商品品牌</span>
<el-select v-model="formobj.brand" placeholder="请选择商品品牌" class="item_input" @change="selectBrandChange">
<el-option v-for="item in brandList" :key="item.sid" :label="item.brandName" :value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">选择商品类别</span>
<el-select v-model="formobj.typeName" placeholder="请选择商品类别" class="item_input" @change="selectCateChange">
<el-option v-for="item in cateList" :key="item.sid" :label="item.goodsTypeName" :value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">选择商品厂家</span>
<el-select v-model="formobj.manufacturer" placeholder="请选择商品厂家" class="item_input"
@change="selectfacturerChange">
<el-option v-for="item in facturerList" :key="item.sid" :label="item.manufacturerName" :value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">商品名称</span>
<el-input v-model="formobj.goodsName" placeholder="商品名称" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">商品编码</span>
<el-input v-model="formobj.goodsCode" placeholder="商品编码" class="item_input" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
</div>
<div class="item">
<span class="item_text">商品条码</span>
<el-input v-model="formobj.barCode" placeholder="商品条码" class="item_input" clearable
oninput="value=value.replace(/[^0-9]/g,'')" />
</div>
<div class="item">
<span class="item_text">商品产地</span>
<el-input v-model="formobj.producer" placeholder="商品产地" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">商品单位</span>
<el-input v-model="formobj.unit" placeholder="商品单位" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">商品规格</span>
<el-input v-model="formobj.specification" placeholder="商品规格" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">商品简介</span>
<el-input v-model="formobj.remarks" placeholder="商品简介" class="item_input" clearable />
</div>
<div class="item" style="margin-bottom: 100px;margin-top: 100px;">
<span class="item_text">商品图片</span>
<upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px;" class="item_input" :limit="1"
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" @change="backData" />
</div>
</el-card> -->
</div>
</div>
</template>
<script>
import req from '@/api/goods/goods.js'
import req2 from '@/api/goods/brand.js'
import req3 from '@/api/goods/category.js'
import req4 from '@/api/goods/factory.js'
import uploadImg from '@/components/uploadFile/uploadImg'
export default {
components: {
uploadImg
},
data() {
return {
listLoading: false,
activeNames: ['1'],
imgList: [],
submitdisabled: false,
formobj: {
sid: '',
goodsName: "",
goodsCode: "",
brandSid: "",
brand: "",
goodsTypeSid: "",
typeName: "",
manufacturersid: "",
manufacturer: "",
externalCode: '',
factoryCode: '',
taxRate: '',
shelfLife: '',
baseGoodsSpuDetail: {
goodsExplain: "",
goodsDescription: ""
},
baseGoodsSkuDtos: []
},
brandList: [],
cateList: [],
facturerList: [],
hideUploadBtn: false,
dialogVisible: false,
dialogVisible2: false,
itemInfo: {},
orderInfo: {}
}
},
created() {
this.initData()
},
methods: {
initData() {
req2.getAllBrand().then(resp => {
this.brandList = resp.data
})
req3.getAllType().then(resp => {
this.cateList = resp.data
})
req4.getAllFacturer().then(resp => {
this.facturerList = resp.data
})
},
backData(value) {
console.log('backData》》》》', value)
console.log('imgList', this.imgList)
if (this.imgList.length > 0) {
this.formobj.picUrl = this.imgList[0].url
} else {
this.formobj.picUrl = ''
}
this.hideUploadBtn = this.imgList.length != 0
console.log('this.hideUploadBtn', this.hideUploadBtn)
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveGoods(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.imgList = []
this.hideUploadBtn = true
this.formobj = {
sid: '',
brand: "",
brandSid: "",
typeName: "",
goodsTypeSid: "",
manufacturer: "",
manufacturerSid: "",
goodsName: '',
goodsCode: '',
barcode: '',
producer: '',
unit: '',
specification: '',
remarks: '',
baseGoodsSpuDetail: {
goodsExplain: "",
goodsDescription: ""
},
baseGoodsSku: []
}
this.$emit('doback')
},
showAdd() {},
indexMethod(index) {
return index + 1
},
showEdit(row) {
req.initGoods(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
selectBrandChange(val) {
const choose = this.brandList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectBrandChange', choose)
this.formobj.brandSid = choose[0].sid
this.formobj.brandName = choose[0].brandName
},
selectCateChange(val) {
const choose = this.cateList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectCateChange', choose)
this.formobj.goodsTypeSid = choose[0].sid
this.formobj.typeName = choose[0].goodsTypeName
},
selectfacturerChange(val) {
const choose = this.facturerList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectfacturerChange', choose)
this.formobj.manufacturerSid = choose[0].sid
this.formobj.manufacturerName = choose[0].manufacturerName
},
showGoodsSkuDttail(goodsSkuDto) {
console.log('>>>>>>>>>showGoodsSkuDttail', goodsSkuDto)
this.dialogVisible = true
this.itemInfo = goodsSkuDto
this.imgList = goodsSkuDto.urls
},
editGoodsSkuDttail(goodsSkuDto) {
console.log('>>>>>>>>>editGoodsSkuDttail', goodsSkuDto)
this.dialogVisible2 = true
this.itemInfo = goodsSkuDto
this.imgList = goodsSkuDto.urls
},
handleClose() {
this.dialogVisible = false
},
handleClose2() {
this.dialogVisible2 = false
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {}
.span {
margin-left: 50px;
font-size: 15px;
font-weight: 400;
}
::v-deep .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
</style>

289
yxt-as-ui/src/views/goods/goods/index.vue

@ -0,0 +1,289 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="商品列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="商品名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit" :hidden="false">商品列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column width="50" type="selection" align="center" />
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="80">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">详情</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="goodsName" label="商品名称" align="center" />
<el-table-column prop="goodsCode" label="商品编码" align="center" />
<el-table-column prop="barCode" label="商品条码" align="center" />
<el-table-column prop="brandName" label="商品品牌" align="center" />
<el-table-column prop="typeName" label="商品类别" align="center" />
<el-table-column prop="goodsUnitName" label="商品单位" align="center" />
<el-table-column prop="manufacturerName" label="商品厂家" align="center" />
<el-table-column prop="nationalStandardCode" label="国标码" align="center" />
<el-table-column prop="taxRate" label="税率" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
<!-- 详情部分组件 -->
<divInfo v-show="viewState == 4" ref="divinfo" />
</div>
</template>
<script>
import req from '@/api/goods/goods.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './goodsAdd.vue'
import divInfo from './goodsInfo.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo,
},
data() {
return {
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: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: [],
selectionList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
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 'doClose':
this.doClose()
break
default:
break
}
},
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toEdit() {
if(this.selectionList.length!=1){
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
}
}
</script>
<style scoped>
</style>

245
yxt-as-ui/src/views/goods/unit/index.vue

@ -0,0 +1,245 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="单位列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="单位名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">单位列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="unitName" label="单位名称" align="center" />
<el-table-column prop="remarks" label="单位备注" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/goods/unit.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './unitAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

208
yxt-as-ui/src/views/goods/unit/unitAdd.vue

@ -0,0 +1,208 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>单位信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">单位名称</span>
<el-input v-model="formobj.unitName" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">单位备注</span>
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
</div>
<!-- <div class="item">
<span class="item_text">品牌故事</span>
<el-input v-model="formobj.brandStory" placeholder="" class="item_input" clearable />
</div> -->
<!-- <div class="item" style="margin-bottom: 100px;margin-top: 100px;">
<div style="flex: 1;display: flex;flex-direction: row;align-items: center;">
<span class="item_text2" >品牌Logo</span>
<upload ref="uploadImg2" v-model="imgList" style="margin-top: 20px;" class="item_input2" :limit="1"
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" @change="backData" />
</div>
<div style="flex: 1;display: flex;flex-direction: row;align-items: center;">
<span class="item_text2">专区大图</span>
<upload ref="uploadImg2" v-model="imgList2" style="margin-top: 20px;" class="item_input2" :limit="1"
bucket="map" :class="{ hide: hideUploadBtn2 }" :upload-data="{ type: '0001' }" @change="backData2" />
</div>
</div> -->
<!-- <div class="item" style="margin-bottom: 100px;margin-top: 100px;">
<span class="item_text">品牌Logo</span>
<upload ref="uploadImg" v-model="imgList" style="" class="item_input" :limit="1"
bucket="map" :class="{ hide: hideUploadBtn }" :upload-data="{ type: '0001' }" @change="backData" />
</div> -->
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/goods/unit.js'
export default {
components: {
},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
unitName: '',
remarks: '',
},
}
},
created() {
// this.initData()
},
methods: {
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveUnits(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
unitName: '',
remarks: '',
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.initUnits(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_text2 {
flex: 1;
font-size: 18px;
text-align: right;
}
.item_input2 {
flex: 1;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

396
yxt-as-ui/src/views/storage/inOutStorage/index.vue

@ -0,0 +1,396 @@
<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="商品ID">
<el-input v-model="queryParams.params.goodsID" placeholder="" clearable />
</el-form-item>
<el-form-item label="商品名称">
<el-input v-model="queryParams.params.goodsSpuName" placeholder="" clearable />
</el-form-item>
<el-form-item label="商品编码">
<el-input v-model="queryParams.params.goodsSkuCode" placeholder="" clearable />
</el-form-item>
<el-form-item label="仓库">
<el-select v-model="queryParams.params.warehouseName" placeholder="请选择" @change='selectWarehouseName'>
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="库位">
<el-select v-model="queryParams.params.warehouseRackCode" placeholder="请选择"
@change='selectWarehouseAreaCode'>
<el-option v-for="(item,i) in warehouseRackList" :key="i" :label="item.areaCode" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="供应商">
<el-select v-model="queryParams.params.billObjName" placeholder="请选择" @change='supplierNameSelect'>
<el-option v-for="(item,i) in supplierList" :key="i" :label="item.supplierName" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次号">
<el-input v-model="queryParams.params.batchNumber" placeholder="" clearable />
</el-form-item>
<el-form-item label="来源单号">
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
</el-form-item>
<el-form-item label="单据类型">
<el-select v-model="queryParams.params.billType" placeholder="请选择">
<el-option v-for="(item,i) in billTypeList" :key="i" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="业务类型">
<el-select v-model="queryParams.params.busTypeValue" placeholder="请选择">
<el-option v-for="(item,i) in busTypeList" :key="i" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发生时间">
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">商品出入库列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column fixed prop="goodsID" label="商品ID" align="center" width="120"/>
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" width="120"/>
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" width="120"/>
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="120"/>
<el-table-column prop="unit" label="单位" align="center"width="80"/>
<el-table-column prop="warehouseName" label="仓库" align="center"width="100"/>
<el-table-column prop="warehouseRackCode" label="库位" align="center" width="100"/>
<el-table-column prop="billNo" label="来源单号" align="center" width="120"/>
<el-table-column prop="billType" label="单据类型" align="center"width="120"/>
<el-table-column prop="createTime" label="发生时间" align="center" width="120"/>
<el-table-column prop="busTypeValue" label="业务类型" align="center" width="120"/>
<el-table-column prop="billObjName" label="客户/供应商" align="center" width="150"/>
<el-table-column prop="batchNumber" label="批次号" align="center" width="100"/>
<el-table-column prop="count" label="数量" align="center" width="80"/>
<el-table-column prop="currentCount" label="出入库后的库存" align="center" width="150"/>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<!-- <divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" /> -->
</div>
</template>
<script>
import req from '@/api/storage/inOutStorage.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
// import divAdd from './brandsAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
// divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'build',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
"goodsID": "",
"billNo": "",
"billType": "",
"busTypeValue": "",
"billObjName": "",
"batchNumber": "",
"goodsSpuName": "",
"goodsSkuCode": "",
"warehouseName": "",
"warehouseRackCode": "",
"createTimeStart": "",
"createTimeEnd": ""
}
},
billTypeList: [{
name: "单据类型1",
sid: "0"
},
{
name: "单据类型2",
sid: "1"
}
],
busTypeList: [{
name: "业务类型1",
sid: "1"
},
{
name: "业务类型2",
sid: "2"
}
],
warehouseList: [],
warehouseRackList: [],
supplierList: [],
sids: [],
selectionList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
this.getsupplierLust()
this.getWarehouseList()
},
methods: {
supplierNameSelect(val) {
console.log("supplierNameSelect", val);
const choose = this.supplierList.filter((item) => item.sid == val)
console.log('>>>>>>>>>supplierNameSelect', choose)
this.queryParams.params.billObjName = choose[0].supplierName
this.queryParams.params.billObjSid = choose[0].sid
},
getsupplierLust() {
var params = {
createOrgSid: ""
}
req.choiceSupplier(params).then((res) => {
if (res.success) {
this.supplierList = res.data
console.log("aaaaaa", this.supplierList);
}
})
},
getWarehouseList() {
req.getWarehouses().then((res) => {
if (res.success) {
this.warehouseList = res.data
console.log("aaaaaa", this.warehouseList);
}
})
},
getWarehouseAreaList(sid) {
var query = {
ckSid: sid
}
req.getWarehouseareas(query).then((res) => {
if (res.success) {
this.warehouseRackList = res.data
console.log("aaaaaa", this.warehouseRackList);
}
})
},
selectWarehouseName(val) {
console.log("selectWarehouseName", val);
const choose = this.warehouseList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseName', choose)
this.queryParams.params.warehouseName = choose[0].warehouseName
this.queryParams.params.warehouseSid = choose[0].sid
this.getWarehouseAreaList(choose[0].sid)
},
selectWarehouseAreaCode(val) {
console.log("selectWarehouseAreaCode", val);
const choose = this.warehouseRackList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseAreaCode', choose)
this.queryParams.params.warehouseRackName = choose[0].areaCode
this.queryParams.params.warehouseRackSid = choose[0].sid
},
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'build':
// this.toBuild()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
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: {
"goodsID": "",
"billNo": "",
"billType": "",
"busTypeValue": "",
"billObjName": "",
"batchNumber": "",
"goodsSpuName": "",
"goodsSkuCode": "",
"warehouseName": "",
"warehouseRackCode": "",
"createTimeStart": "",
"createTimeEnd": ""
}
}
this.loadList()
},
toBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel(this.queryParams.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '出入库明细_' + this.queryParams.params.createDateStart + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
resetState() {
this.viewState = 1
},
}
}
</script>
<style scoped>
</style>

1143
yxt-as-ui/src/views/storage/inStorage/inStorageAdd.vue

File diff suppressed because it is too large

308
yxt-as-ui/src/views/storage/inStorage/inStorageInfo.vue

@ -0,0 +1,308 @@
<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" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>基础信息</div>
</div>
<el-row class="first_row">
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据编号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billNo}}</span>
<!-- <el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%" clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">制单人姓名</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.createByName}}</span>
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
clearable /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">外部单号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.sourceBillNo}}</span>
<!-- <el-form-item class="trightb_item">
<el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
@change="orderTypeSelect">
<el-option v-for="item in orderTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.createTime}}</span>
<!-- <el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
@change="businessTypeSelect">
<el-option v-for="item in businessTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">业务类型</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.busTypeValue}}</span>
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">供应商</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.supplierName}}</span>
<!-- <el-date-picker v-model="formobj.dateEnd" type="date" style="width:100%" value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">到货日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.deliveryDate}}</span>
<!-- <el-date-picker v-model="formobj.deliveryDate" type="date" style="width:100%" value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据状态</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billState}}</span>
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.remarks}}</span>
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
</el-form-item>
</el-col>
</el-row>
<div class="title"
style="display: flex;align-items: center;justify-content: space-between;height:40px;margin-top: 10px;">
<div>商品列表</div>
</div>
<el-table v-loading="listLoading" :data="formobj.list" border style="width: 100%;"
:row-style="{height: '40px'}">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" width="150" />
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
<el-table-column label="单位" prop="unit" align="center" width="120" />
<el-table-column label="仓库" prop="warehouseName" align="center" width="180" />
<el-table-column label="库位" prop="warehouseRackName" align="center" width="180" />
<el-table-column label="预约数量" prop="orderCount" align="center" width="120" />
<el-table-column label="实收数量" prop="actualInCount" align="center" width="120" />
<el-table-column label="拒收数量" prop="rejectCount" align="center" width="120" />
<el-table-column label="拒收原因" prop="rejectReason" align="center" width="180" />
<el-table-column label="是否质检" align="center" width="180">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.isQuality" :disabled="true" size="small">
<el-radio :label="0">需要</el-radio>
<el-radio :label="1">不需要</el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column label="质检状态" align="center" width="180">
<template slot-scope="scope">
<el-radio-group v-model="scope.row.qualityState" :disabled="true" size="small">
<el-radio :label="0">合格</el-radio>
<el-radio :label="1">不合格</el-radio>
</el-radio-group>
</template>
</el-table-column>
<el-table-column label="载具说明" prop="packageRemark" align="center" width="180" />
<el-table-column label="入库价" prop="cost" align="center" width="100" />
<el-table-column label="税额" prop="taxAmount" align="center" width="100" />
<el-table-column label="含税单价" prop="taxPrice" align="center" width="100" />
<el-table-column label="入库金额" prop="amount" align="center" width="100" />
</el-table>
<div class="title"
style="display: flex;align-items: center;justify-content: space-between;height:40px;margin-top: 10px;">
<div>商品-批次</div>
</div>
<el-table v-loading="listLoading" :data="formobj.pcList" border style="width: 100%;"
:row-style="{height: '40px'}">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="商品列表序号" prop="xh" align="center" width="120" />
<el-table-column label="商品名称" prop="goodsSkuTitle" align="center" width="200" />
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" width="150" />
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" width="150" />
<el-table-column label="单位" prop="unit" align="center" width="120" />
<el-table-column label="仓库" prop="warehouseName" align="center" width="150" />
<el-table-column label="库位" prop="warehouseRackName" align="center" width="150" />
<el-table-column label="批次号" prop="batchNumber" align="center" width="300" />
<el-table-column label="生产日期" prop="manufactureDate" align="center" width="180" />
<el-table-column label="有效期" prop="expirationDate" align="center" width="180" />
<el-table-column label="数量" prop="batchCount" align="center" width="120" />
</el-table>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/storage/inStorage.js'
export default {
components: {},
data() {
return {
listLoading: false,
submitdisabled: false,
formobj: {},
}
},
methods: {
indexMethod(index) {
return index + 1
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
var params = {
sid: row.sid
}
req.init(params)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = {}
})
}
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
height: 30px;
line-height: 30px;
margin-left: 50px;
font-size: 15px;
font-weight: 400;
border: 1px #fff solid;
padding: 0px 10px;
border-radius: 5px;
}
::v-deep .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
</style>

241
yxt-as-ui/src/views/storage/inStorage/index.vue

@ -0,0 +1,241 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="入库列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="商品名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">入库列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <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 prop="billNo" label="单据编号" align="center" />
<el-table-column prop="billType" label="单据类型" align="center" />
<el-table-column prop="createDate" label="单据日期" align="center" />
<el-table-column prop="createByName" label="制单人姓名" align="center" />
<el-table-column prop="busTypeValue" label="业务类型" align="center" />
<el-table-column prop="warehouseManager" label="库管操作人" align="center" />
<el-table-column prop="outTime" label="实际入库时间" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
<divInfo v-show="viewState==4" ref="divInfo" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/storage/inStorage.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './inStorageAdd.vue'
import divInfo from './inStorageInfo.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped>
</style>

291
yxt-as-ui/src/views/storage/outStorage/distributionAdd.vue

@ -0,0 +1,291 @@
<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" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>基础信息</div>
</div>
<el-row class="first_row">
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据编号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billNo}}</span>
<!-- <el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%" clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">制单人姓名</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.createByName}}</span>
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
clearable /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">外部单号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.sourceBillNo}}</span>
<!-- <el-form-item class="trightb_item">
<el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
@change="orderTypeSelect">
<el-option v-for="item in orderTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.createTime}}</span> -->
<el-date-picker v-model="formobj.createTime" type="date" style="width:100%" value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
<!-- <el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
@change="businessTypeSelect">
<el-option v-for="item in businessTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据状态</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billState}}</span>
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.remarks}}</span> -->
<el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="1" clearable />
</el-form-item>
</el-col>
</el-row>
<div class="title"
style="display: flex;align-items: center;justify-content: space-between;height:40px;margin-top: 10px;">
<div>商品列表</div>
</div>
<el-table v-loading="listLoading" :data="formobj.detailsList" border style="width: 100%;"
:row-style="{height: '40px'}">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column fixed label="操作" width="80" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toDel(scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
<el-table-column label="单位" prop="unit" align="center" />
<el-table-column label="仓库" prop="warehouseName" align="center" />
<el-table-column label="库位" prop="warehouseRackCode" align="center" />
<el-table-column label="配货数量" align="center">
<template slot-scope="scope">
<el-input ref="focusAssumptionInput" v-model="scope.row.distributeCount" clearable placeholder=""
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/storage/outStorage.js'
export default {
components: {},
data() {
return {
listLoading: false,
submitdisabled: false,
formobj: {
"sourceBillSid": "",
"sourceBillNo": "",
"billNo": "",
"createByName": "",
"billState": "",
"createBySid": "",
"createTime": "",
"remarks": "",
"detailsList": [
]
},
}
},
methods: {
indexMethod(index) {
return index + 1
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
"sourceBillSid": "",
"sourceBillNo": "",
"billNo": "",
"createByName": "",
"billState": "",
"createBySid": "",
"createTime": "",
"remarks": "",
"detailsList": [
]
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
var params = {
sid: row.sid
}
req.initDistribution(params)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = {}
})
},
toDel(index) {
const tip = '请确认是否删除所选商品?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.formobj.detailsList.splice(index, 1)
}).catch(() => {})
},
saveOrUpdate(){
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.saveDistribution(this.formobj).then((res) => {
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: '保存成功'
})
this.handleReturn('true')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
height: 30px;
line-height: 30px;
margin-left: 50px;
font-size: 15px;
font-weight: 400;
border: 1px #fff solid;
padding: 0px 10px;
border-radius: 5px;
}
::v-deep .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
</style>

335
yxt-as-ui/src/views/storage/outStorage/index.vue

@ -0,0 +1,335 @@
<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.billNo" placeholder="" clearable />
</el-form-item>
<el-form-item label="单据日期">
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="外部单号">
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
</el-form-item>
<el-form-item label="业务类型">
<el-select v-model="queryParams.params.busTypeValue" placeholder="请选择">
<el-option v-for="(item,i) in busTypeList" :key="i" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="单据状态">
<el-select v-model="queryParams.params.billState" placeholder="请选择">
<el-option v-for="(item,i) in billStateList" :key="i" :label="item.name" :value="item.sid">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">出库单列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column fixed label="操作" width="100" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column prop="billNo" label="单据编号" align="center" />
<el-table-column prop="createTime" label="单据日期" align="center" />
<el-table-column prop="createByName" label="制单人" align="center" />
<el-table-column prop="sourceBillNo" label="外部单号" align="center" />
<el-table-column prop="busTypeValue" label="业务类型" align="center" />
<el-table-column prop="billState" label="单据状态" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
<divInfo v-show="viewState==4" ref="divInfo" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/storage/outStorage.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './outStorageAdd.vue'
import divInfo from './outStorageInfo.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd,
divInfo,
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'danger',
size: 'small',
icon: 'del',
btnKey: 'doDel',
btnLabel: '删除'
},
{
type: 'primary',
size: 'small',
icon: 'edit',
btnKey: 'toEdit',
btnLabel: '编辑'
},
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
"billNo": "",
"sourceBillNo": "",
"busTypeValue": "",
"billState": "",
"createTimeStart": "",
"createTimeEnd": ""
}
},
billStateList: [{
name: "新建",
sid: "0"
},
{
name: "完成",
sid: "1"
}
],
busTypeList: [{
name: "业务类型1",
sid: "0"
},
{
name: "业务类型2",
sid: "1"
}
],
sids: [],
selectionList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'doDel':
this.doDel()
break
case 'toAdd':
this.toAdd()
break
case 'toEdit':
this.toEdit()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
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: '请至少选择一条记录进行删除操作'
})
}
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toEdit() {
if (this.selectionList.length != 1) {
this.$message({
type: 'warning',
message: "请选择一条数据。",
showClose: true
})
return
}
this.viewState = 3
this.$refs['divadd'].showEdit(this.selectionList[0])
// this.viewState = 5
// this.$refs['distributionAdd'].showEdit(this.selectionList[0])
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toInfo(row) {
this.viewState = 4
this.$refs['divInfo'].showEdit(row)
},
resetState() {
this.viewState = 1
},
}
}
</script>
<style scoped>
</style>

529
yxt-as-ui/src/views/storage/outStorage/outStorageAdd.vue

@ -0,0 +1,529 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>{{title}}出库单</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit">确认</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" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>基础信息</div>
</div>
<el-row class="first_row">
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据编号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billNo}}</span>
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">制单人姓名</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<el-input v-model="formobj.createByName" placeholder="" class="addinputw" style="width:100%" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">外部单号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.sourceBillNo}}</span>
<!-- <el-form-item class="trightb_item">
<el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
@change="orderTypeSelect">
<el-option v-for="item in orderTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.createTime}}</span> -->
<el-date-picker v-model="formobj.createTime" type="date" style="width:100%" value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">业务类型</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.busTypeValue}}</span> -->
<el-select v-model="formobj.busTypeValue" filterable clearable placeholder="请选择" style="width:100%"
@change="busTypeSelect">
<el-option v-for="item in busTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select>
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据状态</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billState}}</span>
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item class="trightb_item">
<!-- <span slot="label">{{formobj.supplierName}}</span> -->
<el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable />
</el-form-item>
</el-col>
</el-row>
<div class="title"
style="display: flex;align-items: center;justify-content: space-between;height:40px;margin-top: 10px;">
<div>商品列表</div>
</div>
<el-table v-loading="listLoading" :data="formobj.detailsList" border style="width: 100%;"
:row-style="{height: '40px'}">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column align="center" width="100" :render-header="commodityHeader">
<template slot-scope="scope">
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i>
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" min-width="120">
<template slot-scope="scope">
<el-popover placement="right" width="900" trigger="click">
<div>
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row
@current-change="commodityCurrentChange($event, scope.row)">
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" />
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
<el-table-column prop="unit" label="单位" align="center" />
</el-table>
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size"
layout="total, pager" :total="commodityQuery.total" />
</div>
<el-input slot="reference" v-model="scope.row.goodsSpuName"
@input="commodityInput(scope.row.goodsSpuName)" clearable placeholder="商品名称" />
</el-popover>
</template>
</el-table-column>
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
<el-table-column label="单位" prop="unit" align="center" />
<el-table-column label="仓库" prop="warehouseName" align="center" />
<el-table-column label="库位" prop="warehouseRackCode" align="center" />
<el-table-column label="销售单价" prop="money" align="center" />
<el-table-column label="出库数量" align="center">
<template slot-scope="scope">
<el-input ref="focusAssumptionInput" v-model="scope.row.outCount"
@input="commodityComputeYHAndXSJE(scope.row,$event)" clearable placeholder=""
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
</template>
</el-table-column>
<el-table-column label="金额" prop="moneyAll" align="center" />
</el-table>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/storage/outStorage.js'
export default {
components: {},
data() {
return {
title: '【新增】',
listLoading: false,
submitdisabled: false,
formobj: {
"sourceBillNo": "",
"createByName": "",
"busTypeKey": "",
"busTypeValue": "",
"billState": '新建',
"createOrgSid": "",
"useOrgSid": "",
"sid": "",
"createBySid": "",
"createTime": "",
"remarks": "",
"detailsList": [
]
},
hideUploadBtn: false,
busTypeList: [{
name: "业务类型1",
sid: "0"
},
{
name: "业务类型2",
sid: "1"
}
],
// commodity
commodityKey: 1,
commodityLoading: false,
commodityQuery: {
current: 1,
size: 2,
total: 0,
params: {
name: '',
inOrg: "",
outOrg: ""
}
},
commodityData: [],
isUpdata: false
}
},
created() {},
methods: {
commodityInput(value) {
this.commodityQuery.params.name = value
this.commodityLoading = true
req.getGoodsListPage(this.commodityQuery).then((response) => {
if (response.success) {
this.commodityLoading = false
this.commodityData = response.data.records
this.commodityQuery.total = response.data.total
} else {
this.serviceLoading = false
this.commodityData = []
this.commodityQuery.total = 0
}
})
},
commodityDelete(index) {
this.formobj.detailsList.splice(index, 1)
},
commodityCurrentChange(value, row) {
console.log("commodityCurrentChange》》》》", value)
console.log("commodityCurrentChange》》》》", row)
row.inventorySid = value.inventorySid
row.goodSpuSid = value.goodSpuSid
row.goodsSkuSid = value.goodsSkuSid
row.goodsSkuTitle = value.goodsSkuTitle
row.goodsSpuName = value.goodsSpuName
row.goodsSkuCode = value.goodsSkuCode
row.goodsSkuOwnSpec = value.goodsSkuOwnSpec
row.unit = value.unit
row.warehouseSid = value.warehouseSid
row.warehouseName = value.warehouseName
row.warehouseRackSid = value.warehouseRackSid
row.warehouseRackCode = value.warehouseRackCode
row.money = value.money
row.moneyAll = 0
row.outCount = 0
document.body.click()
},
//
commodityHeader(h, {
column
}) {
return h(
'div',
[
h('span', column.label),
h('i', {
class: 'add-btn-icon el-icon-plus',
style: 'color: red;font-size:20px',
on: {
click: this.commodityAdd //
}
})
]
)
},
commodityAdd() {
this.formobj.detailsList.push({
"inventorySid": "",
"goodSpuSid": "",
"goodsSpuName": "",
"goodsSkuSid": "",
"goodsSkuTitle": "",
"goodsSkuCode": "",
"goodsSkuOwnSpec": "",
"unit": "",
"warehouseSid": "",
"warehouseName": "",
"warehouseRackSid": "",
"warehouseRackCode": "",
"money": 0,
"moneyAll": 0,
"outCount": 0
})
},
indexMethod(index) {
return Number(index) + 1
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.save(this.formobj).then((res) => {
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: '保存成功'
})
this.handleReturn('true')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false
})
}
})
},
submit() {
if (this.formobj.createByName == '') {
this.$message({
showClose: true,
type: 'warning',
message: '制单人不能为空'
})
return
}
if (this.formobj.createTime == '') {
this.$message({
showClose: true,
type: 'warning',
message: '单据日期不能为空'
})
return
}
if (this.formobj.busTypeKey == '' || this.formobj.busTypeValue == '') {
this.$message({
showClose: true,
type: 'warning',
message: '单据类型不能为空'
})
return
}
if (this.formobj.detailsList.length == 0) {
this.$message({
showClose: true,
type: 'warning',
message: '商品列表不能为空'
})
return
}
for (var i = 0; i < this.formobj.detailsList.length; i++) {
var item = this.formobj.detailsList[i]
if (item.goodSpuSid == '' || item.goodsSpuName == '') {
this.$message({
showClose: true,
type: 'warning',
message: '商品名称不能为空'
})
return
}
if (item.goodsSkuCode == '') {
this.$message({
showClose: true,
type: 'warning',
message: '商品编码不能为空'
})
return
}
if (item.outCount == 0) {
this.$message({
showClose: true,
type: 'warning',
message: '出库数量不能为0'
})
return
}
}
this.$refs['form_obj'].validate((valid) => {
if (valid) {
this.submitdisabled = true
req.submit(this.formobj).then((res) => {
if (res.success) {
this.$message({
showClose: true,
type: 'success',
message: '保存成功'
})
this.handleReturn('true')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false
})
}
})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
"sourceBillNo": "",
"createByName": "",
"busTypeKey": "",
"busTypeValue": "",
"billState": '新建',
"createOrgSid": "",
"useOrgSid": "",
"sid": "",
"createBySid": "",
"createTime": "",
"remarks": "",
"detailsList": [
]
}
this.submitdisabled = false
this.isUpdata = false
this.$emit('doback')
},
showAdd() {
this.title = "【新增】"
this.isUpdata = false
},
showEdit(row) {
this.title = "【修改】"
this.isUpdata = true
var params = {
sid: row.sid
}
req.init(params)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = {}
})
},
busTypeSelect(val) {
const choose = this.busTypeList.filter((item) => item.sid == val)
console.log('>>>>>>>>>busTypeSelect', choose)
this.formobj.busTypeKey = choose[0].sid
this.formobj.busTypeValue = choose[0].name
},
commodityComputeYHAndXSJE(row, val) {
console.log("aaa", row);
console.log("aaa", val);
row.moneyAll = (Number(row.money) * Number(row.outCount)).toFixed(2)
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
height: 30px;
line-height: 30px;
margin-left: 50px;
font-size: 15px;
font-weight: 400;
border: 1px #fff solid;
padding: 0px 10px;
border-radius: 5px;
}
::v-deep .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
</style>

231
yxt-as-ui/src/views/storage/outStorage/outStorageInfo.vue

@ -0,0 +1,231 @@
<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" label-position="top" label-width="190px" class="formadd">
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
<div>基础信息</div>
</div>
<el-row class="first_row">
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据编号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billNo}}</span>
<!-- <el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%" clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">制单人姓名</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.createByName}}</span>
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
clearable /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">外部单号</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.sourceBillNo}}</span>
<!-- <el-form-item class="trightb_item">
<el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
@change="orderTypeSelect">
<el-option v-for="item in orderTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据日期</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.createTime}}</span>
<!-- <el-select v-model="GiftBagGood.goodsSkuSid" filterable clearable placeholder="请选择" style="width:100%"
@change="businessTypeSelect">
<el-option v-for="item in businessTypeList" :key="item.sid" :label="item.name" :value="item.sid">
</el-option>
</el-select> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">业务类型</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.busTypeValue}}</span>
<!-- <el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw" style="width:100%"
clearable /> -->
</el-form-item>
</el-col>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">单据状态</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.billState}}</span>
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="trightb">
<el-form-item class="trightb_item">
<span slot="label">备注</span>
</el-form-item>
</el-col>
<el-col :span="20">
<el-form-item class="trightb_item">
<span slot="label">{{formobj.remarks}}</span>
<!-- <el-input v-model="formobj.remarks" placeholder="" class="addinputw"
style="width: 100%; padding-bottom: 5px;" type="textarea" :rows="4" clearable /> -->
</el-form-item>
</el-col>
</el-row>
<div class="title"
style="display: flex;align-items: center;justify-content: space-between;height:40px;margin-top: 10px;">
<div>商品列表</div>
</div>
<el-table v-loading="listLoading" :data="formobj.detailsList" border style="width: 100%;"
:row-style="{height: '40px'}">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="商品名称" prop="goodsSpuName" align="center" />
<el-table-column label="商品编码" prop="goodsSkuCode" align="center" />
<el-table-column label="规格" prop="goodsSkuOwnSpec" align="center" />
<el-table-column label="单位" prop="unit" align="center" />
<el-table-column label="出库数量" prop="outCount" align="center" />
</el-table>
</el-form>
</div>
</div>
</template>
<script>
import req from '@/api/storage/outStorage.js'
export default {
components: {},
data() {
return {
listLoading: false,
submitdisabled: false,
formobj: {},
}
},
methods: {
indexMethod(index) {
return index + 1
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
var params = {
sid: row.sid
}
req.init(params)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = {}
})
}
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.trightb {
display: flex;
align-items: center;
text-align: center;
justify-content: center;
}
.trightb_item {
padding-top: 5px;
}
.span {
height: 30px;
line-height: 30px;
margin-left: 50px;
font-size: 15px;
font-weight: 400;
border: 1px #fff solid;
padding: 0px 10px;
border-radius: 5px;
}
::v-deep .el-collapse-item__header {
height: 40px;
padding: 10px;
font-weight: bold;
font-size: 20px;
text-align: left;
color: #ffffff;
background-color: #0294d7;
}
::v-deep .el-collapse-item__content {
padding-bottom: 0;
}
</style>

223
yxt-as-ui/src/views/warehouse/goodsShelves/goodsShelvesAdd.vue

@ -0,0 +1,223 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>库位信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">选择所属仓库</span>
<el-select v-model="formobj.warehouseName" placeholder="请选择所属仓库" class="item_input"
@change="selectWarehouseChange">
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">选择所属库区</span>
<el-select v-model="formobj.locationName" placeholder="请选择所属库区" class="item_input"
@change="selectWarehouseAreaChange">
<el-option v-for="item in warehouseAreaList" :key="item.sid" :label="item.areaName" :value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">库位名称</span>
<el-input v-model="formobj.rackName" placeholder="库位名称" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">库位编码</span>
<el-input v-model="formobj.rackCode" placeholder="库位编码" class="item_input" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
</div>
<div class="item">
<span class="item_text">库位备注</span>
<el-input v-model="formobj.remarks" placeholder="库位备注" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/warehouse/goodsShelves.js'
import req2 from '@/api/warehouse/warehouse.js'
import req3 from '@/api/warehouse/warehouseArea.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
rackName: '',
rackCode: '',
warehouseName: '',
warehouseSid: '',
locationName: '',
locationSid: '',
remarks: '',
},
warehouseList: [],
warehouseAreaList: [],
}
},
created() {
this.initData()
},
methods: {
initData() {
req2.getAllWarehouse().then(resp => {
this.warehouseList = resp.data
})
req3.getAllWarehousearea().then(resp => {
this.warehouseAreaList = resp.data
})
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveGoodsShelves(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
rackName: '',
rackCode: '',
warehouseName: '',
warehouseSid: '',
locationName: '',
locationSid: '',
remarks: '',
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.initGoodsShelves(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
selectWarehouseChange(val) {
const choose = this.warehouseList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseChange', choose)
this.formobj.warehouseSid = choose[0].sid
this.formobj.warehouseName = choose[0].warehouseName
},
selectWarehouseAreaChange(val) {
const choose = this.warehouseAreaList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseAreaChange', choose)
this.formobj.locationSid = choose[0].sid
this.formobj.locationName = choose[0].areaName
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

262
yxt-as-ui/src/views/warehouse/goodsShelves/index.vue

@ -0,0 +1,262 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="库位列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="库位名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="dosearch"
>查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">库位列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="rackName" label="库位名称" align="center" />
<el-table-column prop="rackCode" label="库位编码" align="center" />
<el-table-column prop="warehouseName" label="所属仓库" align="center" />
<el-table-column prop="locationName" label="所属库区" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/warehouse/goodsShelves.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './goodsShelvesAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
}
}
</script>
<style scoped>
</style>

265
yxt-as-ui/src/views/warehouse/warehouse/index.vue

@ -0,0 +1,265 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="仓库列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="仓库名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="dosearch"
>查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">仓库列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="warehouseName" label="仓库名称" align="center" />
<el-table-column prop="warehouseCode" label="仓库编码" align="center" />
<el-table-column prop="manager" label="仓库主管" align="center" />
<el-table-column prop="telephone" label="联系电话" align="center" />
<el-table-column prop="squareMeter" label="占地面积" align="center" />
<el-table-column prop="address" label="仓库地址" align="center" />
<el-table-column prop="sortNo" label="排序" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/warehouse/warehouse.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './warehouseAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
}
}
</script>
<style scoped>
</style>

240
yxt-as-ui/src/views/warehouse/warehouse/warehouseAdd.vue

@ -0,0 +1,240 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>仓库信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">仓库名称</span>
<el-input v-model="formobj.warehouseName" placeholder="仓库名称" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">仓库编码</span>
<el-input v-model="formobj.warehouseCode" placeholder="仓库编码" class="item_input" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
</div>
<div class="item">
<span class="item_text">仓库联系人</span>
<el-input v-model="formobj.contacts" placeholder="仓库联系人" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">手机号码</span>
<el-input v-model="formobj.mob" placeholder="手机号码" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">仓库主管</span>
<el-input v-model="formobj.manager" placeholder="仓库主管" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">联系电话</span>
<el-input v-model="formobj.telephone" placeholder="联系电话" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">占地面积</span>
<el-input v-model="formobj.squareMeter" placeholder="占地面积" class="item_input" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
</div>
<div class="item">
<span class="item_text">仓库经度</span>
<el-input v-model="formobj.longitude" placeholder="仓库经度" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">仓库纬度</span>
<el-input v-model="formobj.latitude" placeholder="仓库纬度" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">具体地址</span>
<el-input v-model="formobj.address" placeholder="具体地址" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">使用状态</span>
<el-radio-group v-model="formobj.usageStatus" size="small" @change="changeTheme" class="item_input">
<el-radio :label="1">正常</el-radio>
<el-radio :label="0">停用</el-radio>
</el-radio-group>
<!-- <el-input v-model="formobj.usageStatus" placeholder="仓库排序" class="item_input" clearable /> -->
</div>
<div class="item">
<span class="item_text">仓库排序</span>
<el-input v-model="formobj.sortNo" placeholder="仓库排序" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">仓库备注</span>
<el-input v-model="formobj.remarks" placeholder="具体地址" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/warehouse/warehouse.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
warehouseName: '',
warehouseCode: '',
contacts: "",
mob: "",
telephone: "",
manager: '',
longitude: '',
latitude: '',
usageStatus: "",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0"
},
}
},
created() {},
methods: {
changeTheme(val) {
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveWarehouse(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
warehouseName: '',
warehouseCode: '',
contacts: "",
mob: "",
telephone: "",
manager: '',
longitude: '',
latitude: '',
usageStatus: "",
address: '',
squareMeter: '',
sortNo: '',
remarks: '',
warehouseType: "0"
}
this.$emit('doback')
},
showAdd() {},
showEdit(row) {
req.initWarehouse(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

264
yxt-as-ui/src/views/warehouse/warehouseArea/index.vue

@ -0,0 +1,264 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="库区列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="库区名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="dosearch"
>查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">库区列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="areaName" label="库区名称" align="center" />
<el-table-column prop="areaCode" label="库区编码" align="center" />
<el-table-column prop="volume" label="库区容量" align="center" />
<el-table-column prop="unit" label="计量单位" align="center" />
<el-table-column prop="areaTypeName" label="库区类型" align="center" />
<el-table-column prop="warehouseName" label="所属仓库" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/warehouse/warehouseArea.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './warehouseAreaAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
}
}
</script>
<style scoped>
</style>

234
yxt-as-ui/src/views/warehouse/warehouseArea/warehouseAreaAdd.vue

@ -0,0 +1,234 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>库区信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">选择所属仓库</span>
<el-select v-model="formobj.warehouseName" placeholder="请选择所属仓库" class="item_input"
@change="selectWarehouseChange">
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">库区名称</span>
<el-input v-model="formobj.areaName" placeholder="库区名称" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">库区编码</span>
<el-input v-model="formobj.areaCode" placeholder="库区编码" class="item_input" clearable
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
</div>
<div class="item">
<span class="item_text">库区容量</span>
<el-input v-model="formobj.volume" placeholder="库区容量" class="item_input" clearable
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
</div>
<div class="item">
<span class="item_text">计量单位</span>
<el-input v-model="formobj.unit" placeholder="计量单位" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">库区类型</span>
<el-select v-model="formobj.areaTypeName" placeholder="请选择库区类型" class="item_input"
@change="selectWarehouseTypeValueChange">
<el-option v-for="item in warehouseTypeList" :key="item.sid" :label="item.warehouseAreaTypeName"
:value="item.sid" />
</el-select>
</div>
<div class="item">
<span class="item_text">库区备注</span>
<el-input v-model="formobj.remarks" placeholder="库区备注" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/warehouse/warehouseArea.js'
import req2 from '@/api/warehouse/warehouse.js'
import req3 from '@/api/warehouse/warehouseAreaType.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
areaName: '',
areaCode: '',
volume: '',
unit: '',
remarks: '',
warehouseName: '',
warehouseSid: '',
areaTypeSid: "",
areaTypeName: ""
},
warehouseList: [],
warehouseTypeList: [],
}
},
created() {
this.initData()
},
methods: {
initData() {
req2.getAllWarehouse().then(resp => {
this.warehouseList = resp.data
})
req3.getAllWarehouseareatype().then(resp => {
this.warehouseTypeList = resp.data
})
},
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveWarehousearea(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
areaName: '',
areaCode: '',
volume: '',
unit: '',
remarks: '',
areaTypeSid: "",
areaTypeName: ""
}
this.$emit('doback')
},
showAdd() {},
showEdit(row) {
req.initWarehousearea(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
selectWarehouseChange(val) {
const choose = this.warehouseList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseChange', choose)
this.formobj.warehouseSid = choose[0].sid
this.formobj.warehouseName = choose[0].warehouseName
},
selectWarehouseTypeValueChange(val) {
const choose = this.warehouseTypeList.filter((item) => item.sid == val)
console.log('>>>>>>>>>selectWarehouseTypeValueChange', choose)
this.formobj.areaTypeSid = choose[0].sid
this.formobj.areaTypeName = choose[0].warehouseAreaTypeName
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

261
yxt-as-ui/src/views/warehouse/warehouseAreaType/index.vue

@ -0,0 +1,261 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="库区类型列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="库区类型名称">
<el-input v-model="queryParams.params.name" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="dosearch"
>查询</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">库区类型列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" width="140">
<template slot-scope="scope">
<el-switch v-model="scope.row.isEnable" active-text="" inactive-text="" active-value="1"
inactive-value="2" @change="enableChange(scope.row.sid,scope.row.isEnable)" />
</template>
</el-table-column>
<el-table-column prop="warehouseAreaTypeName" label="库区类型名称" align="center" />
<el-table-column prop="createTime" label="创建时间" align="center" />
<el-table-column prop="remarks" label="库区类型备注" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/warehouse/warehouseAreaType.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './warehouseAreaTypeAdd.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选品牌?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.deleteGoods(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
},
enableChange(sid, state) {
console.log('sid', sid)
console.log('state', state)
req.updateIsEnable(sid, state).then((resp) => {
if (resp.success) {
this.$message({
type: 'success',
message: '状态已更新',
showClose: true
})
} else { // resp.code
}
}).catch(e => {
console.log(e)
})
},
}
}
</script>
<style scoped>
</style>

163
yxt-as-ui/src/views/warehouse/warehouseAreaType/warehouseAreaTypeAdd.vue

@ -0,0 +1,163 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>库区类型信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div class="listconadd">
<el-card class="box-card">
<div class="item">
<span class="item_text">库区类型名称</span>
<el-input v-model="formobj.warehouseAreaTypeName" placeholder="库区类型名称" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">库区类型备注</span>
<el-input v-model="formobj.remarks" placeholder="库区类型备注" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/warehouse/warehouseAreaType.js'
export default {
components: {},
data() {
return {
submitdisabled: false,
formobj: {
sid: '',
warehouseAreaTypeName: '',
remarks: '',
},
}
},
created() {},
methods: {
saveOrUpdate() {
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
req.saveWarehousearea(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn('true')
} else {
// resp.code
}
})
.catch(() => {})
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: '',
remarks: '',
}
this.$emit('doback')
},
showAdd() {},
showEdit(row) {
req.initWarehousearea(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
},
}
}
</script>
<style lang="scss" scoped>
//
::v-deep .hide {
.el-upload--picture-card {
display: none !important;
}
}
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

2
yxt-base-biz/src/main/java/com/yxt/base/apiadmin/base/BaseSupplierInfoRest.java

@ -51,7 +51,7 @@ import java.util.List;
*/
@Api(tags = "供应商信息")
@RestController
@RequestMapping("/apiadmin/base/basesupplierinfo")
@RequestMapping("v1/basesupplierinfo")
public class BaseSupplierInfoRest {
@Autowired

4
yxt-base-biz/src/main/java/com/yxt/base/biz/base/basesupplierinfo/BaseSupplierInfo.java

@ -31,6 +31,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* Project: yxt-base(供应商管理) <br/>
* File: BaseSupplierInfo.java <br/>
@ -102,6 +104,8 @@ public class BaseSupplierInfo extends BaseEntity {
private String billingTypeKey; // 开票类型key
@ApiModelProperty("开票类型value")
private String billingTypeValue; // 开票类型value
@ApiModelProperty("税率")
private BigDecimal taxRate;
@ApiModelProperty("使用组织sid")
private String useOrgSid; // 使用组织sid
@ApiModelProperty("创建组织名称")

3
yxt-base-biz/src/main/java/com/yxt/base/biz/base/basesupplierinfo/BaseSupplierInfoDetailsVo.java

@ -33,6 +33,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
@ -106,6 +107,8 @@ public class BaseSupplierInfoDetailsVo implements Vo {
private String billingTypeKey; // 开票类型key
@ApiModelProperty("开票类型value")
private String billingTypeValue; // 开票类型value
@ApiModelProperty("税率")
private BigDecimal taxRate;
@ApiModelProperty("使用组织sid")
private String useOrgSid; // 使用组织sid
@ApiModelProperty("创建组织名称")

3
yxt-base-biz/src/main/java/com/yxt/base/biz/base/basesupplierinfo/BaseSupplierInfoDto.java

@ -33,6 +33,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
@ -106,6 +107,8 @@ public class BaseSupplierInfoDto implements Dto {
private String billingTypeKey; // 开票类型key
@ApiModelProperty("开票类型value")
private String billingTypeValue; // 开票类型value
@ApiModelProperty("税率")
private BigDecimal taxRate;
@ApiModelProperty("使用组织sid")
private String useOrgSid; // 使用组织sid
@ApiModelProperty("创建组织名称")

10
yxt-pms-biz/src/main/java/com/yxt/pms/apiadmin/pms/PmsSupplierTypeRest.java

@ -34,6 +34,8 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Project: yxt-base(仓储基础信息供应商) <br/>
* File: BaseSupplierTypeFeignFallback.java <br/>
@ -78,4 +80,12 @@ public class PmsSupplierTypeRest {
baseSupplierTypeService.del(sids);
return rb.success();
}
@ApiOperation("获取供应商类型")
@PostMapping("/selSupplierType")
public ResultBean<List<PmsSupplierTypeDown>> selSupplierType(@RequestParam("orgPath") String orgPath){
ResultBean rb = ResultBean.fireFail();
List<PmsSupplierTypeDown> pmsSupplierTypeDowns = baseSupplierTypeService.selSupplierType(orgPath);
return rb.success().setData(pmsSupplierTypeDowns);
}
}

3
yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssupplierinfo/PmsSupplierInfoDto.java

@ -33,6 +33,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
@ -115,5 +116,5 @@ public class PmsSupplierInfoDto implements Dto {
@ApiModelProperty("创建组织sid")
private String createOrgSid; // 创建组织sid
@ApiModelProperty("开户行信息")
private List<PmsSupplierBankDto> pmsSupplierBankList;
private List<PmsSupplierBankDto> pmsSupplierBankList = new ArrayList<>();
}

68
yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssupplierinfo/PmsSupplierInfoService.java

@ -37,10 +37,14 @@ import com.yxt.pms.biz.pms.pmssupplierBank.PmsSupplierBankService;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.pms.feign.yxtbase.supplier.BaseSupplierBankDto;
import com.yxt.pms.feign.yxtbase.supplier.BaseSupplierInfoDto;
import com.yxt.pms.feign.yxtbase.supplier.BaseSupplierInfoFeign;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -61,6 +65,8 @@ public class PmsSupplierInfoService extends MybatisBaseService<PmsSupplierInfoMa
@Autowired
private PmsSupplierBankService pmsSupplierBankService;
@Autowired
private BaseSupplierInfoFeign baseSupplierInfoFeign;
public PagerVo<PmsSupplierInfoVo> listPageVo(PagerQuery<PmsSupplierInfoQuery> pq) {
PmsSupplierInfoQuery query = pq.getParams();
@ -89,54 +95,28 @@ public class PmsSupplierInfoService extends MybatisBaseService<PmsSupplierInfoMa
public ResultBean saveOrUpdateDto(PmsSupplierInfoDto dto){
ResultBean rb = ResultBean.fireFail();
String dtoSid = dto.getSid();
List<PmsSupplierBankDto> pmsSupplierBankDtoList = dto.getPmsSupplierBankList();
if (pmsSupplierBankDtoList == null || pmsSupplierBankDtoList.size() == 0){
return rb.setMsg("开户行信息不能为空");
}
if (StringUtils.isBlank(dtoSid)) {
String sid = this.insertByDto(dto);
for (PmsSupplierBankDto pmsSupplierBankDto : pmsSupplierBankDtoList) {
pmsSupplierBankDto.setSupplierSid(sid);
pmsSupplierBankService.saveOrUpdateDto(pmsSupplierBankDto);
}
return rb.success();
}
this.updateByDto(dto);
for (PmsSupplierBankDto pmsSupplierBankDto : pmsSupplierBankDtoList) {
String bankSid = pmsSupplierBankDto.getSid();
if(StringUtils.isNotBlank(bankSid)){
PmsSupplierBank pmsSupplierBank = pmsSupplierBankService.fetchBySid(bankSid);
BeanUtil.copyProperties(pmsSupplierBankDto,pmsSupplierBank,"sid");
pmsSupplierBank.setSupplierSid(dtoSid);
pmsSupplierBankService.updateById(pmsSupplierBank);
}else{
PmsSupplierBank pmsSupplierBank = new PmsSupplierBank();
BeanUtil.copyProperties(pmsSupplierBankDto,pmsSupplierBank,"sid");
pmsSupplierBank.setSupplierSid(dtoSid);
pmsSupplierBankService.insert(pmsSupplierBank);
}
//获取pms下供应商开户行信息
List<PmsSupplierBankDto> pmsSupplierBankList = dto.getPmsSupplierBankList();
//创建base下供应商信息对象
BaseSupplierInfoDto baseSupplierInfoDto = new BaseSupplierInfoDto();
//复制pms供应商信息到base供应商信息中
BeanUtil.copyProperties(dto,baseSupplierInfoDto);
//创建base下供应商开户行信息list对象
List<BaseSupplierBankDto> baseSupplierBankDtos = new ArrayList<>();
//循环pms下供应商开户行list对象
for (PmsSupplierBankDto pmsSupplierBankDto : pmsSupplierBankList) {
//创建base下供应商开户行信息
BaseSupplierBankDto baseSupplierBankDto = new BaseSupplierBankDto();
//复制pms供应商开户行信息到base供应商开户行信息中
BeanUtil.copyProperties(pmsSupplierBankDto,baseSupplierBankDto);
//添加base供应商开户行信息到base供应商开户行list对象中
baseSupplierBankDtos.add(baseSupplierBankDto);
}
baseSupplierInfoDto.setBaseSupplierBankList(baseSupplierBankDtos);
baseSupplierInfoFeign.save(baseSupplierInfoDto);
return rb.success();
}
public String insertByDto(PmsSupplierInfoDto dto){
PmsSupplierInfo entity = new PmsSupplierInfo();
BeanUtil.copyProperties(dto, entity, "id", "sid");
baseMapper.insert(entity);
return entity.getSid();
}
public void updateByDto(PmsSupplierInfoDto dto){
String dtoSid = dto.getSid();
if (StringUtils.isBlank(dtoSid)) {
return;
}
PmsSupplierInfo entity = fetchBySid(dtoSid);
BeanUtil.copyProperties(dto, entity, "id", "sid");
baseMapper.updateById(entity);
}
public PmsSupplierInfoDetailsVo fetchDetailsVoBySid(String sid){
PmsSupplierInfo entity = fetchBySid(sid);
PmsSupplierInfoDetailsVo vo = new PmsSupplierInfoDetailsVo();

54
yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssuppliertype/PmsSupplierTypeDown.java

@ -0,0 +1,54 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.pms.biz.pms.pmssuppliertype;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: yxt-base(仓储基础信息供应商) <br/>
* File: BaseSupplierTypeVo.java <br/>
* Class: com.yxt.anrui.as.api.pmssuppliertype.BaseSupplierTypeVo <br/>
* Description: 供应商类型 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2024-03-13 16:51:56 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
public class PmsSupplierTypeDown implements Vo {
@ApiModelProperty("供应商类型名称")
private String supplierTypeName;
@ApiModelProperty("供应商类型编码")
private String supplierTypeCode;
}

3
yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssuppliertype/PmsSupplierTypeMapper.java

@ -53,4 +53,7 @@ public interface PmsSupplierTypeMapper extends BaseMapper<PmsSupplierType> {
@Delete("delete from yxt_base.base_supplier_type where sid = #{sid}")
void del(String sid);
@Select("select * from yxt_base.base_supplier_type where createOrgSid = #{createOrgSid}")
List<PmsSupplierTypeDown> selSupplierType(String createOrgSid);
}

8
yxt-pms-biz/src/main/java/com/yxt/pms/biz/pms/pmssuppliertype/PmsSupplierTypeService.java

@ -41,6 +41,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Project: yxt-base(仓储基础信息供应商) <br/>
* File: BaseSupplierTypeService.java <br/>
@ -99,4 +101,10 @@ public class PmsSupplierTypeService extends MybatisBaseService<PmsSupplierTypeMa
baseMapper.del(sid);
}
}
public List<PmsSupplierTypeDown> selSupplierType(String orgPath) {
String createOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData();
List<PmsSupplierTypeDown> pmsSupplierTypeDowns = baseMapper.selSupplierType(createOrgSid);
return pmsSupplierTypeDowns;
}
}

3
yxt-pms-biz/src/main/java/com/yxt/pms/feign/yxtbase/supplier/BaseSupplierInfoDto.java

@ -32,6 +32,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
@ -105,6 +106,8 @@ public class BaseSupplierInfoDto implements Dto {
private String billingTypeKey; // 开票类型key
@ApiModelProperty("开票类型value")
private String billingTypeValue; // 开票类型value
@ApiModelProperty("税率")
private BigDecimal taxRate;
@ApiModelProperty("使用组织sid")
private String useOrgSid; // 使用组织sid
@ApiModelProperty("创建组织名称")

Loading…
Cancel
Save