diff --git a/src/api/product.js b/src/api/product.js index 5ebdfc4..1a0dc11 100644 --- a/src/api/product.js +++ b/src/api/product.js @@ -7,7 +7,7 @@ const getByPage = (params) => { ); }; //炼厂list -const findByEntity = (params = {}) => { +const findByEntity = (params) => { return request.postJson( "/oil-refinery/xoilRefineryInfo/findByEntity", params @@ -17,8 +17,29 @@ const findByEntity = (params = {}) => { const update = (params) => { return request.postJson("/oil-refinery/oilRefineryProduct/update", params); }; +// 下单 +const orderSave = (params) => { + return request.postJson( + "/oil-refinery/xoilRefineryOrder/save", + params + ); +}; +//查看企业产品 +const getRefineryProductList = (params) => { + return request.postJson( + "/oil-refinery/oilRefineryProduct/getRefineryProductList", + params + ); +}; + // 搜索客户 + const getRefineryCompanyList = (params) => { + return request.postJson("/oil-user/oilCompanyInfo/getLikeByCompanyType", params); +}; export default { getByPage, findByEntity, + orderSave, + getRefineryProductList, + getRefineryCompanyList }; diff --git a/src/store/getters.js b/src/store/getters.js index 86733ce..b8a541f 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -7,6 +7,7 @@ const getters = { auth: (state) => state.user.auth, company_type: (state) => state.user.companyType, company_id: (state) => state.user.companyId, + company_name: (state) => state.user.userCompanyName, permission_routes: (state) => state.permission.routes, }; export default getters; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 4e2475e..0e7ce91 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -5,6 +5,7 @@ const getDefaultState = () => { auth: null, companyType: 0, companyId: "", + userCompanyName:'' }; }; @@ -21,6 +22,7 @@ const mutations = { //chainParentMark 1:总公司 0:分公司 state.companyType = data.chainParentMark; state.companyId = data.userCompany; + state.userCompanyName = data.userCompanyName; }, }; diff --git a/src/utils/index.js b/src/utils/index.js index 09d2e74..d33d6ac 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -51,3 +51,8 @@ export function isLicensePlate(no) { ); return instance.test(no); } + +export function typeJudgment(object) { + let res = {}.__proto__.toString.call(object); + return res ? res : ""; +} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index c217cf1..9ea2be5 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -154,7 +154,7 @@ export default { }); return; } - + console.log() localStorage.setItem("customerToken", res.data.accessToken); this.$router.replace("/"); }) diff --git a/src/views/order/components/billOfLading.vue b/src/views/order/components/billOfLading.vue index a19915d..2837988 100644 --- a/src/views/order/components/billOfLading.vue +++ b/src/views/order/components/billOfLading.vue @@ -83,7 +83,7 @@ -
我来修改/锁定
+
修改信息
@@ -95,7 +95,7 @@
删除提货单 - {{orderTagType(item.deliveryStatus).info}} + {{orderTagType(item.deliveryStatus).info}}
@@ -126,7 +126,7 @@ 取 消 确定 修改 - 修改并锁定 + { - if (valid) { + billAddSave(e,item){ if(!e){ - this.billAddData.orderId=this.controlWindows.addInfo.id - this.billAddData.productMeasurement=this.controlWindows.addInfo.productMeasurement - order.billSave(this.billAddData).then(res=>{ - if(res.code == 20000){ - this.billAddData.deliveryStatus = 'SUBMITED' - this.billData.list.push(this.billAddData) - this.billListMeth() - this.$message.success(res.msg) - this.dialogBillAdd = false - } - }) + this.$refs["form"].validate((valid) => { + if (valid) { + this.billAddData.orderId=this.controlWindows.addInfo.id + this.billAddData.productMeasurement=this.controlWindows.addInfo.productMeasurement + order.billSave(this.billAddData).then(res=>{ + if(res.code == 20000){ + this.billAddData.deliveryStatus = 'SUBMITED' + this.billData.list.push(this.billAddData) + this.billListMeth() + this.$message.success(res.msg) + this.dialogBillAdd = false + } + })}}) }else{ - delete this.billAddData.productMeasurement - this.billAddData.deliveryStatus = e==2?'PLATENUM_LOCKED':'' - order.update(this.billAddData).then(res=>{ - if(res.code == 20000){ - this.billListMeth() - this.$message.success(res.msg) - this.dialogBillAdd = false - } + this.$confirm('确定锁定提货单?', '提示', { type: 'error' }).then(() => { + this.billAddData = item?JSON.parse(JSON.stringify(item)):{} + this.billAddData.deliveryStatus = e==2?'PLATENUM_LOCKED':'' + order.update(this.billAddData).then(res=>{ + if(res.code == 20000){ + this.billListMeth() + this.$message.success(res.msg) + this.dialogBillAdd = false + } + }) }) } - } - }) }, //更新提货单数据 billListMeth(){ diff --git a/src/views/order/index.vue b/src/views/order/index.vue index 60f9bc0..3873730 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -1,8 +1,19 @@