diff --git a/yxt-as-ui/src/api/Common/dictcommons.js b/yxt-as-ui/src/api/Common/dictcommons.js index e7c9d3ad71..974eb9a344 100644 --- a/yxt-as-ui/src/api/Common/dictcommons.js +++ b/yxt-as-ui/src/api/Common/dictcommons.js @@ -194,7 +194,7 @@ export function getAsBusrepairBill(params) { // 查询分页列表 --商品类别列表 export function getGoodsCategory(params) { return request({ - url: '/as/v1/AsBusrepairBill/listPage', + url: '/yxtbase/apiadmin/base/basegoodstype/selectByUseOrgSid', method: 'post', data: params, headers: { diff --git a/yxt-as-ui/src/api/storage/adjustment.js b/yxt-as-ui/src/api/storage/adjustment.js index e13a9ad43d..f7837ff9f5 100644 --- a/yxt-as-ui/src/api/storage/adjustment.js +++ b/yxt-as-ui/src/api/storage/adjustment.js @@ -5,7 +5,7 @@ export default { // 查询分页列表 listPage: function(params) { return request({ - url: '/wms/apiadmin/WmsShelfBill/listPage', + url: '/sms/v1/smspricestrategybill/listPage', method: 'post', data: params, headers: { 'Content-Type': 'application/json' } @@ -15,7 +15,7 @@ export default { // 初始化 init: function(data) { return request({ - url: '/wms/apiadmin/WmsShelfBill/details?sid='+data, + url: '/sms/v1/smspricestrategybill/fetchDetailsBySid/'+data, method: 'get' }); }, @@ -24,7 +24,17 @@ export default { // 新增、保存 save: function(data) { return request({ - url: '/wms/apiadmin/WmsShelfBill/saveOrUpdate', + url: '/sms/v1/smspricestrategybill/save', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }); + }, + + // 新增、保存 + submit: function(data) { + return request({ + url: '/sms/v1/smspricestrategybill/submit', method: 'post', data: data, headers: { 'Content-Type': 'application/json' } @@ -34,7 +44,7 @@ export default { deleteBySids: function(data) { return request({ - url: '/wms/apiadmin/WmsShelfBill/delBySids', + url: '/sms/v1/smspricestrategybill/delBySids', method: 'DELETE', data: data, headers: { 'Content-Type': 'application/json' } diff --git a/yxt-as-ui/src/views/storage/adjustment/adjustmentAdd.vue b/yxt-as-ui/src/views/storage/adjustment/adjustmentAdd.vue index 3421b499bb..ee3b77b9c1 100644 --- a/yxt-as-ui/src/views/storage/adjustment/adjustmentAdd.vue +++ b/yxt-as-ui/src/views/storage/adjustment/adjustmentAdd.vue @@ -48,19 +48,27 @@
商品类别列表
添加 - + + + + + + + + + - - - - @@ -70,9 +78,9 @@ - + - + @@ -83,6 +91,9 @@ } from '@/utils/index.js' import choosecategory from './relation/choosecategory' import editPriceStrategy from './relation/editPriceStrategy' + import { + getOrgSidByPath + } from '@/api/Common/dictcommons' export default { components: { choosecategory, @@ -91,18 +102,129 @@ data() { return { title: "【新增】", - viewState:1, + viewState: 1, listLoading: false, submitdisabled: false, formobj: { - + "sid": "", + "createByName": window.sessionStorage.getItem('name'), + "billNo": "", + "deptName": window.sessionStorage.getItem('defaultOrgPathName').substring(window + .sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1), + "deptSid": window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage + .getItem('defaultOrgPath').lastIndexOf('/') + 1), + "remarks": "", + "createBySid": window.sessionStorage.getItem('userSid'), + "createTime": getCurrentDate(), + "procDefId": "", + "nodeId": "", + "procInstId": "", + "nodeState": "", + "taskId": "", + "finishTime": "", + "useOrgSid": "", + "useOrgName": "", + "smsPricestrategyBillDetailList": [] }, } }, - created() {}, + created() { + + }, methods: { + + calculation(row) { + console.log("calculation》》》》", row) + var info = '' + + info = row.strategyType == 0 ? '固定比例' : '价格区间' + + return info + }, + calculation2(row) { + var info = '' + + if (row.strategyType == 1) { + for (var i = 0; i < row.smsPricestrategyBillGoodstypedetailList.length; i++) { + + info += row.smsPricestrategyBillGoodstypedetailList[i].rangeStart + "——" + row + .smsPricestrategyBillGoodstypedetailList[i].rangeEnd + " " + row + .smsPricestrategyBillGoodstypedetailList[i] + .markupRate + ";" + } + } else { + info = row.gdMarkupRate + } + + + return info + }, + + deleteGoodsType(row) { + + const index = this.formobj.smsPricestrategyBillDetailList.findIndex((item) => item === row) + console.log("index》》》》", index) + this.formobj.smsPricestrategyBillDetailList.splice(index, 1) + }, + editPriceStrategy(row) { + this.viewState = 3 + const aa = [] + this.$refs['editPriceStrategy'].showAdd(aa, row) + }, backData(value) { + this.viewState = 1 + console.log('>>>>>>>>>backData', value) + + for (var i = 0; i < value.length; i++) { + + this.formobj.smsPricestrategyBillDetailList.push( + + { + goodsTypeSid: value[i].sid, + goodsTypeCode: value[i].goodsTypeCode, + goodsTypeName: value[i].goodsTypeName, + strategyType: '', + strategyTypeValue: '', + gdMarkupRate: "", + strategyDetail: '', + smsPricestrategyBillGoodstypedetailList: [] + + } + + ) + + } + + }, + backData2(value) { + this.viewState = 1 + console.log('>>>>>>>>>backData2', value) + + var info = '' + + if (value.strategyType == 1) { + for (var i = 0; i < value.smsPricestrategyBillGoodstypedetailList.length; i++) { + + info += value.smsPricestrategyBillGoodstypedetailList[i].rangeStart + "——" + value + .smsPricestrategyBillGoodstypedetailList[i].rangeEnd + " " + value + .smsPricestrategyBillGoodstypedetailList[i] + .markupRate + ";" + } + } + + + console.log('>>>>>>>>>backData2', info) + + const choose = this.formobj.smsPricestrategyBillDetailList.filter((item) => item.goodsTypeSid == value + .goodsTypeSid) + console.log('>>>>>>>>>busTypeSelect', choose) + + choose[0].strategyDetail = value.strategyType == 0 ? value.gdMarkupRate : info + choose[0].smsPricestrategyBillGoodstypedetailList = value.smsPricestrategyBillGoodstypedetailList + choose[0].strategyType = value.strategyType + choose[0].strategyTypeValue = value.strategyType == 0 ? '固定比例' : '价格区间' + console.log('>>>>>>>>>backData2', choose) }, resetState() { @@ -110,7 +232,9 @@ }, categoryAdd() { - this.viewState =2 + this.viewState = 2 + const aa = [] + this.$refs['choosecategory'].showData(aa, this.formobj.createOrgSid) }, indexMethod(index) { return index + 1 @@ -118,20 +242,6 @@ saveOrUpdate() { console.log('>>>>>>>>>saveOrUpdate', this.formobj) - for (var i = 0; i < this.formobj.list.length; i++) { - - if (Number(this.formobj.list[i].actualInCount) == 0) { - this.$message({ - showClose: true, - type: 'error', - message: '商品实收数量不能为空' - }) - - return - } - - } - this.$refs['form_obj'].validate((valid) => { if (valid) { @@ -156,19 +266,13 @@ submintdate() { console.log('>>>>>>>>>saveOrUpdate', this.formobj) - - for (var i = 0; i < this.formobj.list.length; i++) { - - if (Number(this.formobj.list[i].actualInCount) == 0) { - this.$message({ - showClose: true, - type: 'error', - message: '商品实收数量不能为空' - }) - - return - } - + if (this.formobj.smsPricestrategyBillDetailList.length == 0) { + this.$message({ + showClose: true, + type: 'warning', + message: '请添加商品类别' + }) + return } @@ -202,24 +306,24 @@ }, showAdd() { - + this.title = '【新增】' + getOrgSidByPath({ + orgPath: window.sessionStorage.getItem('defaultOrgPath') + }).then((res) => { + if (res.success) { + this.formobj.createOrgSid = res.data + this.formobj.useOrgSid = res.data + } + }) }, showEdit(row) { - var params = { - sourceSid: row.sid - } - req.getInitDetails(row.sid) + this.title = '【编辑】' + + req.init(row.sid) .then(resp => { if (resp.success) { this.formobj = resp.data - this.formobj.deliveryDate = getCurrentDate() - - this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window - .sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1) - this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage - .getItem('defaultOrgPath').lastIndexOf('/') + 1) - } }) .catch(e => { diff --git a/yxt-as-ui/src/views/storage/adjustment/adjustmentInfo.vue b/yxt-as-ui/src/views/storage/adjustment/adjustmentInfo.vue index 5723181132..1e1c24a81f 100644 --- a/yxt-as-ui/src/views/storage/adjustment/adjustmentInfo.vue +++ b/yxt-as-ui/src/views/storage/adjustment/adjustmentInfo.vue @@ -37,7 +37,7 @@
备注
- {{ formobj.remarks }} + {{ formobj.remarks }}
@@ -45,13 +45,21 @@
商品类别列表
- + - - - - + + + + + + + + @@ -78,6 +86,30 @@ created() {}, methods: { + calculation(row) { + var info = '' + info = row.strategyType == 0 ? '固定比例' : '价格区间' + return info + }, + calculation2(row) { + var info = '' + + if (row.smsPricestrategyBillGoodstypedetailList != null && row.smsPricestrategyBillGoodstypedetailList.length > + 0) { + for (var i = 0; i < row.smsPricestrategyBillGoodstypedetailList.length; i++) { + + info += row.smsPricestrategyBillGoodstypedetailList[i].rangeStart + "——" + row + .smsPricestrategyBillGoodstypedetailList[i].rangeEnd + " " + row + .smsPricestrategyBillGoodstypedetailList[i] + .markupRate + ";" + } + }else{ + info = row.gdMarkupRate + } + + + return info + }, indexMethod(index) { return index + 1 }, @@ -94,21 +126,12 @@ showAdd() { }, - showEdit(row) { - var params = { - sourceSid: row.sid - } + showInfo(row) { - req.getInitDetails(row.sid) + req.init(row.sid) .then(resp => { if (resp.success) { this.formobj = resp.data - this.formobj.deliveryDate = getCurrentDate() - - this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window - .sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1) - this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage - .getItem('defaultOrgPath').lastIndexOf('/') + 1) } }) diff --git a/yxt-as-ui/src/views/storage/adjustment/index.vue b/yxt-as-ui/src/views/storage/adjustment/index.vue index 32668945f7..a9201809e0 100644 --- a/yxt-as-ui/src/views/storage/adjustment/index.vue +++ b/yxt-as-ui/src/views/storage/adjustment/index.vue @@ -66,7 +66,7 @@ {{ scope.row.nodeState }} --> - + @@ -177,7 +177,7 @@ }, created() { // 初始化变量 - // this.getList() + this.getList() }, mounted() { // 在外部vue的window上添加postMessage的监听,而且绑定处理函数handleMessage diff --git a/yxt-as-ui/src/views/storage/adjustment/relation/choosecategory.vue b/yxt-as-ui/src/views/storage/adjustment/relation/choosecategory.vue index 4ab047bd68..8aff066ba6 100644 --- a/yxt-as-ui/src/views/storage/adjustment/relation/choosecategory.vue +++ b/yxt-as-ui/src/views/storage/adjustment/relation/choosecategory.vue @@ -40,8 +40,8 @@ 确认 --> - - + +
@@ -81,6 +81,8 @@ params: { code: '', name: '', + deptSid:window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage + .getItem('defaultOrgPath').lastIndexOf('/') + 1) }, total: 0 } @@ -129,6 +131,8 @@ params: { code: '', name: '', + deptSid:window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage + .getItem('defaultOrgPath').lastIndexOf('/') + 1) }, total: 0 } @@ -147,7 +151,6 @@ // } else { // this.listQuery.params.saleVehSids = [] // }`` - this.listQuery.params.createOrgSid = createOrgSid this.listQuery.current = 1 this.listQuery.size = 10 this.listQuery.total = 0 diff --git a/yxt-as-ui/src/views/storage/adjustment/relation/editPriceStrategy.vue b/yxt-as-ui/src/views/storage/adjustment/relation/editPriceStrategy.vue index 4fb2dd5993..e156612395 100644 --- a/yxt-as-ui/src/views/storage/adjustment/relation/editPriceStrategy.vue +++ b/yxt-as-ui/src/views/storage/adjustment/relation/editPriceStrategy.vue @@ -6,7 +6,7 @@
价格策略设置
- 保存 + 保存 关闭
@@ -15,7 +15,7 @@
- + @@ -23,37 +23,40 @@
商品类别名称
- {{ formobj.createByName }} + {{ formobj.goodsTypeName }}
-
价格策略
- {{ formobj.deptName }} +
* 价格策略
+ + + 固定比例 + 价格区间 + +
- - + -
加价比例(%)
+
* 加价比例(%)
- - 固定比例 - 价格区间 - +
-
+
价格区间加价策略
- 添加 + 添加
- +