diff --git a/src/api/foodManage/returnManage.js b/src/api/foodManage/returnManage.js
new file mode 100644
index 00000000..b83471c0
--- /dev/null
+++ b/src/api/foodManage/returnManage.js
@@ -0,0 +1,151 @@
+import request from '@/utils/request'
+
+// 原料类别树
+export function systemMaterialTreeApi(data) {
+ return request({
+ url: '/smart-canteen/cook_material_type/getTree',
+ method: 'post',
+ data: data
+ })
+}
+// 查询原料列表
+export function getMaterialListApi(data) {
+ return request({
+ url: '/smart-canteen/cook_material/list',
+ method: 'get',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ params: data
+ })
+}
+
+// 查询货品库存列表
+export function getStockMaterialListApi(data) {
+ return request({
+ url: '/smart-canteen/ims/inventory/list',
+ method: 'post',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ data: data,
+ params:{
+ pageNum:data.pageNum,
+ pageSize:data.pageSize
+ }
+ })
+}
+
+//查询供应商列表 isPaging 0不分页 2分页
+export function supplierPageApi(data) {
+ return request({
+ url: '/smart-canteen/ims_supplier/list',
+ method: 'get',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ params:data
+ })
+}
+
+// 仓库
+export function drpWareHousePageApi(data) {
+ return request({
+ url: '/smart-canteen/ims_warehouse_info/listAll',
+ method: 'get',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ params: data
+ })
+}
+
+
+
+// -------------退货单---------------
+//获取退货单分页列表
+export function returnMaterialPageApi(data) {
+ return request({
+ url: '/smart-canteen/ims_refund_goods/list',
+ method: 'get',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ params:data
+ })
+}
+//获取退货单详情
+export function getReturnMaterialInfoApi(data) {
+ return request({
+ url: '/smart-canteen/ims_refund_goods/page-detail',
+ method: 'get',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ params:data
+ })
+}
+// 新增退货单-保存
+export function addReturnMaterialApi(data) {
+ return request({
+ url: '/smart-canteen/ims_refund_goods/add',
+ method: 'post',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ data: data
+ })
+}
+// 编辑退货单-提交
+export function editReturnMaterialApi(data) {
+ return request({
+ url: '/smart-canteen/ims_refund_goods/commit',
+ method: 'post',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ },
+ data: data
+ })
+}
+// 删除退货单
+export function delReturnMaterialApi(data) {
+ return request({
+ url: '/smart-canteen/ims_refund_goods/remove/'+data.refundGoodsId,
+ method: 'post',
+ headers: {
+ //"merchant-id":"378915229716713472",
+ }
+ })
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/router/index.js b/src/router/index.js
index 1f3a82d8..e93d8b31 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -272,13 +272,13 @@ export const constantRoutes = [
path: 'materialReturnDetail',
component: () => import('@/views/foodManage/returnManage/materialReturn/detail'),
name: 'MaterialReturnDetail',
- meta: { title: '出库详情', icon: '' }
+ meta: { title: '退货单详情', icon: '' }
},
{
path: 'materialReturnEdit',
component: () => import('@/views/foodManage/returnManage/materialReturn/edit'),
name: 'MaterialReturnOutEdit',
- meta: { title: '出库新增/编辑', icon: '' }
+ meta: { title: '退货单新增/编辑', icon: '' }
},
]
}
diff --git a/src/views/foodManage/pickManage/materialPicking/edit.vue b/src/views/foodManage/pickManage/materialPicking/edit.vue
index 58126f0d..f56c0bd8 100644
--- a/src/views/foodManage/pickManage/materialPicking/edit.vue
+++ b/src/views/foodManage/pickManage/materialPicking/edit.vue
@@ -367,7 +367,6 @@ export default {
}else{
this.$modal.msgError("请先选择区域,仓库");
}
-
},
/** 搜索按钮操作 */
handleQuery() {
@@ -499,7 +498,7 @@ export default {
}else{
this.loadingBtn=true;
editFetchMaterialApi(param).then((response) => {
- this.$modal.msgSuccess("保存成功");
+ this.$modal.msgSuccess("提交成功");
this.loadingBtn=false
this.jumpList()
}).catch(() => {
diff --git a/src/views/foodManage/pickManage/materialPicking/index.vue b/src/views/foodManage/pickManage/materialPicking/index.vue
index 5282ce6f..183e2fba 100644
--- a/src/views/foodManage/pickManage/materialPicking/index.vue
+++ b/src/views/foodManage/pickManage/materialPicking/index.vue
@@ -308,11 +308,11 @@ export default {
// "approveStatus": this.queryParams.approveStatus
}
if(this.dateRange&&this.dateRange.length>0){
- param.startDateTime=this.formatDateTime(this.dateRange[0])
- param.endDateTime=this.formatDateTime(this.dateRange[1])
+ param.startTime=this.formatDateTime(this.dateRange[0])
+ param.endTime=this.formatDateTime(this.dateRange[1])
}else{
- param.startDateTime=undefined;
- param.endDateTime=undefined;
+ param.startTime=undefined;
+ param.endTime=undefined;
}
fetchMaterialPageApi(param).then(response => {
this.tableListData = response.rows;
diff --git a/src/views/foodManage/returnManage/materialReturn/detail.vue b/src/views/foodManage/returnManage/materialReturn/detail.vue
index 9d7f0934..53d38437 100644
--- a/src/views/foodManage/returnManage/materialReturn/detail.vue
+++ b/src/views/foodManage/returnManage/materialReturn/detail.vue
@@ -4,78 +4,36 @@
退货订单号
- {{baseInfo.orderGoodsCode}}
+ {{baseInfo.refundGoodsCode}}
-
- 订单标题
- {{ baseInfo.orderTitle }}
+
+ 退货仓库
+ {{ baseInfo.warehouseName }}
- 交货日期
- {{ baseInfo.requestArrivalTime }}
+ 退货人
+ {{ baseInfo.refundName }}
所属区域
{{ baseInfo.areaName }}
-
+
供应商
{{ baseInfo.supplierName }}
-
+
- 所属食堂
- {{ baseInfo.canteenName }}
-
-
- 所属档口
- {{ baseInfo.stallName }}
-
-
- 送货仓库
- {{ baseInfo.warehouseName }}
-
-
- 送货地址
- {{ baseInfo.supplyAddress }}
-
+ 退货时间
+ {{ baseInfo.refundTime }}
+
审批状态
待审批
审批中
审批同意
审批拒绝
-
-
- 确认状态
- 待确认
- 确认通过
- 已拒绝
-
- 备注
- {{ baseInfo.remark }}
-
-
-
-
-
- 付款方式
- 一次性付款
- 分期付款
-
-
- 付款日期
- {{ baseInfo.payMoneyDate }}
-
-
- 收款银行
- {{ baseInfo.collectMoneyBank }}
-
-
- 收款账户名称
- {{ baseInfo.collectMoneyAccountName }}
-
-
+
@@ -101,16 +59,16 @@
- {{ (scope.row.singlePrice/100).toFixed(2) }}
+
-
-
+
+
- {{ scope.row.orderNum*scope.row.singlePrice }}
+
-
+
@@ -203,12 +161,12 @@ export default {
getContractInfo(){
console.log(this.pageJson)
let param = {
- orderGoodsId:this.pageJson.orderGoodsId
+ refundGoodsId:this.pageJson.refundGoodsId
}
//查询查询食堂下拉结构
getPurchaseOrderInfoApi(param).then((response) => {
- this.baseInfo = response.data;
- this.materialLis = this.baseInfo.orderGoodsDetailList;
+ this.baseInfo = this.pageJson;
+ this.materialList = response.rows;
});
},
// 多选框选中数据
diff --git a/src/views/foodManage/returnManage/materialReturn/edit.vue b/src/views/foodManage/returnManage/materialReturn/edit.vue
index faaf2c84..0ad56f5c 100644
--- a/src/views/foodManage/returnManage/materialReturn/edit.vue
+++ b/src/views/foodManage/returnManage/materialReturn/edit.vue
@@ -2,21 +2,9 @@
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
- 一次性付款
- 分期付款
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ v-model="baseInfo.refundTime"
+ type="datetime" align="right"
+ format="yyyy-MM-dd HH:mm:ss" style="width: 240px;"
+ :picker-options="pickerOptions" @change="baseInfo.refundTime=formatDateTime(baseInfo.refundTime)">
+
+
@@ -119,24 +71,24 @@
称重
-->
-
-
- (scope.row.singlePrice=v.replace(/[^\d.]/g,''))"/>
+
+
-
+
+
- (scope.row.orderNum=v.replace(/[^\d]/g,''))"/>
+
-
+
- {{ scope.row.orderNum*scope.row.singlePrice }}
+ (scope.row.refundNum=v.replace(/[^\d]/g,''))"/>
-
+
-
+
@@ -187,16 +139,8 @@
-
-
-
- {{ (scope.row.unitPrice/100).toFixed(2)||"" }}
-
-
+
import { imgUpLoadTwo } from '@/api/system/upload'
-import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
-import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi,drpWareHousePageApi } from "@/api/foodManage/purchaseManage";
-import { getPurchaseOrderInfoApi,addPurchaseOrderApi,editPurchaseOrderApi } from "@/api/foodManage/purchaseManage";
+import { systemAreaTreeApi } from "@/api/base/stall";
+import { systemMaterialTreeApi,getStockMaterialListApi,supplierPageApi,drpWareHousePageApi } from "@/api/foodManage/returnManage";
+import { getReturnMaterialInfoApi,addReturnMaterialApi,editReturnMaterialApi } from "@/api/foodManage/returnManage";
+
export default {
name: "orderEdit",
dicts: [],
@@ -228,14 +173,14 @@ export default {
loading:false,
loadingBtn:false,
baseInfo: {
- orderTitle:undefined,
+ title:undefined,
contractType:undefined,
areaId:undefined,
canteenId:undefined,
},
// 表单校验
baseRules: {
- orderTitle: [
+ title: [
{ required: true, message: "退货订单标题不能为空", trigger: "blur" }
],
areaId: [
@@ -250,7 +195,7 @@ export default {
supplierId: [
{ required: true, message: "供应商不能为空", trigger: "change" }
],
- requestArrivalTime: [
+ refundTime: [
{ required: true, message: "交货时间不能为空", trigger: "change" }
],
warehouseId: [
@@ -303,23 +248,15 @@ export default {
getContractInfo(){
console.log(this.pageJson)
let param = {
- orderGoodsId:this.pageJson.orderGoodsId
+ refundGoodsId:this.pageJson.refundGoodsId
}
//查询查询食堂下拉结构
- getPurchaseOrderInfoApi(param).then((response) => {
- this.baseInfo = response.data;
- this.materialList = this.baseInfo.orderGoodsDetailList;
- this.materialList.forEach(item=>{
- this.$set(item,"singlePrice",Number(item.singlePrice)/100)
- })
- getCanteenByAreaApi({areaId:this.baseInfo.areaId}).then((response) => {
- this.canteenOptions=response.rows||[];
- this.$set(this.baseInfo,"canteenId",this.baseInfo.canteenId)
- });
- getStallByCanteenApi({ canteenId:this.baseInfo.canteenId }).then((response) => {
- this.stallOptions=response.rows||[]
- this.$set(this.baseInfo,"stallId",this.baseInfo.stallId)
- });
+ getReturnMaterialInfoApi(param).then((response) => {
+ this.baseInfo = this.pageJson;
+ this.materialList = response.rows;
+ // this.materialList.forEach(item=>{
+ // this.$set(item,"singlePrice",Number(item.singlePrice)/100)
+ // })
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
this.supplierOptions = response.rows||[];
this.$set(this.baseInfo,'supplierId',this.baseInfo.supplierId)
@@ -344,20 +281,9 @@ export default {
}
},
//选中区域-查询食堂
- handleAreaChange(e){
- this.getCanteenData()
+ handleAreaChange(e){
this.getSupplierData()
this.getWareHouseData()
- },
- /** 查询查询食堂下拉结构 */
- getCanteenData() {
- let param= {
- areaId:this.baseInfo.areaId
- }
- getCanteenByAreaApi(param).then((response) => {
- this.canteenOptions=response.rows||[];
- this.$set(this.baseInfo,"canteenId",null)
- });
},
/** 查询供应商下拉结构 */
getSupplierData() {
@@ -372,20 +298,6 @@ export default {
this.wareHouseOptions = response.rows||[];
this.$set(this.baseInfo,'warehouseId',null)
});
- },
- //选中食堂-查询档口
- handleCanteenChange(e){
- this.getStallData()
- },
- /** 查询档口下拉结构 */
- getStallData() {
- let param= {
- canteenId:this.baseInfo.canteenId
- }
- getStallByCanteenApi(param).then((response) => {
- this.stallOptions=response.rows||[]
- this.$set(this.baseInfo,"stallId",null)
- });
},
/** 查询货品类别下拉树结构 */
getMaterialTree() {
@@ -415,16 +327,15 @@ export default {
},
//添加货品
addMaterial(){
- if(this.baseInfo.areaId!=undefined){
+ if(this.baseInfo.areaId!=undefined||this.baseInfo.warehouseId!=undefined){
this.openDialog=true
this.resetQuery()
setTimeout(()=>{
this.$refs.multipleTable1.clearSelection()
},300)
}else{
- this.$modal.msgError("请先选择区域");
- }
-
+ this.$modal.msgError("请先选择区域,仓库");
+ }
},
/** 搜索按钮操作 */
handleQuery() {
@@ -442,12 +353,13 @@ export default {
let param = {
"pageSize": this.queryParams.pageSize,
"pageNum": this.queryParams.pageNum,
- "areaId": this.queryParams.areaId,
+ "areaId": this.baseInfo.areaId,
+ "warehouseId": this.baseInfo.warehouseId,
"materialName": this.queryParams.materialName,
"materialCode": this.queryParams.materialCode,
"materialTypeIds": this.queryParams.materialTypeIds,
}
- getMaterialListApi(param).then(response => {
+ getStockMaterialListApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
@@ -456,8 +368,8 @@ export default {
handleSelectionChange2(selection) {
this.batchChosenMaterial = selection;
this.batchChosenMaterial.forEach(item=>{
- this.$set(item,"orderNum",0)
- this.$set(item,"singlePrice",item.unitPrice/100)
+ this.$set(item,"refundNum",0)
+ // this.$set(item,"singlePrice",item.unitPrice/100)
})
},
confirmChosen(){
@@ -475,29 +387,27 @@ export default {
this.$refs["baseInfo"].validate(valid => {
if (valid) {
let param = Object.assign({},this.baseInfo);
- param.requestArrivalTime = this.formatDate(this.baseInfo.requestArrivalTime)
- param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
- param.orderAmount=0
- param.totalNum=0
- param.orderStatus=1
- param.orderGoodsDetailList = []
+ param.refundTime = this.formatDate(this.baseInfo.refundTime)
+ param.refundTotalAmount=0
+ param.refundTotalNum=0
+ param.detailList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
- if(item.singlePrice==0 || item.orderNum==0){
+ if(item.refundNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
- obj.singlePrice = Number(obj.singlePrice)*100
- obj.totalPrice = (Number(obj.singlePrice)*Number(obj.orderNum))
- param.orderAmount = param.orderAmount+obj.totalPrice;
- param.totalNum = param.totalNum+Number(obj.orderNum)
- param.orderGoodsDetailList.push(obj)
+ // obj.singlePrice = Number(obj.singlePrice)*100
+ // obj.totalPrice = (Number(obj.singlePrice)*Number(obj.refundNum))
+ // param.refundTotalAmount = param.refundTotalAmount+obj.totalPrice;
+ param.refundTotalNum = param.refundTotalNum+Number(obj.refundNum)
+ param.detailList.push(obj)
}
})
}
if(this.noMaterial){
- this.$modal.msgError("请输入单价和数量!");
+ this.$modal.msgError("请输入退货数量!");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
@@ -507,24 +417,14 @@ export default {
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
}else{
- this.loadingBtn=true;
- if (this.baseInfo.orderGoodsId != undefined) {
- editPurchaseOrderApi(param).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.loadingBtn=false
- this.jumpList()
- }).catch(() => {
- this.loadingBtn=false
- });
- } else {
- addPurchaseOrderApi(param).then((response) => {
- this.$modal.msgSuccess("保存成功");
- this.loadingBtn=false
- this.jumpList()
- }).catch(() => {
- this.loadingBtn=false
- });
- }
+ this.loadingBtn=true;
+ addReturnMaterialApi(param).then((response) => {
+ this.$modal.msgSuccess("保存成功");
+ this.loadingBtn=false
+ this.jumpList()
+ }).catch(() => {
+ this.loadingBtn=false
+ });
}
}
@@ -534,31 +434,29 @@ export default {
// 提交按钮
confirmSubmit(){
this.$refs["baseInfo"].validate(valid => {
- if (valid) {
+ if (valid) {
let param = Object.assign({},this.baseInfo);
- param.requestArrivalTime = this.formatDate(this.baseInfo.requestArrivalTime)
- param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
- param.orderAmount=0
- param.totalNum=0
- param.orderStatus=2
- param.orderGoodsDetailList = []
+ param.refundTime = this.formatDate(this.baseInfo.refundTime)
+ param.refundTotalAmount=0
+ param.refundTotalNum=0
+ param.detailList = []
this.noMaterial = false;
if(this.materialList.length>0){
this.materialList.forEach(item=>{
- if(item.singlePrice==0 || item.orderNum==0){
+ if(item.refundNum==0){
this.noMaterial = true
}else{
let obj = Object.assign({}, item)
- obj.singlePrice = Number(obj.singlePrice)*100
- obj.totalPrice = (Number(obj.singlePrice)*Number(obj.orderNum))
- param.orderAmount = param.orderAmount+obj.totalPrice;
- param.totalNum = param.totalNum+Number(obj.orderNum)
- param.orderGoodsDetailList.push(obj)
+ // obj.singlePrice = Number(obj.singlePrice)*100
+ // obj.totalPrice = (Number(obj.singlePrice)*Number(obj.refundNum))
+ // param.refundTotalAmount = param.refundTotalAmount+obj.totalPrice;
+ param.refundTotalNum = param.refundTotalNum+Number(obj.refundNum)
+ param.detailList.push(obj)
}
})
}
if(this.noMaterial){
- this.$modal.msgError("请输入单价和数量!");
+ this.$modal.msgError("请输入退货数量!");
}else{
this.noMaterial = true;
if(this.materialList.length>0){
@@ -568,27 +466,18 @@ export default {
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
}else{
- this.loadingBtn=true;
- if (this.baseInfo.orderGoodsId != undefined) {
- editPurchaseOrderApi(param).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.loadingBtn=false
- this.jumpList()
- }).catch(() => {
- this.loadingBtn=false
- });
- } else {
- addPurchaseOrderApi(param).then((response) => {
- this.$modal.msgSuccess("保存成功");
- this.loadingBtn=false
- this.jumpList()
- }).catch(() => {
- this.loadingBtn=false
- });
- }
+ this.loadingBtn=true;
+ editReturnMaterialApi(param).then((response) => {
+ this.$modal.msgSuccess("提交成功");
+ this.loadingBtn=false
+ this.jumpList()
+ }).catch(() => {
+ this.loadingBtn=false
+ });
}
}
+
}
});
},
diff --git a/src/views/foodManage/returnManage/materialReturn/index.vue b/src/views/foodManage/returnManage/materialReturn/index.vue
index 3116fea5..108b097e 100644
--- a/src/views/foodManage/returnManage/materialReturn/index.vue
+++ b/src/views/foodManage/returnManage/materialReturn/index.vue
@@ -3,18 +3,6 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
+
+
@@ -71,13 +71,13 @@
{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}
-
+
- 待提交
- 已提交
+ 待提交
+ 已提交
-
+