feat: 补充平台端库存管理模块
补齐平台端库存余额、流水、初始化和手工调整能力,并将快递发货接入库存扣减闭环,方便运营侧统一查账与审计。 Made-with: Cursor
This commit is contained in:
@@ -122,9 +122,10 @@ import { defaultData } from '@/views/systemSetting/deliveryPersonnel/default';
|
||||
import { personnelListApi } from '@/api/deliveryPersonnel';
|
||||
import CreatPersonnel from '@/views/systemSetting/deliveryPersonnel/creatPersonnel';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
import { merchantElectrSheetInfo } from '@/api/systemSetting';
|
||||
import { merchantSheetInfoApi as merchantElectrSheetInfo } from '@/api/merchantOrder';
|
||||
import Cookies from 'js-cookie';
|
||||
import { exportTempApi } from '@/api/logistics';
|
||||
import { isPlatform } from '@/utils/settingMer';
|
||||
export default {
|
||||
name: 'sendFrom',
|
||||
components: { CreatExpress, CreatPersonnel },
|
||||
@@ -143,6 +144,7 @@ export default {
|
||||
exportTempList: [],
|
||||
merElectPrint: Cookies.get('merElectPrint'), // 商家小票打印开关状态
|
||||
currentItemCode: '',
|
||||
isPlatform,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -157,7 +159,9 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.getPersonnelList();
|
||||
if (!this.isPlatform && this.checkPermi(['merchant:delivery:personnel:page'])) {
|
||||
this.getPersonnelList();
|
||||
}
|
||||
//if (checkPermi(['admin:pass:shipment:express']))
|
||||
this.getShipmentExpress();
|
||||
},
|
||||
@@ -174,15 +178,20 @@ export default {
|
||||
},
|
||||
// 选配送员确定回调
|
||||
handlerSuccessSubmit() {
|
||||
this.getPersonnelList();
|
||||
if (!this.isPlatform) this.getPersonnelList();
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
// 配送员列表
|
||||
async getPersonnelList() {
|
||||
const data = await personnelListApi(this.tableFrom);
|
||||
this.personnelList = data.list;
|
||||
if (!this.isShowBtn)
|
||||
try {
|
||||
const data = await personnelListApi(this.tableFrom);
|
||||
this.personnelList = data.list || [];
|
||||
} catch (e) {
|
||||
this.personnelList = [];
|
||||
}
|
||||
if (!this.isShowBtn) {
|
||||
this.selectedValue = this.personnelList.filter((item) => item.personnelPhone === this.formItem.carrierPhone)[0];
|
||||
}
|
||||
},
|
||||
// 添加
|
||||
handleCreatPersonnel(row) {
|
||||
@@ -202,17 +211,27 @@ export default {
|
||||
limit: 50,
|
||||
openStatus: true,
|
||||
};
|
||||
if (typeof useLogistics !== 'function') {
|
||||
this.express = [];
|
||||
return;
|
||||
}
|
||||
this.express = await useLogistics(params);
|
||||
this.express.map((item) => {
|
||||
if (item.isDefault && !this.formItem.id) this.formItem.expressCode = item.code;
|
||||
});
|
||||
},
|
||||
getShipmentExpress() {
|
||||
if (typeof merchantElectrSheetInfo !== 'function') {
|
||||
this.shipmentExpress = {};
|
||||
return;
|
||||
}
|
||||
merchantElectrSheetInfo().then((data) => {
|
||||
this.shipmentExpress = data;
|
||||
this.formItem.toName = data.senderUsername;
|
||||
this.formItem.toTel = data.senderPhone;
|
||||
this.formItem.toAddr = data.senderAddr;
|
||||
this.shipmentExpress = data || {};
|
||||
this.formItem.toName = data?.senderUsername || '';
|
||||
this.formItem.toTel = data?.senderPhone || '';
|
||||
this.formItem.toAddr = data?.senderAddr || '';
|
||||
}).catch(() => {
|
||||
this.shipmentExpress = {};
|
||||
});
|
||||
},
|
||||
changeSendTypeRadio(expressRecordType) {
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
>
|
||||
<el-form v-if="modals" ref="formItem" :model="formItem" label-width="95px" @submit.native.prevent :rules="rules">
|
||||
<el-form-item v-show="secondType !== OrderSecondTypeEnum.Fictitious" label="配送方式:" prop="deliveryType">
|
||||
<el-radio-group v-model="formItem.deliveryType" @change="changeRadio(formItem.deliveryType)" v-removeAriaHidden>
|
||||
<el-radio-group v-model="formItem.deliveryType" @change="changeRadio(formItem.deliveryType)">
|
||||
<el-radio label="express">快递配送</el-radio>
|
||||
<el-radio label="noNeed">无需发货</el-radio>
|
||||
<el-radio label="merchant">商家送货</el-radio>
|
||||
<el-radio label="merchant" v-if="!isPlatform && checkPermi(['merchant:delivery:personnel:page'])">商家送货</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<SendFrom :formItem="formItem" :isShowBtn="true"></SendFrom>
|
||||
@@ -109,6 +109,7 @@ import SendFrom from './components/sendFrom';
|
||||
import { useLogistics } from '@/hooks/use-order';
|
||||
import { postRules } from '@/views/merchantOrder/default';
|
||||
import { OrderSecondTypeEnum } from '@/enums/productEnums';
|
||||
import { isPlatform } from '@/utils/settingMer';
|
||||
const defaultObj = {
|
||||
deliveryType: 'express',
|
||||
isSplit: false,
|
||||
@@ -169,6 +170,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPlatform,
|
||||
OrderSecondTypeEnum: OrderSecondTypeEnum,
|
||||
productList: [],
|
||||
formItem: { ...defaultObj },
|
||||
@@ -222,7 +224,15 @@ export default {
|
||||
limit: 50,
|
||||
openStatus: true,
|
||||
};
|
||||
this.express = await useLogistics(params);
|
||||
if (typeof useLogistics !== 'function') {
|
||||
this.express = [];
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.express = await useLogistics(params);
|
||||
} catch (e) {
|
||||
this.express = [];
|
||||
}
|
||||
this.express.map((item) => {
|
||||
if (item.isDefault) this.formItem.expressCode = item.code;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user