Browse Source

新增上传组件的图片压缩

dev-xx
qb 8 months ago
parent
commit
9418a5a5c3
  1. 2
      src/option/distribution/addVehicleStowage.js
  2. 6
      src/views/aftersales/aftersalesWorkOrder.vue
  3. 37
      src/views/aftersales/aftersalesWorkOrderAdd.vue
  4. 4211
      src/views/aftersales/aftersalesWorkOrderAddCopy.vue
  5. 34
      src/views/aftersales/aftersalesWorkOrderAddTemp.vue
  6. 526
      src/views/aftersales/aftersalesWorkOrderInfo.vue
  7. 6
      src/views/aftersales/aftersalesWorkOrderInfoEnxt.vue
  8. 11
      src/views/aftersales/aftersalesWorkOrderInfoTemp.vue
  9. 43
      src/views/aftersales/aftersalesWorkOrderend.vue
  10. 461
      src/views/aftersales/aftersalesWorkOrdermodify.vue
  11. 197
      src/views/aftersales/aftersalesWorkOrdermodifyTemp.vue
  12. 97
      src/views/aftersales/customerService.vue
  13. 13
      src/views/basic/forklift/basicForklift.vue
  14. 605
      src/views/basic/forklift/basicForklift2.vue
  15. 14
      src/views/basic/pda/basicPda2.vue
  16. 10
      src/views/basic/pda/basicPdatt.vue
  17. 457
      src/views/basicdata/brand/basicClientFrom.vue
  18. 78
      src/views/basicdata/driverArtery/basicdataDriverArteryAdd.vue
  19. 6
      src/views/basicdata/warehouse/tray/basicdataTray.vue
  20. 16
      src/views/basicdata/warehouse/warehouse/basicdataWarehouseTemp.vue
  21. 649
      src/views/datadetail/ToolUpdate.vue
  22. 11
      src/views/distribution/artery/TripartiteTransfer.vue
  23. 24
      src/views/distribution/artery/VehicleStowageDetails.vue
  24. 15
      src/views/distribution/artery/directGoMarketDetails.vue
  25. 26
      src/views/distribution/deliverylist/distributionDeliveryListedt.vue
  26. 12
      src/views/distribution/inventory/distrilbutionBillLading.vue
  27. 160
      src/views/distribution/signfor/distributionSignforedt.vue
  28. 16
      src/views/finance/SettlementInformation.vue
  29. 16
      src/views/finance/SettlementTransactionInformation.vue
  30. 16
      src/views/finance/TransactionInformation.vue
  31. 16
      src/views/finance/WaybillAudit.vue
  32. 18
      src/views/supervise/IndicatorList.vue
  33. 12
      src/views/supervise/management.vue
  34. 13
      src/views/system/pdaversion/pdaversionManage.vue
  35. 16
      src/views/waybill/WaybillOrderList.vue

2
src/option/distribution/addVehicleStowage.js

@ -1056,7 +1056,6 @@ export const detailsColumnList = [
{ label: '已审核', value: '1' },
],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
@ -1081,6 +1080,5 @@ export const detailsColumnList = [
fixed: false,
sortable: true,
isColumnMerge: true,
isshowSummary: false,
},
];

6
src/views/aftersales/aftersalesWorkOrder.vue

@ -1086,6 +1086,7 @@ import {
customerserviceColumnList,
} from '@/option/aftersales/vueTvemp.js';
import { processRowProperty, isNumber, computeNumber, setNodeHeight } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { useRouter } from 'vue-router';
import { downloadXls, deepClone } from '@/utils/util';
import dayjs from 'dayjs';
@ -1949,7 +1950,7 @@ const AddInfo = () => {
$router.push('/aftersales/aftersalesWorkOrderAdd');
};
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload =async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
@ -1958,7 +1959,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile)
return res;
};
//
const ConfirmForm = () => {

37
src/views/aftersales/aftersalesWorkOrderAdd.vue

@ -741,6 +741,7 @@ import {
} from '@/api/aftersales/aftersalesWorkOrder';
import { useRouter, useRoute } from 'vue-router';
import { getDetailWarehouse, getDeptWarehouse } from '@/api/basicdata/basicdataWarehouse'; //
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { deepClone } from '@/utils/util';
import { getToken } from '@/utils/auth';
const $router = useRouter();
@ -1171,7 +1172,7 @@ const action = computed(() => {
return '/api/blade-resource/oss/endpoint/put-file';
});
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
console.log(rawFile, '图片上传前回调');
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('只能上传格式为PNG/JPG的图片!');
@ -1180,7 +1181,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('图片大小不能大于3MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
// //
// const Imgpreview = value => {
@ -1525,9 +1527,9 @@ const onSubmit = () => {
//
if (form.value.groundlineType == '1') {
form.value.responsibilitiesList.forEach(item => {
let businesTemp = item.Responsibleoptions.find(res => res.value == item.businessId); //
let businesTemp = item.Responsibleoptions.find(res => res.value == item.businessId); //
submitData['processorEntityList'].push({
businessName:businesTemp?businesTemp.label:item.businessId, //
businessName: businesTemp ? businesTemp.label : item.businessId, //
businessId: item.businessId, //ID
conditions: 1, //
typesOf: 1, //1 2
@ -1619,23 +1621,26 @@ const onSubmit = () => {
let PlayName = []; //
if (form.value.Claimamount.length) {
form.value.Claimamount.forEach(item => {
let resultTypeValue = Processingresultsoptions.value.find(res => res.label == item.title).value
if(item.compensationMethod){
let resultTypeValue = Processingresultsoptions.value.find(
res => res.label == item.title
).value;
if (item.compensationMethod) {
PlayName.push(
item.Paymentmethod.find(res => res.value == item.compensationMethod).label
);
item.Paymentmethod.find(res => res.value == item.compensationMethod).label
);
}
submitData.aftersalesProcessingResultsDTO['processingMoneyEntityList'].push({
compensationMethodName: item.Paymentmethod.find(
res => res.value == item.compensationMethod
).label, //
compensationMethod:item.compensationMethod, //value
compensationTime:item.compensationTime, //
money:item.money, //
paymentUnit:item.paymentUnit, //
resultName:item.title, //
resultType:ProcessingresultsoptiTons.value.find(res => res.label == item.title).value, // value
resultType:resultTypeValue?resultypeValue.value:null, // value
compensationMethod: item.compensationMethod, //value
compensationTime: item.compensationTime, //
money: item.money, //
paymentUnit: item.paymentUnit, //
resultName: item.title, //
resultType: ProcessingresultsoptiTons.value.find(res => res.label == item.title)
.value, // value
resultType: resultTypeValue ? resultypeValue.value : null, // value
typesOf: 1, //
});
});
@ -1662,7 +1667,7 @@ const onSubmit = () => {
if (form.value.Processed) {
submitData.workOrderStatus = 30;
}
delete submitData.result; //
delete submitData.result; //
//()
delete submitData.processor;
console.log(submitData, '处理好的参数');

4211
src/views/aftersales/aftersalesWorkOrderAddCopy.vue

File diff suppressed because it is too large Load Diff

34
src/views/aftersales/aftersalesWorkOrderAddTemp.vue

@ -666,6 +666,7 @@ import {
$_getAbnormalPackage,
$_shippingInformation,
} from '@/api/aftersales/aftersalesWorkOrder';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { computeNumber } from '@/utils/util';
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import { getToken } from '@/utils/auth';
@ -792,7 +793,7 @@ const ImgSuccess = (response, uploadFile) => {
};
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
@ -801,7 +802,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
//
const pictureList = val => {
@ -985,32 +987,6 @@ function DeliveryTrainnumber() {
}
return;
console.log(Indexform.value.trainNumber, '车次号');
if (!Indexform.value.trainNumber && !Indexform.value.deliveryTime) {
Indexform.value.deliveryTime = null;
Indexform.value.deliveryDriver = '';
DeliveryDriver.value = [];
}
if (!Indexform.value.trainNumber && !Indexform.value.deliveryTime) {
return;
}
let data = {
trainNumber: Indexform.value.trainNumber,
taskTime: Indexform.value.deliveryTime,
};
data.current = 1; //
data.size = 200; //
$_shippingInformation(data).then(res => {
console.log(res, '查询返回值');
DeliveryDriver.value = res.data.data.records; //
//
if (res.data.data.records.length == 1 && groundlineType.value != 3) {
Indexform.value.deliveryTime = res.data.data.records[0].taskTime; //
Indexform.value.deliveryDriver = res.data.data.records[0].id; //
// Indexform.value.trainNumber = res.data.data.records[0].trainNumber; //
}
});
}
//
const TotalChange = () => {
@ -1525,7 +1501,7 @@ const ConfirmForm = () => {
delete DataSubmit.processor; //
console.log(DataSubmit, '处理好的数据');
// stringify
Addloading.value = true; //
$_submit(DataSubmit)
.then(res => {

526
src/views/aftersales/aftersalesWorkOrderInfo.vue

@ -111,13 +111,12 @@
<el-tab-pane label="基础信息">
<div class="el_information">
<div class="el_information_row">
<el-form-item label="车次号" v-if="displaySettings.trainNumber">
<el-tooltip
:content="item.trainNumber ? item.trainNumber : '车次号'"
placement="top"
>
<el-input v-model="Indexform.trainNumber" />
<el-input v-model="Indexform.trainNumber" />
</el-tooltip>
</el-form-item>
@ -335,7 +334,7 @@
</el-tab-pane>
</el-tabs>
</el-form>
<el-tabs
type="border-card"
class="el_Processingresults"
@ -428,11 +427,7 @@
</el-tabs>
<!-- 完结信息 -->
<el-tabs
type="border-card"
class="demo-tabs el-endtabs"
v-if='Completionpermissions'
>
<el-tabs type="border-card" class="demo-tabs el-endtabs" v-if="Completionpermissions">
<el-tab-pane>
<template #label>
<span class="custom-tabs-label">
@ -462,8 +457,8 @@
/>
</el-select>
</div>
<!-- 责任人 -->
<div class="sk_input" v-if="item.state == 0">
<!-- 责任人 -->
<div class="sk_input" v-if="item.state == 0">
<span>责任人</span>
<el-tooltip
:content="
@ -492,7 +487,6 @@
<el-input v-model="item.num" disabled />
</el-tooltip>
</div>
<div class="sk_input" v-if="item.state == 1"></div>
</div>
@ -543,6 +537,7 @@
:on-preview="pictureList"
:on-remove="ImgListRemove"
:action="doubledCount"
:before-upload="beforeAvatarUpload"
multiple
drag
class="el-picture-card"
@ -581,7 +576,7 @@
<el-button type="primary" v-if="PermissionButton.work_order_completion" @click="EndJump"
>完结工单</el-button
>
>
<el-button type="primary" v-if="PermissionButton.repulse" @click="BatchReturn"
>打回</el-button
>
@ -745,49 +740,44 @@
</div>
</el-affix>
</div>
<!-- 结果打回弹窗 -->
<el-dialog v-model="dialogReturn" title="结果打回" width="40%" draggable class="plAllret">
<el-form
v-loading="repulse"
element-loading-text="正在打回中..."
label-position="top"
label-width="100px"
:model="BatchFrom"
>
<el-form-item label="打回原因">
<el-input v-model="BatchFrom.txt" type="textarea" :rows="4" />
</el-form-item>
<el-form-item label="流转营业部">
<el-select
v-model="BatchFrom.businessDepartment"
multiple
filterable
default-first-option
:reserve-keyword="false"
placeholder="请选择活动区域"
>
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogReturn = false">取消</el-button>
<el-button type="primary" @click="ConfirmReturn" :disabled="repulse">
确定
</el-button>
</span>
</template>
</el-dialog>
<!-- 结果打回弹窗 -->
<el-dialog v-model="dialogReturn" title="结果打回" width="40%" draggable class="plAllret">
<el-form
v-loading="repulse"
element-loading-text="正在打回中..."
label-position="top"
label-width="100px"
:model="BatchFrom"
>
<el-form-item label="打回原因">
<el-input v-model="BatchFrom.txt" type="textarea" :rows="4" />
</el-form-item>
<el-form-item label="流转营业部">
<el-select
v-model="BatchFrom.businessDepartment"
multiple
filterable
default-first-option
:reserve-keyword="false"
placeholder="请选择活动区域"
>
<el-option
v-for="item in warehouseData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogReturn = false">取消</el-button>
<el-button type="primary" @click="ConfirmReturn" :disabled="repulse"> 确定 </el-button>
</span>
</template>
</el-dialog>
</template>
<script setup>
@ -809,7 +799,8 @@ import {
} from '@/api/aftersales/aftersalesWorkOrder';
import { ref, reactive, computed, onMounted } from 'vue';
import { getToken } from '@/utils/auth';
import {AddressClosed, deepClone } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { AddressClosed, deepClone } from '@/utils/util';
const $router = useRouter();
const $route = useRoute();
const Indexform = ref({
@ -948,7 +939,6 @@ onMounted(() => {
}, 0);
});
// //
// const PermissionButton = computed(() => {
@ -1028,10 +1018,10 @@ const Chathistory = res => {
id: $route.query.id,
})
.then(res => {
MessageContent.value = []; //
MessageContent.value = []; //
res.data.data.surveyRecordEntities.forEach(item => {
if(item.pictureUrl){
filetype = Fileidentifier(item.pictureUrl);
if (item.pictureUrl) {
filetype = Fileidentifier(item.pictureUrl);
}
MessageContent.value.push({
time: item.createTime, //
@ -1041,7 +1031,7 @@ const Chathistory = res => {
img: filetype == 'png' ? item.pictureUrl : '',
file: filetype == 'docx' ? item.pictureUrl : '',
mp4: filetype == 'mp4' ? item.pictureUrl : '',
imgList:[filetype === 'png' ? item.pictureUrl : ''],
imgList: [filetype === 'png' ? item.pictureUrl : ''],
difference: item.difference,
identifying: false, //
});
@ -1114,17 +1104,20 @@ const handle = () => {
});
};
//
const Completionpermissions =computed(()=>{
if(CompensationParty.value.length){
console.log(CompletedView.value,'CompletedView.value');
if(CompletedView.value.includes(Mydata.value.id) || UserPermissions.value!='仓库客服'){
console.log(CompletedView.value.includes(Mydata.id),'CompletedView.value.includes(Mydata.id)');
return true
}else{
return false
const Completionpermissions = computed(() => {
if (CompensationParty.value.length) {
console.log(CompletedView.value, 'CompletedView.value');
if (CompletedView.value.includes(Mydata.value.id) || UserPermissions.value != '仓库客服') {
console.log(
CompletedView.value.includes(Mydata.id),
'CompletedView.value.includes(Mydata.id)'
);
return true;
} else {
return false;
}
}
})
}
});
const onLoad = () => {
pageState.value = true; //
if (localStorage.getItem('my_data')) {
@ -1153,7 +1146,6 @@ const onLoad = () => {
console.log(appeal.value, 'appeal.value');
}
console.log(res, '回显返回值参数');
Indexform.value = res.data.data;
@ -1190,39 +1182,37 @@ const onLoad = () => {
//
let sum = 0;
groundlineType.value = res.data.data.discoveryNode; //
if(res.data.data.personResponsibleVOS?.length){
if (res.data.data.personResponsibleVOS?.length) {
res.data.data.personResponsibleVOS.forEach(item => {
sum = Number(item.responsibilityRatio) + sum;
});
FangAddList.value = res.data.data.personResponsibleVOS.map(res => {
return {
businessName: res.businessId, //ID
personResponsibleName: res.personResponsibleName, //
responsibilityRatio: res.responsibilityRatio + '%', //
description: res.description, //
tripartite: res.tripartite, //
};
});
sum = Number(item.responsibilityRatio) + sum;
});
FangAddList.value = res.data.data.personResponsibleVOS.map(res => {
return {
businessName: res.businessId, //ID
personResponsibleName: res.personResponsibleName, //
responsibilityRatio: res.responsibilityRatio + '%', //
description: res.description, //
tripartite: res.tripartite, //
};
});
}
// /
if(res.data.data.processorVOList?.length){
if (res.data.data.processorVOList?.length) {
res.data.data.processorVOList.forEach(item => {
if (item) {
if (item.typesOf == 2) {
//
Indexform.value.processor.push(item.businessId);
} else {
//
Indexform.value.processorEntityList.push(item.businessId);
if (item) {
if (item.typesOf == 2) {
//
Indexform.value.processor.push(item.businessId);
} else {
//
Indexform.value.processorEntityList.push(item.businessId);
}
}
}
});
});
}
companyProportion.value = 100 - sum;
getDictionaryBiz('result_handling').then(res => {
console.log(res, '发现环节');
@ -1284,7 +1274,7 @@ const onLoad = () => {
// explains: item.explains, //
cld: index + 1,
id: item.id,
warehouseId:item.warehouseId, //
warehouseId: item.warehouseId, //
});
});
}
@ -1292,7 +1282,7 @@ const onLoad = () => {
//
if (CompensationParty.value.length) {
CompletedView.value = CompensationParty.value.map(item => {
console.log(CompensationParty.value,'CompensationParty.value');
console.log(CompensationParty.value, 'CompensationParty.value');
if (item.warehouseId) {
return item.warehouseId;
}
@ -1303,7 +1293,6 @@ const onLoad = () => {
});
});
//
console.log(Mydata.value, '记录本地登录');
getDictionaryBiz('result_handling').then(res => {
@ -1320,125 +1309,118 @@ const onLoad = () => {
onLoad(); //
const isAppeal = appeal.value;
const userRole = UserPermissions.value;//
const routeIndex = $route.query.RouteIndexs;//
const workOrderStatus = $route.query.workOrderStatus;//
const isWarehouseCustomerService = userRole === '仓库客服';//
const isHeadquarterCustomerServiceManager = userRole === '总部客服经理';//
const userRole = UserPermissions.value; //
const routeIndex = $route.query.RouteIndexs; //
const workOrderStatus = $route.query.workOrderStatus; //
const isWarehouseCustomerService = userRole === '仓库客服'; //
const isHeadquarterCustomerServiceManager = userRole === '总部客服经理'; //
const isWarehouseIdState = warehouseIdState.value;
//
const isProcessingResults=()=>{
if(workOrderStatus =='10' || workOrderStatus === '20'){
return true
}
}
const isProcessingResults = () => {
if (workOrderStatus == '10' || workOrderStatus === '20') {
return true;
}
};
//
const isWorkOrderCompletion=()=>{
if(UserPermissions.value != '仓库客服'){
if(workOrderStatus == '30'){
return true
const isWorkOrderCompletion = () => {
if (UserPermissions.value != '仓库客服') {
if (workOrderStatus == '30') {
return true;
}
}
}
};
//
const isRepulse=()=> {
if(UserPermissions.value == '总部客服经理'){
if(workOrderStatus == '40'){
return true
const isRepulse = () => {
if (UserPermissions.value == '总部客服经理') {
if (workOrderStatus == '40') {
return true;
}
}
}
};
//
const Resultreturned=()=>{
if(UserPermissions.value == '总部客服'){
if(workOrderStatus == '30'){
return true
const Resultreturned = () => {
if (UserPermissions.value == '总部客服') {
if (workOrderStatus == '30') {
return true;
}
}
}
}
};
//
const isApplyArbitration=()=>{
if(UserPermissions.value != '仓库客服'){
if( workOrderStatus === '70'){
return true
const isApplyArbitration = () => {
if (UserPermissions.value != '仓库客服') {
if (workOrderStatus === '70') {
return true;
}
}
}
};
//
const isInformationEditing=()=>{
return false
if(workOrderStatus === '10'){
//
if( warehouseIdState.value){
return true
}
}
}
const isInformationEditing = () => {
return false;
};
//
const isProcessingConfirmation=()=>{
if(UserPermissions.value != '仓库客服'){
if(workOrderStatus =='40'){
return true
}
const isProcessingConfirmation = () => {
if (UserPermissions.value != '仓库客服') {
if (workOrderStatus == '40') {
return true;
}
}
}
};
//
const isResultDetermination=()=>{
if(workOrderStatus == '21'){
return true
const isResultDetermination = () => {
if (workOrderStatus == '21') {
return true;
}
}
};
//
const isConfirmReview = () => {
if(UserPermissions.value == '总部客服经理'){
if(workOrderStatus == '500'){
return true
if (UserPermissions.value == '总部客服经理') {
if (workOrderStatus == '500') {
return true;
}
}
}
};
//
const Appealestablished=()=>{
if(UserPermissions.value == '总部客服经理'){
if($route.query.typesOf=='0'){
return true
const Appealestablished = () => {
if (UserPermissions.value == '总部客服经理') {
if ($route.query.typesOf == '0') {
return true;
}
}
}
};
//
const Appealrejection=()=>{
if(UserPermissions.value == '总部客服经理'){
if($route.query.typesOf=='0'){
return true
const Appealrejection = () => {
if (UserPermissions.value == '总部客服经理') {
if ($route.query.typesOf == '0') {
return true;
}
}
}
};
//
const PermissionButton = computed(() => ({
reply: true, //
Processing_results: isProcessingResults(),//
work_order_completion: isWorkOrderCompletion(),//
repulse: isRepulse(),//
result_returned:Resultreturned(),//
apply_arbitration: isApplyArbitration(),//
information_editing: isInformationEditing(),//
Processing_results: isProcessingResults(), //
work_order_completion: isWorkOrderCompletion(), //
repulse: isRepulse(), //
result_returned: Resultreturned(), //
apply_arbitration: isApplyArbitration(), //
information_editing: isInformationEditing(), //
Appeal_established: Appealestablished(), //
Appeal_rejection: Appealrejection(), //
Processing_confirmation: isProcessingConfirmation(), //
Result_determination: isResultDetermination(), //
Confirm_review: isConfirmReview(),//
Confirm_review: isConfirmReview(), //
}));
//
const Processingrelease = () => {
if (Indexform.value.processor.length == 1 && Mydata.value.id == Indexform.value.processor[0]) {
@ -1461,6 +1443,19 @@ const Chatrefresh = () => {
Chathistory();
};
//
const beforeAvatarUpload = async rawFile => {
if (!/^image\/(png|jpeg|gif)$|^video\/mp4$/.test(rawFile.type)) {
ElMessage.error('上传格式只支持 png、jpeg、gif 和 mp4 类型!');
return false;
} else if (rawFile.size / 1024 / 1024 > 40) {
ElMessage.error('上传大小不能超过 40MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
//
//
const addireply = () => {
@ -1484,7 +1479,7 @@ const addingRecord = () => {
id: $route.query.id,
name: $route.query.workOrderNumber + '-添加异常记录',
businessId: $route.query.workOrderNumber,
RouteIndexs: $route.query.RouteIndexs,//
RouteIndexs: $route.query.RouteIndexs, //
RouterState: 'determine',
workOrderStatus: $route.query.workOrderStatus, //
},
@ -1500,41 +1495,41 @@ const EndJump = () => {
id: $route.query.id,
name: $route.query.workOrderNumber + '-完结填写',
RouterState: 'end',
RouteIndexs:$route.query.RouteIndexs,
RouteIndexs: $route.query.RouteIndexs,
workOrderStatus: $route.query.workOrderStatus, //
},
});
};
//
const resultreturnedFun=()=>{
BatchFrom.value.businessDepartment =[];
const resultreturnedFun = () => {
BatchFrom.value.businessDepartment = [];
BatchFrom.value.txt = null;
dialogReturn.value = true;
}
};
//
const ConfirmReturn=()=>{
const ConfirmReturn = () => {
//
let data = {
processorList: [],
};
//
if(BatchFrom.value.businessDepartment.length){
if (BatchFrom.value.businessDepartment.length) {
let foundObjs = warehouseData.value.filter(obj =>
BatchFrom.value.businessDepartment.includes(obj.value)
);
data['businessId'] = foundObjs.map(item => item.value).join(',');
data['businessName'] = foundObjs.map(item => item.label).join(',');
//
foundObjs.forEach(item => {
data['processorList'].push({ id: item.value, name: item.label });
});
BatchFrom.value.businessDepartment.includes(obj.value)
);
data['businessId'] = foundObjs.map(item => item.value).join(',');
data['businessName'] = foundObjs.map(item => item.label).join(',');
//
foundObjs.forEach(item => {
data['processorList'].push({ id: item.value, name: item.label });
});
}
data.reasonReturn = BatchFrom.value.txt; //
data.workOrderIds =[$route.query.id]; //
data.workOrderIds = [$route.query.id]; //
console.log(data, '处理好的值');
data.typesOf='1';//
data.typesOf = '1'; //
pageState.value = true; //
dialogReturn.value = false; //
$_batchReturn(data)
@ -1546,58 +1541,59 @@ const ConfirmReturn=()=>{
type: 'success',
});
//
$useStore.commit('EDIT_REFRESHITEM', {title: 'aftersalesWorkOrder',status: true,});//
$useStore.commit('Customer_Menu',Number($route.query.RouteIndexs));//
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: true }); //
$useStore.commit('Customer_Menu', Number($route.query.RouteIndexs)); //
$router.push('/aftersales/aftersalesWorkOrder');
AddressClosed('/aftersales/aftersalesWorkOrderend'); //
}
})
.catch(error => {
console.log(error, 'error');
}).finally(()=>{
})
.finally(() => {
pageState.value = false; //
dialogReturn.value = false; //
});
}
};
//
const BatchReturn = () => {
ElMessageBox.prompt('请输入打回原因', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern:/^(?!\s*$).+/,
inputPattern: /^(?!\s*$).+/,
inputErrorMessage: '内容不能为空哦',
})
.then(({ value }) => {
pageState.value=true
pageState.value = true;
$_batchRepulseCompleted({
workOrderIds:[$route.query.id],
reasonReturn:value
}).then(res=>{
if(res.data.code ==200){
ElMessage({
message: res.data.msg,
type: 'success',
})
$useStore.commit('EDIT_REFRESHITEM', {
title: 'aftersalesWorkOrder',
status: true,
});
$useStore.commit('Customer_Menu',9);//
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({
path: '/aftersales/aftersalesWorkOrder',
workOrderIds: [$route.query.id],
reasonReturn: value,
})
.then(res => {
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
$useStore.commit('EDIT_REFRESHITEM', {
title: 'aftersalesWorkOrder',
status: true,
});
$useStore.commit('Customer_Menu', 9); //
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({
path: '/aftersales/aftersalesWorkOrder',
});
}
})
.catch(error => {
console.log(error);
})
.finally(() => {
pageState.value = false;
});
}
}).catch((error)=>{
console.log(error);
}).finally(()=>{
pageState.value=false
})
})
.catch(() => {
})
.catch(() => {});
};
//
const CustomerServiceCompleted = () => {
@ -1647,7 +1643,7 @@ const AppealEstablished = () => {
workOrderStatus: $route.query.workOrderStatus, //
Appealeditor: 'appeal', //
appealID: $route.query.appealID, //ID
typesOf:$route.query.typesOf,//012
typesOf: $route.query.typesOf, //012
},
});
};
@ -1657,45 +1653,45 @@ const AppealRejection = () => {
ElMessageBox.prompt('请填写驳回原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern:/^(?!\s*$).+/,
inputPattern: /^(?!\s*$).+/,
inputErrorMessage: '内容不能为空哦',
})
.then(({ value }) => {
console.log(value, '驳回原因');
let data = {
id: $route.query.appealID, //ID
typesOf: '2', //
workOrderId: $route.query.id, //ID
handlingReason:value,//
};
$_Cancelappeal(data)
.then(res => {
console.log(res, '申诉驳回返回值');
if (res.data.code == 200) {
ElMessage({
showClose: true,
message: '申诉驳回成功',
type: 'success',
});
$useStore.commit('EDIT_REFRESHITEM', {
title: 'aftersalesWorkOrder',
status: true,
});
$useStore.commit('Customer_Menu',6);//
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({
path: '/aftersales/aftersalesWorkOrder',
console.log(value, '驳回原因');
let data = {
id: $route.query.appealID, //ID
typesOf: '2', //
workOrderId: $route.query.id, //ID
handlingReason: value, //
};
$_Cancelappeal(data)
.then(res => {
console.log(res, '申诉驳回返回值');
if (res.data.code == 200) {
ElMessage({
showClose: true,
message: '申诉驳回成功',
type: 'success',
});
$useStore.commit('EDIT_REFRESHITEM', {
title: 'aftersalesWorkOrder',
status: true,
});
$useStore.commit('Customer_Menu', 6); //
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({
path: '/aftersales/aftersalesWorkOrder',
});
}
})
.catch(res => {
console.log('错误信息', res);
})
.finally(() => {
Pageloading.value = false; //
});
}
})
.catch(res => {
console.log('错误信息', res);
})
.finally(() => {
Pageloading.value = false; //
});
})
.catch(() => {})
.catch(() => {});
};
//
@ -1724,11 +1720,11 @@ const ResultConfirmation = () => {
});
}
$useStore.commit('EDIT_REFRESHITEM', {
title: 'aftersalesWorkOrder',
status: true,
});
$useStore.commit('Customer_Menu', 9); //
$useStore.commit('DEL_TAG_CURRENT'); //
title: 'aftersalesWorkOrder',
status: true,
});
$useStore.commit('Customer_Menu', 9); //
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({
path: '/aftersales/aftersalesWorkOrder',
});
@ -2666,11 +2662,11 @@ const ResultDetermination = () => {
display: flex;
padding: 6px;
}
.el-overlay{
.el-image{
width: 100% !important;
}
}
.el-overlay {
.el-image {
width: 100% !important;
}
}
}
.el-tabs__content {

6
src/views/aftersales/aftersalesWorkOrderInfoEnxt.vue

@ -724,6 +724,7 @@ import {
} from '@/api/aftersales/aftersalesWorkOrder';
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import { AddressClosed } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
import { computeNumber, isNumber } from '@/utils/util';
import { useStore } from 'vuex';
@ -915,7 +916,7 @@ const ImgSuccess = (response, uploadFile) => {
};
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
@ -923,7 +924,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
//
const pictureList = val => {

11
src/views/aftersales/aftersalesWorkOrderInfoTemp.vue

@ -534,8 +534,8 @@
<el-button @click="EditInformation">信息编辑</el-button>
</div>
<!-- <div class="foot_btn" v-if="appeal && AppealReview"> -->
<el-button type="primary" @click="AppealEstablished">申诉成立 </el-button>
<el-button type="primary" @click="AppealRejection">申诉驳回 </el-button>
<el-button type="primary" @click="AppealEstablished">申诉成立 </el-button>
<el-button type="primary" @click="AppealRejection">申诉驳回 </el-button>
<!-- </div> -->
</el-card>
<!-- 批量打回弹窗 -->
@ -598,7 +598,7 @@ import {
$_Cancelappeal,
} from '@/api/aftersales/aftersalesWorkOrder';
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
const $router = useRouter();
const $route = useRoute();
@ -891,7 +891,7 @@ const ButtonPermissions = computed(() => {
});
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
@ -899,7 +899,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
//
const pictureList = val => {

43
src/views/aftersales/aftersalesWorkOrderend.vue

@ -828,7 +828,6 @@
</el-affix>
</div>
<el-dialog v-model="dialogHistoricalPackage" title="查看历史包件" width="30%">
<el-form-item label="历史包件选择">
<el-select v-model="HistoricalPackageinput" clearable filterable placeholder="请选择包件">
@ -898,6 +897,7 @@ import { getToken } from '@/utils/auth';
import { useRoute, useRouter } from 'vue-router';
import { getDictionaryBiz } from '@/api/system/dict';
import { computeNumber, isNumber, AddressClosed, deepClone } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { useStore } from 'vuex';
// vuex
const $useStore = useStore();
@ -1399,22 +1399,21 @@ watch($route, (to, from) => {
//
const Fileidentifier = val => {
if(val){
const url = val;
const fileName = url.substring(url.lastIndexOf('/') + 1);
const extension = fileName.substring(fileName.lastIndexOf('.') + 1);
if (extension === 'mp4') {
return 'mp4';
}
if (extension === 'png') {
return 'png';
}
if (extension === 'docx') {
return 'docx';
}
return undefined; // undefined
if (val) {
const url = val;
const fileName = url.substring(url.lastIndexOf('/') + 1);
const extension = fileName.substring(fileName.lastIndexOf('.') + 1);
if (extension === 'mp4') {
return 'mp4';
}
if (extension === 'png') {
return 'png';
}
if (extension === 'docx') {
return 'docx';
}
return undefined; // undefined
}
};
//
//
@ -1437,7 +1436,7 @@ const Chathistory = res => {
mp4: filetype === 'mp4' ? item.pictureUrl : '',
imgList: [filetype === 'png' ? item.pictureUrl : ''],
difference: item.difference,
identifying: identifying //
identifying: identifying, //
});
});
@ -1483,7 +1482,6 @@ const Chathistory = res => {
}
};
onLoad();
onMounted(() => {
msgHight.value = window.innerHeight * 0.76;
@ -1534,7 +1532,7 @@ const changeProcessingResults = value => {
const displaySettings = computed(() => {
const discoveryNode = endFrom.value.discoveryNode;
const includesDiscoveryNode = (values) => values.includes(discoveryNode);
const includesDiscoveryNode = values => values.includes(discoveryNode);
return {
trainNumber: includesDiscoveryNode(['3', '5', '7', '6']), //
deliveryTime: includesDiscoveryNode(['5', '7', '6']), //
@ -1608,7 +1606,7 @@ const ViodSuccess = response => {
}
};
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
if (!/^image\/(png|jpeg|gif)$|^video\/mp4$/.test(rawFile.type)) {
ElMessage.error('上传格式只支持 png、jpeg、gif 和 mp4 类型!');
return false;
@ -1616,7 +1614,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('上传大小不能超过 40MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
//
const pictureList = val => {
@ -1823,8 +1822,6 @@ const PaymentSelection = val => {
ZFname.value = val.name; //
};
//
const submitresults = async value => {
let _title = value == 1 ? '提交' : '保存';

461
src/views/aftersales/aftersalesWorkOrdermodify.vue

@ -77,7 +77,6 @@
class="demo-tabs Packagebox"
@tab-click="handleClick"
v-loading="form.Packageloading"
>
<el-tab-pane label="包件信息" name="0">
<template v-for="(item, index) in form.PackageList" :key="index">
@ -104,7 +103,12 @@
:prop="`PackageList[${index}.waybillNumber]`"
:rules="ruleForm.waybillNumber"
>
<el-input v-model="item.waybillNumber" placeholder="请输入运单号" clearable :disabled="workOrderStatus != NumberState.Numbe_ten"/>
<el-input
v-model="item.waybillNumber"
placeholder="请输入运单号"
clearable
:disabled="workOrderStatus != NumberState.Numbe_ten"
/>
</el-form-item>
<el-form-item
@ -112,7 +116,12 @@
:prop="`PackageList[${index}.orderCode]`"
:rules="ruleForm.orderCode"
>
<el-input v-model="item.orderCode" placeholder="请输入订单自编号" clearable :disabled="workOrderStatus != NumberState.Numbe_ten"/>
<el-input
v-model="item.orderCode"
placeholder="请输入订单自编号"
clearable
:disabled="workOrderStatus != NumberState.Numbe_ten"
/>
</el-form-item>
<el-form-item
@ -120,7 +129,12 @@
:prop="`PackageList[${index}.first]`"
:rules="ruleForm.first"
>
<el-input v-model="item.first" placeholder="请输入一级品" clearable :disabled="workOrderStatus != NumberState.Numbe_ten" />
<el-input
v-model="item.first"
placeholder="请输入一级品"
clearable
:disabled="workOrderStatus != NumberState.Numbe_ten"
/>
</el-form-item>
<el-form-item
@ -128,7 +142,12 @@
:prop="`PackageList[${index}.secondary]`"
:rules="ruleForm.secondary"
>
<el-input v-model="item.secondary" placeholder="请输入二级品" clearable :disabled="workOrderStatus != NumberState.Numbe_ten" />
<el-input
v-model="item.secondary"
placeholder="请输入二级品"
clearable
:disabled="workOrderStatus != NumberState.Numbe_ten"
/>
</el-form-item>
<el-form-item
@ -149,17 +168,16 @@
style="width: 20%; display: flex"
>
<el-button
v-if="!index && workOrderStatus == NumberState.Numbe_ten"
v-if="!index && workOrderStatus == NumberState.Numbe_ten"
type="primary"
class="el_addPackage"
@click="Addpackages"
style="margin-top: 2px"
>
<el-icon><Plus /></el-icon></el-button
>
<el-button
v-if="index && workOrderStatus == NumberState.Numbe_ten"
v-if="index && workOrderStatus == NumberState.Numbe_ten"
type="primary"
class="el_addPackage"
style="margin-top: 2px"
@ -327,7 +345,12 @@
prop="basis.waybillMall"
v-if="displaySettings.waybillMall"
>
<el-input v-model="form.basis.waybillMall" placeholder="请输入运单商场" clearable :disabled="workOrderStatus != NumberState.Numbe_ten"/>
<el-input
v-model="form.basis.waybillMall"
placeholder="请输入运单商场"
clearable
:disabled="workOrderStatus != NumberState.Numbe_ten"
/>
</el-form-item>
<!-- 初始必填 -->
<el-form-item
@ -495,7 +518,12 @@
:prop="`responsibilitiesList[${index}.tripartite]`"
:rules="ruleForm.tripartite"
>
<el-input v-model="item.tripartite" placeholder="请输入三方责任人" clearable :disabled="workOrderStatus != NumberState.Numbe_ten"/>
<el-input
v-model="item.tripartite"
placeholder="请输入三方责任人"
clearable
:disabled="workOrderStatus != NumberState.Numbe_ten"
/>
</el-form-item>
<el-form-item
label="说明"
@ -515,7 +543,7 @@
</el-form-item>
<el-button
v-if="!index && (workOrderStatus == NumberState.Numbe_ten)"
v-if="!index && workOrderStatus == NumberState.Numbe_ten"
type="primary"
class="el_addPackage"
@click="AddResponsible"
@ -525,7 +553,7 @@
>
<el-button
style="margin-top: 2px"
v-if="index && (workOrderStatus == NumberState.Numbe_ten)"
v-if="index && workOrderStatus == NumberState.Numbe_ten"
type="primary"
@click="Responsemoval(index)"
>
@ -549,8 +577,11 @@
class="demo-tabs Processingresults"
v-loading="form.Packageloading"
>
<el-tab-pane label="处理结果-理赔金额" name="0" v-if="ProcessingState || form.basis.result?.length">
<el-tab-pane
label="处理结果-理赔金额"
name="0"
v-if="ProcessingState || form.basis.result?.length"
>
<el-form-item label="" prop="basis.result">
<el-select
v-model="form.basis.result"
@ -596,7 +627,12 @@
:prop="`Claimamount[${index}.paymentUnit]`"
:rules="ruleForm.paymentUnit"
>
<el-input v-model="item.paymentUnit" placeholder="请输入支付单位" :disabled="workOrderStatus != NumberState.twenty_one" clearable />
<el-input
v-model="item.paymentUnit"
placeholder="请输入支付单位"
:disabled="workOrderStatus != NumberState.twenty_one"
clearable
/>
</el-form-item>
<el-form-item
label="理赔支付时间"
@ -661,12 +697,12 @@
v-model="form.ProcessingTab"
class="demo-tabs Completioninformation"
v-loading="form.Packageloading"
v-if="$route.query.typesOf =='0'"
v-if="$route.query.typesOf == '0'"
>
<el-tab-pane label="完结信息" name="0">
<div class="el-ckbtn">
<div class="Compensationamount">
<el-button type="primary" @click="AddCompensation">添加赔款方</el-button>
<el-button type="primary" @click="AddCompensation">添加赔款方</el-button>
<span>{{ CompensationNum }}</span>
</div>
<div class="Compensationamount">
@ -720,8 +756,6 @@
@change="SummaryAmount"
/>
</el-form-item>
</div>
<div class="el_left_btn">
@ -745,8 +779,7 @@
v-model="form.arbitration"
class="demo-tabs arbitration"
v-loading="form.Packageloading"
v-if="$route.query.typesOf =='0'"
v-if="$route.query.typesOf == '0'"
>
<el-tab-pane label="仲裁原因" name="0">
<el-input
@ -785,14 +818,30 @@
</el-tabs>
<!-- 操作按钮 -->
<div class="flex-c-c">
<el-button type="primary" icon="Refresh" @click="resetFormData">重置</el-button>
<!-- 基础信息提交 -->
<el-button type="primary" icon="Position" @click="onSubmit" v-if="PermissionButton.Modification_submission">修改提交</el-button>
<!-- 理赔金未出编辑 -->
<el-button type="primary" v-if="PermissionButton.result_modification" @click="UnpaidClaimsEdited">
处理结果提交
</el-button>
<el-button type="primary" icon="Position" @click="AppealEditor" v-if="PermissionButton.Appeal_established">申诉成立提交</el-button>
<el-button type="primary" icon="Refresh" @click="resetFormData">重置</el-button>
<!-- 基础信息提交 -->
<el-button
type="primary"
icon="Position"
@click="onSubmit"
v-if="PermissionButton.Modification_submission"
>修改提交</el-button
>
<!-- 理赔金未出编辑 -->
<el-button
type="primary"
v-if="PermissionButton.result_modification"
@click="UnpaidClaimsEdited"
>
处理结果提交
</el-button>
<el-button
type="primary"
icon="Position"
@click="AppealEditor"
v-if="PermissionButton.Appeal_established"
>申诉成立提交</el-button
>
<!-- <el-button v-if="allFieldsFilled" type="primary" icon="Position" @click="onSubmit"
>处理完毕</el-button
> -->
@ -843,7 +892,7 @@ import {
$_modifyData,
$_updateCompletionEnd,
} from '@/api/aftersales/aftersalesWorkOrder';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { useRouter, useRoute } from 'vue-router';
import { getDetailWarehouse, getDeptWarehouse } from '@/api/basicdata/basicdataWarehouse'; //
import { deepClone } from '@/utils/util';
@ -909,7 +958,7 @@ const form = ref({
//
completion: [],
fileList: [], //
UserPermissions:'',//
UserPermissions: '', //
});
const myData = ref({}); //
const ruleForm = reactive({
@ -964,48 +1013,44 @@ const Paymentmethodoptions = ref([]);
//
const Processingresultsoptions = ref([]);
//
const workOrderStatus =computed(()=>{
return $route.query.workOrderStatus
})
const workOrderStatus = computed(() => {
return $route.query.workOrderStatus;
});
//
const Modificationsubmission=()=>{
if($route.query.workOrderStatus== '10'){
return true
const Modificationsubmission = () => {
if ($route.query.workOrderStatus == '10') {
return true;
}
}
};
//
const Appealestablished=()=>{
if(form.value.UserPermissions =='总部客服经理'){
if($route.query.typesOf== '0'){
return true
const Appealestablished = () => {
if (form.value.UserPermissions == '总部客服经理') {
if ($route.query.typesOf == '0') {
return true;
}
}
}
};
//
const resultmodification=()=>{
if($route.query.workOrderStatus == '21'){
return true
const resultmodification = () => {
if ($route.query.workOrderStatus == '21') {
return true;
}
}
};
//
const NumberState=computed(()=>{
return{
Numbe_ten:'10',//
twenty_one:'21',//
}
})
const NumberState = computed(() => {
return {
Numbe_ten: '10', //
twenty_one: '21', //
};
});
//
const PermissionButton =computed(() => ({
Modification_submission: Modificationsubmission(),//
Appeal_established:Appealestablished(),//
result_modification:resultmodification(),//
const PermissionButton = computed(() => ({
Modification_submission: Modificationsubmission(), //
Appeal_established: Appealestablished(), //
result_modification: resultmodification(), //
}));
//
async function updateDictionary(targetArray, dictionaryType) {
await getDictionaryBiz(dictionaryType).then(res => {
@ -1093,11 +1138,11 @@ const PageState = () => {
};
//
const getPageData = async () => {
const getPageData = async () => {
let data = {
id: $route.query.id,
};
await $_getInfo(data)
await $_getInfo(data)
.then(res => {
console.log(res, '回显的数据');
//
@ -1152,29 +1197,29 @@ const PageState = () => {
basic.workOrderType = pageData.workOrderType; //
basic.discoveryNode = pageData.discoveryNode; //
basic.workOrderNumber = pageData.workOrderNumber; //
basic.arbitrate=pageData.reasonArbitration;//
form.value.workOrderNumber=pageData.workOrderNumber;//
form.value.id=pageData.id;//ID
basic.arbitrate = pageData.reasonArbitration; //
form.value.workOrderNumber = pageData.workOrderNumber; //
form.value.id = pageData.id; //ID
form.value.groundlineType = pageData.discoveryNode; //
//
if(pageData.processingResultsVO){
if(pageData.processingResultsVO.processingMoneyEntityList?.length){
basic.result=[];//
basic.resultDescription = pageData.processingResultsVO.resultDescription;//
if (pageData.processingResultsVO) {
if (pageData.processingResultsVO.processingMoneyEntityList?.length) {
basic.result = []; //
basic.resultDescription = pageData.processingResultsVO.resultDescription; //
form.value.Claimamount = pageData.processingResultsVO.processingMoneyEntityList.map(
item => {
form.value.basis.result.push(item.resultType);
return {
money: item.money,//
paymentUnit: item.paymentUnit, //
compensationTime: item.compensationTime, //
compensationMethod: item.compensationMethod,//
title: item.compensationMethodName,//
Paymentmethod: [...JSON.parse(JSON.stringify(Paymentmethodoptions.value))],
};
}
);
item => {
form.value.basis.result.push(item.resultType);
return {
money: item.money, //
paymentUnit: item.paymentUnit, //
compensationTime: item.compensationTime, //
compensationMethod: item.compensationMethod, //
title: item.compensationMethodName, //
Paymentmethod: [...JSON.parse(JSON.stringify(Paymentmethodoptions.value))],
};
}
);
}
}
//
@ -1218,71 +1263,72 @@ const PageState = () => {
calculateMaxValues();
});
}
//
if (pageData.completionRecipientEntityList?.length || pageData.completionRecordEntities?.length) {
form.value.completion = [];
const processCompletionEntities = (entities, state) => {
entities.forEach((item, index) => {
form.value.completion.push({
state, //
warehouseId: item.warehouseId, //
warehouse: [...Processingoptions.value], //
reason: state ? item.reasonReceivingPayment : item.reason, //
money: item.money, //
compensationPersonnel: item.compensationPersonnel, //
button: !!index, //
});
});
};
//
if (pageData.completionRecipientEntityList?.length) {
processCompletionEntities(pageData.completionRecipientEntityList, 1);
}
//
if (
pageData.completionRecipientEntityList?.length ||
pageData.completionRecordEntities?.length
) {
form.value.completion = [];
const processCompletionEntities = (entities, state) => {
entities.forEach((item, index) => {
form.value.completion.push({
state, //
warehouseId: item.warehouseId, //
warehouse: [...Processingoptions.value], //
reason: state ? item.reasonReceivingPayment : item.reason, //
money: item.money, //
compensationPersonnel: item.compensationPersonnel, //
button: !!index, //
});
});
};
//
if (pageData.completionRecordEntities?.length) {
processCompletionEntities(pageData.completionRecordEntities, 0);
}
//
if (pageData.completionRecipientEntityList?.length) {
processCompletionEntities(pageData.completionRecipientEntityList, 1);
}
const addDefaultEntity = (state) => {
form.value.completion.push({
state,
warehouseId: '', //
warehouse: [...Processingoptions.value], //
reason: '', //
money: 0, //
button: false, //
});
};
//
if (pageData.completionRecordEntities?.length) {
processCompletionEntities(pageData.completionRecordEntities, 0);
}
//
if (!form.value.completion.some(res => res.state === 1)) {
addDefaultEntity(1);
}
const addDefaultEntity = state => {
form.value.completion.push({
state,
warehouseId: '', //
warehouse: [...Processingoptions.value], //
reason: '', //
money: 0, //
button: false, //
});
};
//
if (!form.value.completion.some(res => res.state === 0)) {
addDefaultEntity(0);
}
//
SummaryAmount()
}
//
console.log(pageData.decreaseImageVOList,'图片参数');
if(pageData.decreaseImageVOList?.length){
form.value.fileList=[]
form.value.fileList=pageData.decreaseImageVOList.map(res=>{
return {
name:res.imageName,//
url:res.imagePath,//
//
if (!form.value.completion.some(res => res.state === 1)) {
addDefaultEntity(1);
}
})
console.log( form.value.fileList,'处理好的参数');
}
//
if (!form.value.completion.some(res => res.state === 0)) {
addDefaultEntity(0);
}
//
SummaryAmount();
}
//
console.log(pageData.decreaseImageVOList, '图片参数');
if (pageData.decreaseImageVOList?.length) {
form.value.fileList = [];
form.value.fileList = pageData.decreaseImageVOList.map(res => {
return {
name: res.imageName, //
url: res.imagePath, //
};
});
console.log(form.value.fileList, '处理好的参数');
}
})
.catch(error => {
console.log(error, 'error');
@ -1539,7 +1585,7 @@ const action = computed(() => {
return '/api/blade-resource/oss/endpoint/put-file';
});
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
console.log(rawFile, '图片上传前回调');
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('只能上传格式为PNG/JPG的图片!');
@ -1548,7 +1594,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('图片大小不能大于3MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
//
const ImgSuccess = (response, uploadFile) => {
@ -1560,11 +1607,11 @@ const ImgSuccess = (response, uploadFile) => {
const historyPush = () => {};
//
const resetFormData = () => {
console.log(formCopy.value,'formCopy.value');
console.log(formCopy.value, 'formCopy.value');
// 使 HTML
const message = `重置表单会造成<span style="color: red;">数据丢失!</span>是否继续?`;
ElMessageBox.confirm(message, '警告', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true,
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
@ -1572,7 +1619,7 @@ const resetFormData = () => {
form.value.Pageloading = true; //
ruleFormRef.value.resetFields();
let _time = setTimeout(() => {
form.value = deepClone(formCopy.value); //
form.value = deepClone(formCopy.value); //
clearTimeout(_time);
}, 300);
});
@ -1940,9 +1987,6 @@ const onSubmit = () => {
// };
//ID
let submitData = {
...form.value.basis,
identifying: form.value.basis.TabactiveName, //123
@ -2121,25 +2165,22 @@ const onSubmit = () => {
};
//
const UnpaidClaimsEdited=()=>{
}
const UnpaidClaimsEdited = () => {};
//
const AppealEditor = () => {
console.log(Processingoptions.value);
console.log(form.value.responsibilitiesList);
console.log( form.value.completion);
let completion = form.value
let _warehouseId= form.value.completion.find(res=>!res.warehouseId)
if(_warehouseId){
ElMessage({
console.log(form.value.completion);
let completion = form.value;
let _warehouseId = form.value.completion.find(res => !res.warehouseId);
if (_warehouseId) {
ElMessage({
message: `有赔款方或受款方仓库未选择`,
type: 'warning',
});
return
}
return;
}
ElMessageBox.confirm('是否提交完结信息?', '完结', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -2148,38 +2189,45 @@ const AppealEditor = () => {
.then(() => {
let info = JSON.parse(JSON.stringify(form.value)); //
console.log(info, 'info');
let data={
id: $route.query.id,
completionRecipientEntities: [], //
completionRecordEntities: [], //
reasonArbitration: form.value.basis.arbitrate, //
typesOf: '1', //
appealId: $route.query.appealID, //ID
}
let data = {
id: $route.query.id,
completionRecipientEntities: [], //
completionRecordEntities: [], //
reasonArbitration: form.value.basis.arbitrate, //
typesOf: '1', //
appealId: $route.query.appealID, //ID
};
//
if(form.value.completion?.length){
if (form.value.completion?.length) {
form.value.completion.forEach(item => {
if (item.state == 0) {
//
data['completionRecordEntities'].push({
reason: item.reason, //
money: item.money, //
compensationPersonnel: item.compensationPersonnel, //
warehouseId: item.warehouseId, //ID
workOrderId: info.id, //
});
} else if(item.state == 1) {
//
data['completionRecipientEntities'].push({
reasonReceivingPayment: item.reason, //
money:item.money, //
responsibleParty: form.value.responsibilitiesList.map(aItem => Processingoptions.value.filter(bItem => bItem.value === aItem.businessId).map(match => match.label).join(',')).join(','),
warehouseId: item.warehouseId, //ID
workOrderNumber: info.workOrderNumber, //
workOrderId: info.id, //
});
}
});
if (item.state == 0) {
//
data['completionRecordEntities'].push({
reason: item.reason, //
money: item.money, //
compensationPersonnel: item.compensationPersonnel, //
warehouseId: item.warehouseId, //ID
workOrderId: info.id, //
});
} else if (item.state == 1) {
//
data['completionRecipientEntities'].push({
reasonReceivingPayment: item.reason, //
money: item.money, //
responsibleParty: form.value.responsibilitiesList
.map(aItem =>
Processingoptions.value
.filter(bItem => bItem.value === aItem.businessId)
.map(match => match.label)
.join(',')
)
.join(','),
warehouseId: item.warehouseId, //ID
workOrderNumber: info.workOrderNumber, //
workOrderId: info.id, //
});
}
});
}
console.log(data, '处理好的值');
//
@ -2193,12 +2241,12 @@ const AppealEditor = () => {
message: res.data.msg,
type: 'success',
});
form.value.Pageloading = false; //
$useStore.commit('EDIT_REFRESHITEM', {title: 'aftersalesWorkOrder',status: true,});
$useStore.commit('Customer_Menu',6);//
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({ path: '/aftersales/aftersalesWorkOrder',})
}
form.value.Pageloading = false; //
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: true });
$useStore.commit('Customer_Menu', 6); //
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({ path: '/aftersales/aftersalesWorkOrder' });
}
})
.catch(error => {
form.value.Pageloading = false; //
@ -2208,27 +2256,6 @@ const AppealEditor = () => {
.catch(() => {});
};
const TabactiveClick = (a, b) => {
console.log(a, b);
};

197
src/views/aftersales/aftersalesWorkOrdermodifyTemp.vue

@ -815,6 +815,7 @@ import {
$_settlementUpdate,
} from '@/api/aftersales/aftersalesWorkOrder';
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { AddressClosed } from '@/utils/util';
import { getToken } from '@/utils/auth';
import { computeNumber, isNumber } from '@/utils/util';
@ -1010,7 +1011,7 @@ const ImgSuccess = (response, uploadFile) => {
};
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
@ -1018,7 +1019,8 @@ const beforeAvatarUpload = rawFile => {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
//
const pictureList = val => {
@ -1067,7 +1069,7 @@ const ResponsiblePartychange = (val, index) => {
};
const onLoad = () => {
editloading.value=true;//
editloading.value = true; //
RouterState.value = $route.query.RouterState;
console.log($route.query.Appealeditor, '申诉===');
if ($route.query.Appealeditor) {
@ -1083,9 +1085,9 @@ const onLoad = () => {
}
//
if ($route.query.ProcessingresultsState && UserPermissions.value != '仓库客服') {
if($route.query.AppealEstablished==true){
if ($route.query.AppealEstablished == true) {
ProcessingresultsState.value = true;
}else{
} else {
ProcessingresultsState.value = false;
}
console.log($route.query.Processingresults, '理赔金未出编辑');
@ -1366,7 +1368,7 @@ const onLoad = () => {
).value;
console.log(SelectType.value, '异常类型');
Statistics();
editloading.value=false;//
editloading.value = false; //
});
};
onLoad(); //
@ -2016,105 +2018,102 @@ const ConfirmForm = () => {
//
const AppealEditor = () => {
ElMessageBox.confirm(
'是否确认申诉成立编辑提交?',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
ElMessageBox.confirm('是否确认申诉成立编辑提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
//
if ($route.query.AppealEstablished) {
editloading.value = true; //
let data = {
completionRecipientEntities: [], //
completionRecordEntities: [], //
reasonArbitration: Indexform.value.arbitrate, //
id: $route.query.id,
appealId: $route.query.appealID, //ID
typesOf: '1', //
workOrderId: $route.query.id, //IDworkOrderId
};
if (UncompletionRecordEntitiesDat.value.length) {
//
data['assignListRecord'] = UncompletionRecordEntitiesDat.value.map(res => res.id);
}
if (UncompletionRecipientEntityListData.value.length) {
//
data['assignListRecipient'] = UncompletionRecipientEntityListData.value.map(res => res.id);
}
data['completionRecordEntities'] = CompensationParty.value
.filter(item => item.state === 0) // 0
.map(item => {
return {
// indemnitor: item.name, //
reason: item.reason, //
money: Number(item.num), //
//
if ($route.query.AppealEstablished) {
editloading.value = true; //
let data = {
completionRecipientEntities: [], //
completionRecordEntities: [], //
reasonArbitration: Indexform.value.arbitrate, //
workOrderId: $route.query.id, //
warehouseId: item.warehouseId, //ID
compensationPersonnel: item.personResponsibleList, //
explains: item.reason, //
id: item.id, // ID
id: $route.query.id,
appealId: $route.query.appealID, //ID
typesOf: '1', //
workOrderId: $route.query.id, //IDworkOrderId
};
});
//
data['completionRecipientEntities'] = CompensationParty.value
.filter(item => item.state === 1) // 1
.map(item => {
return {
// recipient: item.name, //
reasonReceivingPayment: item.reason, //
money: Number(item.num), //
workOrderNumber: $route.query.workOrderNumber, //
responsibleParty: FangAddList.value
.map(aItem =>
warehouseData.value
.filter(bItem => bItem.value === aItem.businessName)
.map(match => match.label)
.join(',')
)
.join(','),
warehouseId: item.warehouseId, //ID
workOrderId: $route.query.id, //
id: item.id,
};
});
console.log(data, '处理好的值');
$_updateCompletionEnd(data)
.then(res => {
console.log(res, '完结成功');
console.log(res, '完结编辑');
editloading.value = false; //
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
if (UncompletionRecordEntitiesDat.value.length) {
//
data['assignListRecord'] = UncompletionRecordEntitiesDat.value.map(res => res.id);
}
if (UncompletionRecipientEntityListData.value.length) {
//
data['assignListRecipient'] = UncompletionRecipientEntityListData.value.map(
res => res.id
);
}
data['completionRecordEntities'] = CompensationParty.value
.filter(item => item.state === 0) // 0
.map(item => {
return {
// indemnitor: item.name, //
reason: item.reason, //
money: Number(item.num), //
reasonArbitration: Indexform.value.arbitrate, //
workOrderId: $route.query.id, //
warehouseId: item.warehouseId, //ID
compensationPersonnel: item.personResponsibleList, //
explains: item.reason, //
id: item.id, // ID
};
});
$useStore.commit('EDIT_REFRESHITEM', {
title: 'aftersalesWorkOrder',
status: true,
//
data['completionRecipientEntities'] = CompensationParty.value
.filter(item => item.state === 1) // 1
.map(item => {
return {
// recipient: item.name, //
reasonReceivingPayment: item.reason, //
money: Number(item.num), //
workOrderNumber: $route.query.workOrderNumber, //
responsibleParty: FangAddList.value
.map(aItem =>
warehouseData.value
.filter(bItem => bItem.value === aItem.businessName)
.map(match => match.label)
.join(',')
)
.join(','),
warehouseId: item.warehouseId, //ID
workOrderId: $route.query.id, //
id: item.id,
};
});
$useStore.commit('Customer_Menu',6);//
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({
//
path: '/aftersales/aftersalesWorkOrder',
console.log(data, '处理好的值');
$_updateCompletionEnd(data)
.then(res => {
console.log(res, '完结成功');
console.log(res, '完结编辑');
editloading.value = false; //
if (res.data.code == 200) {
ElMessage({
message: res.data.msg,
type: 'success',
});
$useStore.commit('EDIT_REFRESHITEM', {
title: 'aftersalesWorkOrder',
status: true,
});
$useStore.commit('Customer_Menu', 6); //
$useStore.commit('DEL_TAG_CURRENT'); //
$router.push({
//
path: '/aftersales/aftersalesWorkOrder',
});
}
})
.catch(res => {
editloading.value = false; //
});
}
})
.catch(res => {
editloading.value = false; //
});
console.log('申诉下面编辑完结信息');
}
console.log('申诉下面编辑完结信息');
}
})
.catch(() => {})
.catch(() => {});
};
//
@ -2134,7 +2133,7 @@ const UnpaidClaimsEdited = () => {
// ProcessedId.value
},
};
// ID
// ID
if (res.data.data.processingResultsVO.id) {
ProcessedId.value = res.data.data.processingResultsVO.id;
}

97
src/views/aftersales/customerService.vue

@ -31,7 +31,7 @@
<el-icon>
<location />
</el-icon>
车次号
车次号
</div>
</template>
Suzhou
@ -55,7 +55,7 @@
<el-icon>
<office-building />
</el-icon>
异常问题描述
异常问题描述
</div>
</template>
No.1188, Wuzhong Avenue, Wuzhong District, Suzhou, Jiangsu Province
@ -90,6 +90,7 @@
:action="doubledCount"
:headers="headers"
:on-success="fellSuccess"
:before-upload="beforeAvatarUpload"
>
<template #trigger>
<el-button type="primary">上传附件</el-button>
@ -116,6 +117,7 @@
<script setup>
import { $_AddReply, $_getExchangeList } from '@/api/aftersales/aftersalesWorkOrder';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { useRoute } from 'vue-router';
const ChatHistory = ref([]); //
const scrollContainer = ref(null); //
@ -150,7 +152,7 @@ const FKList = () => {
const onLoad = () => {
ListRow.value = JSON.parse($route.query.row);
console.log();
if(localStorage.getItem('my_data')){
if (localStorage.getItem('my_data')) {
Mydata.value = JSON.parse(localStorage.getItem('my_data')); //
}
currentUser.value = Mydata.value.id;
@ -171,48 +173,59 @@ const messagesendFn = () => {
annex: KFfeel.value,
};
console.log(data, '处理好的数据');
//
const currentTime = new Date();
//
const year = String(currentTime.getFullYear());
const month = String(currentTime.getMonth() + 1).padStart(2, '0');
const day = String(currentTime.getDate()).padStart(2, '0');
const hours = String(currentTime.getHours()).padStart(2, '0');
const minutes = String(currentTime.getMinutes()).padStart(2, '0');
const seconds = String(currentTime.getSeconds()).padStart(2, '0');
//
const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
$_AddReply(data).then(res => {
console.log(res, '添加成功');
if (res.data.code == 200) {
//
iconState.value = false;
ChatHistory.value.push({
businessId: Mydata.value.id,
businessName: Mydata.value.departmentName,
content: KFinput.value,
createTime: formattedTime,
});
//
setTimeout(() => {
const container = scrollContainer.value;
if (container) {
container.scrollTop = container.scrollHeight;
}
}, 0);
KFinput.value = ''; //
KFfeel.value = null; //
}
}).catch(res=>{
console.log('err');
//
const currentTime = new Date();
//
const year = String(currentTime.getFullYear());
const month = String(currentTime.getMonth() + 1).padStart(2, '0');
const day = String(currentTime.getDate()).padStart(2, '0');
const hours = String(currentTime.getHours()).padStart(2, '0');
const minutes = String(currentTime.getMinutes()).padStart(2, '0');
const seconds = String(currentTime.getSeconds()).padStart(2, '0');
//
const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
$_AddReply(data)
.then(res => {
console.log(res, '添加成功');
if (res.data.code == 200) {
//
iconState.value = false;
ChatHistory.value.push({
businessId: Mydata.value.id,
businessName: Mydata.value.departmentName,
content: KFinput.value,
createTime: formattedTime,
});
//
setTimeout(() => {
const container = scrollContainer.value;
if (container) {
container.scrollTop = container.scrollHeight;
}
}, 0);
KFinput.value = ''; //
KFfeel.value = null; //
}
})
.catch(res => {
console.log('err');
KFinput.value = ''; //
KFfeel.value = null; //
iconState.value = false;
});
});
console.log(Mydata.value, '参数');
};
const beforeAvatarUpload = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
//
const inputEnter = () => {
messagesendFn();
@ -252,8 +265,8 @@ const fellSuccess = (response, uploadFile) => {
/* 添加平滑滚动效果 */
border-radius: 5px;
border: 1px solid #ccc;
box-sizing: border-box;
margin: 4px;
box-sizing: border-box;
margin: 4px;
.YH {
width: 100%;
min-height: 50px;

13
src/views/basic/forklift/basicForklift.vue

@ -478,6 +478,7 @@
:limit="3"
list-type="picture-card"
:action="action"
:before-upload="beforeAvatarUpload"
:headers="headers"
:auto-upload="true"
:on-preview="handlePictureCardPreview"
@ -528,6 +529,7 @@ import option from '@/option/basic/basicForklift2';
import { mapGetters } from 'vuex';
import { getDictionaryBiz } from '@/api/system/dict';
import { getToken } from '@/utils/auth';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { setNodeHeight, debounce, handleClearTableQuery } from '@/utils/util';
export default {
@ -992,6 +994,17 @@ export default {
}
this.onLoad(this.page);
},
async beforeAvatarUpload(rawFile) {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
},
inputsc(index, row) {
this.query[row.prop] = index;
if (!index) {

605
src/views/basic/forklift/basicForklift2.vue

File diff suppressed because it is too large Load Diff

14
src/views/basic/pda/basicPda2.vue

@ -238,6 +238,7 @@
:headers="headers"
:auto-upload="true"
:on-preview="handlePictureCardPreview"
:before-upload="beforeAvatarUpload"
:on-remove="handleRemove">
<el-icon><Plus /></el-icon>
</el-upload>
@ -268,7 +269,7 @@ import { getList, getDetail, add, update, remove } from '@/api/basic/basicPda';
import option from '@/option/basic/basicdataPda2';
import { mapGetters } from 'vuex';
import { getDictionaryBiz } from '@/api/system/dict';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
export default {
@ -484,6 +485,17 @@ export default {
}
});
},
async beforeAvatarUpload(rawFile) {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
},
handleView(row) {
this.title = '查看';
this.view = true;

10
src/views/basic/pda/basicPdatt.vue

@ -431,6 +431,7 @@ import { ref, reactive, onMounted, computed } from 'vue';
import { getList, getDetail, $_AddInfo, update, remove, $_TableList } from '@/api/basic/basicPda'; //API
import { ElMessage, type UploadProps } from 'element-plus';
import { getToken } from '@/utils/auth';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import * as XLSX from 'xlsx'; //
//
const MenuTop = ref([
@ -787,7 +788,7 @@ const ImgSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
}
};
//
const beforeAvatarUpload: UploadProps['beforeUpload'] = rawFile => {
const beforeAvatarUpload: UploadProps['beforeUpload'] = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
@ -795,7 +796,8 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = rawFile => {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
return true;
const res = await compressImageBlob(rawFile);
return res;
};
//
const submit = () => {
@ -1042,8 +1044,8 @@ const menuChange = type => {
}
}
}
:deep(.el-table .cell){
padding:0;
:deep(.el-table .cell) {
padding: 0;
}
.el-Cart {
//

457
src/views/basicdata/brand/basicClientFrom.vue

@ -1,7 +1,7 @@
<template>
<basic-container>
<div class="avue-crud">
<el-row v-if="!search" style="padding:6px 18px">
<el-row v-if="!search" style="padding: 6px 18px">
<!-- 查询模块 -->
<el-form :inline="true" :model="query">
<el-form-item label="客户名称123:">
@ -56,7 +56,9 @@
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button>
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain
> </el-button
>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
@ -67,30 +69,41 @@
</el-row>
<el-row>
<!-- 列表模块 -->
<el-table ref="table" v-loading="loading"
@selection-change="selectionChange"
:data="data"
:height="height"
tooltip-effect="dark"
style="width: 100%"
:border="option.border">
<el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
<el-table
ref="table"
v-loading="loading"
@selection-change="selectionChange"
:data="data"
:height="height"
tooltip-effect="dark"
style="width: 100%"
:border="option.border"
>
<el-table-column
type="selection"
v-if="option.selection"
width="55"
align="center"
></el-table-column>
<el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
<el-table-column v-if="option.index" label="序号" type="index" width="60" align="center">
</el-table-column>
<template v-for="(item,index) in option.column">
<template v-for="(item, index) in option.column">
<!-- table字段 -->
<el-table-column v-if="item.hide!==true"
:prop="item.prop"
:label="item.label"
:width="item.width"
show-overflow-tooltip
:key="index" align="center">
<el-table-column
v-if="item.hide !== true"
:prop="item.prop"
:label="item.label"
:width="item.width"
show-overflow-tooltip
:key="index"
align="center"
>
<!-- <template slot-scope="{item}" v-if="item.prop === 'fileName'">-->
<template #default="{row,$index}" v-if="item.prop === 'fileName'">
<template #default="{ row, $index }" v-if="item.prop === 'fileName'">
<el-link target="_blank" @click="downloadLink(row)">{{ row.fileName }}</el-link>
</template>
<template #default="{row,$index}" v-if="item.prop === 'clientType'">
<template #default="{ row, $index }" v-if="item.prop === 'clientType'">
<span target="_blank" v-if="row.clientType == '1'">工厂</span>
<span target="_blank" v-if="row.clientType == '2'">商场</span>
<span target="_blank" v-if="row.clientType == '3'">装饰</span>
@ -98,7 +111,7 @@
<!-- <span target="_blank" v-else>收货方</span>-->
</template>
<!-- <el-link href="https://element.eleme.io" target="_blank" v-if="item.prop === 'fileName'">{{scope}}</el-link>-->
<template #default="{row,$index}" v-if="item.prop === 'cargoControl'">
<template #default="{ row, $index }" v-if="item.prop === 'cargoControl'">
<el-switch
v-model="row.cargoControl"
active-text="开"
@ -112,12 +125,18 @@
<!-- 操作栏模块 -->
<el-table-column prop="menu" label="操作" :width="300" align="center">
<template #="{row}">
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button>
<template #="{ row }">
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)"
>查看</el-button
>
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)"
>编辑</el-button
>
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)"
>删除</el-button
>
<el-dropdown>
<el-button type="primary" text>
<el-button type="primary" text>
更多
<el-icon class="el-icon--right">
<arrow-down />
@ -126,26 +145,58 @@
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleAddSon(row)">新增</el-button>
<el-button
type="primary"
text
icon="el-icon-setting"
@click="handleAddSon(row)"
>新增</el-button
>
</el-dropdown-item>
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleHistory(row)">合同历史记录</el-button>
<el-button
type="primary"
text
icon="el-icon-setting"
@click="handleHistory(row)"
>合同历史记录</el-button
>
</el-dropdown-item>
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleEntrepot(row)">服务仓</el-button>
<el-button
type="primary"
text
icon="el-icon-setting"
@click="handleEntrepot(row)"
>服务仓</el-button
>
</el-dropdown-item>
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleLinkman(row)">联系人</el-button>
<el-button
type="primary"
text
icon="el-icon-setting"
@click="handleLinkman(row)"
>联系人</el-button
>
</el-dropdown-item>
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleBrand(row)">品牌</el-button>
<el-button
type="primary"
text
icon="el-icon-setting"
@click="handleBrand(row)"
>品牌</el-button
>
</el-dropdown-item>
<!-- <el-dropdown-item v-if="!!row.clientType">-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleBase(row)" v-if=" row.clientType == '1'">基地</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleStore(row)" v-if=" row.clientType == '2'">门店</el-button>-->
<!-- </el-dropdown-item>-->
<el-dropdown-item >
<el-button type="primary" text icon="el-icon-setting" @click="handleMall(row)">三方商城</el-button>
<!-- <el-dropdown-item v-if="!!row.clientType">-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleBase(row)" v-if=" row.clientType == '1'">基地</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-setting" @click="handleStore(row)" v-if=" row.clientType == '2'">门店</el-button>-->
<!-- </el-dropdown-item>-->
<el-dropdown-item>
<el-button type="primary" text icon="el-icon-setting" @click="handleMall(row)"
>三方商城</el-button
>
</el-dropdown-item>
</el-dropdown-menu>
</template>
@ -155,26 +206,30 @@
</el-table>
</el-row>
<el-row>
<div class="avue-crud__pagination" style="width:100%">
<div class="avue-crud__pagination" style="width: 100%">
<!-- 分页模块 -->
<el-pagination align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50,80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total">
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
<!-- 表单模块 -->
<el-dialog :title="title"
v-model="box"
width="35%"
:before-close="beforeClose"
append-to-body>
<el-dialog
:title="title"
v-model="box"
width="35%"
:before-close="beforeClose"
append-to-body
>
<el-form :disabled="view" ref="form" :model="form" :rules="rules" label-width="120px">
<!-- 表单字段 -->
<el-form-item label="编码" prop="reserve1">
@ -189,34 +244,49 @@
<!-- <el-option label="发货方" value="1"/>-->
<!-- <el-option label="收货方" value="2"/>-->
<!-- </el-select>-->
<el-select v-model="form.clientType" class="m-2" placeholder="请选择客户端类型" style="width: 100%">
<el-select
v-model="form.clientType"
class="m-2"
placeholder="请选择客户端类型"
style="width: 100%"
>
<el-option
v-for="item in clientType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
</el-form-item>
<el-form-item label="服务类型" prop="typeServiceList">
<el-select v-model="form.typeServiceList" multiple placeholder="请选择" style="width: 100%" @change="coverCharge">
<el-select
v-model="form.typeServiceList"
multiple
placeholder="请选择"
style="width: 100%"
@change="coverCharge"
>
<el-option
v-for="item in freightType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey">
:value="item.dictKey"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="配送类型" prop="businessType" v-if="distriType">
<el-radio-group v-model="form.businessType" class="ml-4" v-for="item in distributionType">
<el-radio :label="item.dictKey" size="large" style="margin-right: 25px">{{item.dictValue}}</el-radio>
<el-radio-group
v-model="form.businessType"
class="ml-4"
v-for="item in distributionType"
>
<el-radio :label="item.dictKey" size="large" style="margin-right: 25px">{{
item.dictValue
}}</el-radio>
<!-- <el-radio label="2" size="large">Option 2</el-radio>-->
</el-radio-group>
<!-- </div>-->
</el-form-item>
<!-- <el-form-item label="客户端类型" prop="typeService">
&lt;!&ndash; <el-input v-model="form.typeService" placeholder="请输入客户类型"/>&ndash;&gt;
@ -239,7 +309,11 @@
</el-form-item>
<el-form-item label="地址" prop="bladeRegionProvinceId">
<!-- <el-input v-model="form.bladeRegionProvinceId" placeholder="请输入省份"/>-->
<el-cascader :options="optioner" style="width: 100%" v-model="form.bladeRegionProvinceId">
<el-cascader
:options="optioner"
style="width: 100%"
v-model="form.bladeRegionProvinceId"
>
<template #default="{ node, data }">
<span>{{ data.label }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
@ -249,12 +323,12 @@
<el-form-item label="详细地址" prop="detailedly">
<el-input v-model="form.detailedly" placeholder="请填写详细地址" style="width: 100%" />
</el-form-item>
<!-- <el-form-item label="三方商城" prop="tripartiteMall">-->
<!-- <el-input v-model="form.tripartiteMall" placeholder="请填写三方商城" style="width: 100%" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开票信息" prop="billingInformation">-->
<!-- <el-input v-model="form.billingInformation" placeholder="请填写开票信息" style="width: 100%" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="三方商城" prop="tripartiteMall">-->
<!-- <el-input v-model="form.tripartiteMall" placeholder="请填写三方商城" style="width: 100%" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开票信息" prop="billingInformation">-->
<!-- <el-input v-model="form.billingInformation" placeholder="请填写开票信息" style="width: 100%" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="市" prop="bladeRegionCityId">-->
<!-- <el-input v-model="form.bladeRegionCityId" placeholder="请输入市"/>-->
<!-- </el-form-item>-->
@ -270,17 +344,20 @@
:headers="headers"
multiple
:on-preview="handlePreview"
:on-success="(response, file, fileList) => {uploadSuccess(fileList)}"
:on-success="
(response, file, fileList) => {
uploadSuccess(fileList);
}
"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:before-upload="beforeAvatarUpload"
:limit="3"
:on-exceed="handleExceed"
>
<el-button>上传</el-button>
<template #tip>
<div class="el-upload__tip">
大小不超过500KB的jpg/png文件
</div>
<div class="el-upload__tip">大小不超过500KB的jpg/png文件</div>
</template>
</el-upload>
<el-image-viewer
@ -326,7 +403,9 @@
<!-- 表单按钮 -->
<template #footer>
<span v-if="!view" class="dialog-footer">
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit('form')"> </el-button>
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit('form')"
> </el-button
>
<el-button icon="el-icon-circle-close" @click="box = false"> </el-button>
</span>
</template>
@ -337,7 +416,8 @@
size="60%"
v-model="drawer"
:direction="direction"
:before-close="handleDrawerClose">
:before-close="handleDrawerClose"
>
<BasicShopSub :mainId="basicClientId"></BasicShopSub>
</el-drawer>
<!-- <el-drawer-->
@ -361,20 +441,19 @@ import BasicShopSub from '@/views/basicdata/brand/basicShopSub.vue';
import { getDictionaryBiz } from '@/api/system/dict';
import { getSelect, getLazyTree, getLazyList, getLazyTreeAll } from '@/api/base/region';
import { getToken } from '@/utils/auth';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { Base64 } from 'js-base64';
export default {
components: {
BasicShopSub
BasicShopSub,
},
data() {
return {
activeNames: ['1'],
height: 0,
showImgViewer: false,
imgPreviewUrl: [],//
imgPreviewUrl: [], //
fileList: [],
//
@ -403,13 +482,13 @@ export default {
page: {
currentPage: 1,
pageSize: 30,
total: 40
total: 40,
},
//
form: {
contractStartTime: '',
contractEntTime: ''
contractEntTime: '',
},
//
selectionList: [],
@ -431,7 +510,7 @@ export default {
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
}
},
},
{
text: '上个月',
@ -440,7 +519,7 @@ export default {
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
}
},
},
{
text: '最近3个月',
@ -449,8 +528,8 @@ export default {
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
}
}
},
},
],
rules: {
clientName: [
@ -465,43 +544,25 @@ export default {
{ required: true, message: '请选择配送业务类型', trigger: 'change' },
// { min: 3, max: 5, message: ' 3 5 ', trigger: 'blur' }
],
typeService: [
{ required: true, message: '请选择客户端类型', trigger: 'change' }
],
typeServiceList: [
{ required: true, message: '请选择服务类型', trigger: 'change' }
],
detailedly: [
{ required: true, message: '请填写详细地址', trigger: 'blur' }
],
clientType: [
{ required: true, message: '请选择客户类型', trigger: 'change' }
],
linkman: [
{ required: true, message: '请填写联系人', trigger: 'blur' }
],
phone: [
{ required: true, message: '请填写联系电话', trigger: 'blur' }
],
typeService: [{ required: true, message: '请选择客户端类型', trigger: 'change' }],
typeServiceList: [{ required: true, message: '请选择服务类型', trigger: 'change' }],
detailedly: [{ required: true, message: '请填写详细地址', trigger: 'blur' }],
clientType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
linkman: [{ required: true, message: '请填写联系人', trigger: 'blur' }],
phone: [{ required: true, message: '请填写联系电话', trigger: 'blur' }],
contractEntTime: [
{ type: 'date', required: true, message: '请选择合同结束时间', trigger: 'change' }
{ type: 'date', required: true, message: '请选择合同结束时间', trigger: 'change' },
],
contractStartTime: [
{ type: 'date', required: true, message: '请选择合同开始时间', trigger: 'change' }
],
bladeRegionProvinceId: [
{ required: true, message: '请选择地址', trigger: 'change' }
{ type: 'date', required: true, message: '请选择合同开始时间', trigger: 'change' },
],
leaseAccessories: [
{ required: true, message: '请上传合同文件', trigger: 'blur' }
]
bladeRegionProvinceId: [{ required: true, message: '请选择地址', trigger: 'change' }],
leaseAccessories: [{ required: true, message: '请上传合同文件', trigger: 'blur' }],
},
bianji: false
bianji: false,
};
},
created() {
},
created() {},
watch: {
'$route.query.id': {
handler(newVal, oldVal) {
@ -509,10 +570,10 @@ export default {
this.onLoad(this.page);
},
deep: true,
immediate: true
}
immediate: true,
},
},
mounted() {
mounted() {
this.init();
getLazyTreeAll().then(res => {
if (res.data.success) {
@ -532,23 +593,23 @@ export default {
},
headers() {
return {
'Blade-Auth': 'Bearer ' + getToken()
'Blade-Auth': 'Bearer ' + getToken(),
};
},
action() {
// return '/api/logpm-basicdata/common/uploadFile';
return '/api/blade-resource/oss/endpoint/put-file'
}
return '/api/blade-resource/oss/endpoint/put-file';
},
},
methods: {
coverCharge(num) {
this.distriType = false;
console.log(num);
num.forEach(i =>{
if(i == '3'){
num.forEach(i => {
if (i == '3') {
this.distriType = true;
}
})
});
},
handleChange(val) {
@ -562,22 +623,24 @@ export default {
path: '/basicdata/brand/basicdataTripartiteMall',
query: {
id: row.id,
name: '商场 - ' + row.clientName
}
name: '商场 - ' + row.clientName,
},
});
},
//
downloadLink(row) {
console.log('>>>>>', row);
window.open('http://192.168.10.100:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(row.leaseAccessories)));
window.open(
'http://192.168.10.100:8012/onlinePreview?url=' +
encodeURIComponent(Base64.encode(row.leaseAccessories))
);
},
//
makeCargo(row) {
console.log('控货操作!!', row);
let r = {
id: row.id,
cargoControl: row.cargoControl
cargoControl: row.cargoControl,
};
this.$confirm(`确定要修改${row.clientName}的控货状态吗?`, {
type: 'warning',
@ -592,26 +655,34 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!'
message: '操作成功!',
});
done();
} else {
this.$message({
type: 'warning',
message: '操作失败!'
message: '操作失败!',
});
}
});
} else {
//false
//done
done();
}
}
},
});
},
async beforeAvatarUpload(rawFile) {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
},
uploadSuccess(fileList) {
// this.form.fileName =
@ -642,10 +713,13 @@ export default {
this.showImgViewer = true;
console.log('-=-=sc上传', this.fileList);
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
@ -680,7 +754,6 @@ export default {
// });
// }
// console.log('111', this.optioner);
this.height = this.setPx(document.body.clientHeight - 340);
},
@ -697,7 +770,6 @@ export default {
this.onLoad(this.page);
},
handleSubmit(from) {
console.log('上传的集合。。', JSON.parse(JSON.stringify(this.fileList)));
if (this.title == '编辑' && this.bianji == false) {
console.log('编辑1111');
@ -705,7 +777,6 @@ export default {
let li = [];
this.fileList.forEach(it => {
li.push(it.url);
});
this.form.leaseAccessories = li.length > 0 ? li.join(',') : null;
} else {
@ -725,22 +796,21 @@ export default {
}
if (!this.form.id) {
console.log('提交的数据:', this.form);
this.$refs[from].validate((valid) => {
this.$refs[from].validate(valid => {
if (valid) {
// this.form.typeService = !!this.form.typeService ? parseInt(this.form.typeService) : undefined;
this.form.bladeRegionCityId = this.form.bladeRegionProvinceId[1];
this.form.bladeRegionAreaId = this.form.bladeRegionProvinceId[2];
this.form.bladeRegionProvinceId = this.form.bladeRegionProvinceId[0];
this.form.pid = this.$route.query.id;
console.log("上传llll>>>",this.form);
console.log('上传llll>>>', this.form);
add(this.form).then(() => {
this.box = false;
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!'
message: '操作成功!',
});
});
} else {
@ -748,10 +818,9 @@ export default {
return false;
}
});
} else {
console.log('提交的数据:', this.form);
this.$refs[from].validate((valid) => {
this.$refs[from].validate(valid => {
if (valid) {
// this.form.typeService = !!this.form.typeService ? parseInt(this.form.typeService) : undefined;
this.form.bladeRegionCityId = this.form.bladeRegionProvinceId[1];
@ -762,7 +831,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!'
message: '操作成功!',
});
});
} else {
@ -770,8 +839,6 @@ export default {
return false;
}
});
}
},
handleAdd() {
@ -786,8 +853,8 @@ export default {
path: '/basicdata/brand/basicClientFrom',
query: {
id: row.id,
name: '新增 - ' + row.clientName
}
name: '新增 - ' + row.clientName,
},
});
},
handleEdit(row) {
@ -800,14 +867,14 @@ export default {
res.data.data.typeService = res.data.data.typeService.toString();
console.log(res.data.data);
this.form = res.data.data;
let bus =[];
this.form.typeServiceBusiness.forEach(i =>{
let bus = [];
this.form.typeServiceBusiness.forEach(i => {
bus.push(i.typeService);
if(i.typeService == '3'){
if (i.typeService == '3') {
this.distriType = true;
this.form.businessType = i.mold;
}
})
});
this.form.typeServiceList = bus;
console.log(this.form);
let a = [];
@ -824,19 +891,20 @@ export default {
d.forEach(i => {
let q = {
name: '',
url: i
url: i,
};
le.push(q);
});
this.fileList = le;
} else {
this.fileList = [{
name: this.form.fileName,
url: this.form.leaseAccessories
}];
this.fileList = [
{
name: this.form.fileName,
url: this.form.leaseAccessories,
},
];
}
}
});
},
handleView(row) {
@ -848,14 +916,14 @@ export default {
res.data.data.typeService = res.data.data.typeService.toString();
console.log('>>>>>', res.data.data);
this.form = res.data.data;
let bus =[];
this.form.typeServiceBusiness.forEach(i =>{
let bus = [];
this.form.typeServiceBusiness.forEach(i => {
bus.push(i.typeService);
if(i.typeService == '3'){
if (i.typeService == '3') {
this.distriType = true;
i.businessType = i.mold;
}
})
});
this.form.typeServiceList = bus;
let a = [];
if (!!this.form.bladeRegionProvinceId) {
@ -871,32 +939,34 @@ export default {
d.forEach(i => {
let q = {
name: '',
url: i
url: i,
};
le.push(q);
});
this.fileList = le;
} else {
this.fileList = [{
name: '',
url: this.form.leaseAccessories
}];
this.fileList = [
{
name: '',
url: this.form.leaseAccessories,
},
];
}
}
});
},
handleDrawer(row) {
this.basicClientId = row.id;
this.drawer = true;
},
handleBrand(row) { //
handleBrand(row) {
//
this.$router.push({
path:'/basicdata/brand/basicdataStoreBrand',
query:{
path: '/basicdata/brand/basicdataStoreBrand',
query: {
id: row.id,
name: "品牌 - "+row.clientName
}
name: '品牌 - ' + row.clientName,
},
});
},
//
@ -909,10 +979,9 @@ export default {
path: '/basicdata/brand/basicHistoricalContract',
query: {
id: row.id,
name: '历史记录 - ' + row.clientName
}
name: '历史记录 - ' + row.clientName,
},
});
},
//
handleEntrepot(row) {
@ -925,10 +994,9 @@ export default {
query: {
id: row.id,
name: '服务仓 - ' + row.clientName,
type: '2'
}
type: '2',
},
});
},
//
handleLinkman(row) {
@ -937,8 +1005,8 @@ export default {
query: {
id: row.id,
name: '联系人 - ' + row.clientName,
type: 2
}
type: 2,
},
});
},
//
@ -947,8 +1015,8 @@ export default {
path: '/basicdata/brand/basicdataCustomerBase',
query: {
id: row.id,
name: '基地 - ' + row.clientName
}
name: '基地 - ' + row.clientName,
},
});
},
//
@ -957,8 +1025,8 @@ export default {
path: '/basicdata/brand/basicShop',
query: {
id: row.id,
name: '门店- ' + row.clientName
}
name: '门店- ' + row.clientName,
},
});
},
handleDrawerClose() {
@ -973,7 +1041,7 @@ export default {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
return remove(this.ids);
@ -983,7 +1051,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!'
message: '操作成功!',
});
});
},
@ -991,7 +1059,7 @@ export default {
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
return remove(row.id);
@ -1000,7 +1068,7 @@ export default {
this.onLoad(this.page);
this.$message({
type: 'success',
message: '操作成功!'
message: '操作成功!',
});
});
},
@ -1054,15 +1122,15 @@ export default {
});
let dz = '';
data.records.forEach(it => {
let arrsheng = this.optioner.filter((i) => {
let arrsheng = this.optioner.filter(i => {
return it.bladeRegionProvinceId == i.value;
});
// console.log("========",JSON.parse(JSON.stringify(arrsheng)) );
let arrshi = arrsheng[0].children.filter((i) => {
let arrshi = arrsheng[0].children.filter(i => {
return it.bladeRegionCityId == i.value;
});
// console.log("========",JSON.parse(JSON.stringify(arrsheng)) );
let arrqu = arrshi[0].children.filter((i) => {
let arrqu = arrshi[0].children.filter(i => {
return it.bladeRegionAreaId == i.value;
});
// console.log("========",JSON.parse(JSON.stringify(arrsheng)) );
@ -1076,8 +1144,7 @@ export default {
this.loading = false;
this.selectionClear();
});
}
}
},
},
};
</script>

78
src/views/basicdata/driverArtery/basicdataDriverArteryAdd.vue

@ -124,6 +124,7 @@ import { mapGetters } from 'vuex';
import { getToken } from '@/utils/auth';
import { downloadXls, setNodeHeight, debounce } from '@/utils/util';
import { ElMessageBox } from 'element-plus';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
export default {
name: '/basicdata/driverArtery/basicdataDriverArteryAdd',
data() {
@ -546,78 +547,21 @@ export default {
console.log('res :>> ', res);
},
/** 上传前 */
handleBeforeUpload(file) {
async handleBeforeUpload(file) {
const isJPG = file.type === 'image/jpeg';
const isPNG = file.type === 'image/png';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG && !isPNG) {
this.$message.error('上传图片只能是 JPG 或 PNG 格式!');
return false;
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 2MB!');
} else {
return (isJPG || isPNG) && isLt2M;
return false;
}
/* let that = this;
// ?FormData
let formData = new FormData();
let reader = new FileReader();
// ?DataURL
reader.readAsDataURL(file);
// ?
reader.onload = function (ev) {
try {
// ?
let img = new Image();
img.src = ev.target.result;
img.onload = function (ev) {
// ?canvas
let canvas = document.createElement('canvas');
let context = canvas.getContext('2d');
let imgwidth = img.width;
let imgHeight = img.height;
// ?;
let targetwidth = imgwidth;
let targetHeight = imgHeight;
// ?/
if (targetWidth > targetHeight) {
// ?
let scale = targetHeight / 1280;
targetHeight = 1280;
targetWidth = targetwidth / scale;
} else {
// ?
let scale = targetWidth / 1280;
targetWidth = 1280;
targetHeight = targetHeight / scale;
}
// ?
canvas.width = targetwidth; //canvas=
canvas.height = targetHeight; //canvas=
context.clearRect(0, 0, canvas.width, canvas.height);
context.drawImage(this, 0, 0, canvas.width, canvas.height);
let data = '';
// ?0.6Mb
if (file.size <= 628288) {
data = canvas.toDataURL('image/jpeg');
formData.append('file', file);
that.handleChange(file);
}
// ?e.6Mb
else {
// todo
data = canvas.toDataURL('image/jpeg', 0.4);
let paper = that.GLOBAL.dataURLtoFile(data, file.name);
formData.append('file', paper);
console.log('paper :>> ', paper);
}
};
} catch (error) {
console.log('出现错误', error);
}
}; */
const res = await compressImageBlob(rawFile);
return res;
},
/** 上传成功 */
handleUpLoadSuccess(file, item) {
@ -647,7 +591,7 @@ export default {
this.form = {
..._data,
};
this.form.jobType= this.form.jobTypeString
this.form.jobType = this.form.jobTypeString;
this.form.bindVehicles = _data.bindVehicles && _data.bindVehicles.split(',');
this.form.warehouseIds = _data.warehouses.map(val => val.warehouseId);
console.log('_data :>> ', _data);
@ -660,8 +604,8 @@ export default {
const submitData = { ...this.form };
submitData.bindVehicles = this.form.bindVehicles && this.form.bindVehicles.join(',');
submitData.phone = this.form.phone.trim();
submitData.jobType = submitData.jobType.join(',')
submitData.jobType = submitData.jobType.join(',');
const res = await add(submitData);
const { code, msg } = res.data;
if (code !== 200) return;
@ -674,7 +618,7 @@ export default {
type: 'warning',
})
.then(() => {
submitData.jobType=[]
submitData.jobType = [];
this.$refs.formRef.resetFields();
})
.catch(() => this.back());
@ -692,7 +636,7 @@ export default {
const submitData = { ...this.form };
submitData.bindVehicles = this.form.bindVehicles && this.form.bindVehicles.join(',');
submitData.phone = this.form.phone.trim();
submitData.jobType = submitData.jobType.join(',')
submitData.jobType = submitData.jobType.join(',');
const res = await update(submitData);
const { code, msg } = res.data;
if (code !== 200) return;

6
src/views/basicdata/warehouse/tray/basicdataTray.vue

@ -308,6 +308,7 @@ import {
vacants,
getWarehouseListqx,
} from '@/api/basicdata/basicdataTray';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
//
const $router = useRouter();
@ -727,11 +728,12 @@ const handleBreakageSubmit = async () => {
};
//
const beforeAvatarUpload = rawFile => {
const beforeAvatarUpload = async rawFile => {
const nameArr = rawFile.name.split('.');
if (['png', 'jpg', 'jpeg'].includes(nameArr[nameArr.length - 1])) return true;
ElMessage.warning('请上传 png / jpg / jpeg 的图片');
return false;
const res = await compressImageBlob(rawFile);
return res;
};
/** 禁用 */

16
src/views/basicdata/warehouse/warehouse/basicdataWarehouseTemp.vue

@ -271,6 +271,7 @@
:headers="headers"
v-model:file-list="Addform.paymentCodeUrlS"
list-type="picture-card"
:before-upload="beforeAvatarUpload"
:auto-upload="true"
>
<el-icon><Plus /></el-icon>
@ -515,6 +516,7 @@
:headers="headers"
v-model:file-list="Addform.paymentCodeUrlS"
list-type="picture-card"
:before-upload="beforeAvatarUpload"
:auto-upload="true"
>
<el-icon><Plus /></el-icon>
@ -597,6 +599,8 @@ import { getToken } from '@/utils/auth';
import dayjs from 'dayjs';
import { Delete, Download, Plus, ZoomIn } from '@element-plus/icons-vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
const props = { multiple: true };
const options = ref([]); //
const selectAll = ref([]);
@ -1081,7 +1085,17 @@ const view = val => {
Addform.value['addressInfo'][2] = Addform.value.code; //-
});
};
const beforeAvatarUpload = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
//
const DeleteInformation = val => {
ElMessageBox.confirm('是否删除该条数据?确定此操作后不可撤销!', '删除提示', {

649
src/views/datadetail/ToolUpdate.vue

@ -1,13 +1,19 @@
<template>
<!-- 表格组件 -->
<div class='el-content-el' ref='TabHeight'>
<!-- 表格组件 -->
<div class="el-content-el" ref="TabHeight">
<!-- 顶部开始 -->
<div class="el-Cart-button">
<!-- 表格顶部左侧按钮 -->
<div class="el-Cart-button-left">
<el-button type="primary" @click="AddInfo"><el-icon><Plus /></el-icon> </el-button>
<el-button @click="handleDelete"><el-icon><Delete /></el-icon> </el-button>
<el-button @click="handleDelete"><el-icon><Edit /></el-icon></el-button>
<el-button type="primary" @click="AddInfo"
><el-icon><Plus /></el-icon> </el-button
>
<el-button @click="handleDelete"
><el-icon><Delete /></el-icon> </el-button
>
<el-button @click="handleDelete"
><el-icon><Edit /></el-icon></el-button
>
</div>
<!-- 表格顶部右侧按钮 -->
<div class="el-Cart-button-right">
@ -26,173 +32,201 @@
</div>
</div>
<!-- 顶部结束 -->
<div class='el-Cart'>
<div class="el-Cart">
<!-- 表格列开始 -->
<el-table :data="data" border :height="TabHeight+'px'" style="width: 100%;">
<el-table-column type="selection" width="55" fixed="left"/>
<el-table-column type="index" fixed="left" width="50" height="100" label="#" align="center"/>
<el-table-column prop="name" label="产品名称" width="180" align="center " sortable/>
<el-table-column prop="model" label="型号" width="180" align="center " />
<el-table-column prop="purchaseAmount" label="购买金额" width="180" align="center "/>
<el-table-column prop="state" label="状态" width="180" align="center "/>
<el-table-column prop="currentUsageWarehouse" label="当前使用仓" width="180" align="center "/>
<el-table-column prop="user" label="使用人" width="180" align="center " />
<el-table-column prop="deviceSerialNumber" label="设备序列号S/N" width="180" align="center "/>
<el-table-column prop="userPosition" label="使用人岗位" width="180" align="center "/>
<el-table-column prop="isDeposit" label="是否收取押金" width="180" align="center "/>
<el-table-column prop="deposit" label="押金金额(元)" width="180" align="center "/>
<el-table-column prop="purchasingCompany" label="采购公司" width="180" align="center "/>
<el-table-column label="商品图片" width="180" align="center" >
<el-table :data="data" border :height="TabHeight + 'px'" style="width: 100%">
<el-table-column type="selection" width="55" fixed="left" />
<el-table-column
type="index"
fixed="left"
width="50"
height="100"
label="#"
align="center"
/>
<el-table-column prop="name" label="产品名称" width="180" align="center " sortable />
<el-table-column prop="model" label="型号" width="180" align="center " />
<el-table-column prop="purchaseAmount" label="购买金额" width="180" align="center " />
<el-table-column prop="state" label="状态" width="180" align="center " />
<el-table-column
prop="currentUsageWarehouse"
label="当前使用仓"
width="180"
align="center "
/>
<el-table-column prop="user" label="使用人" width="180" align="center " />
<el-table-column
prop="deviceSerialNumber"
label="设备序列号S/N"
width="180"
align="center "
/>
<el-table-column prop="userPosition" label="使用人岗位" width="180" align="center " />
<el-table-column prop="isDeposit" label="是否收取押金" width="180" align="center " />
<el-table-column prop="deposit" label="押金金额(元)" width="180" align="center " />
<el-table-column prop="purchasingCompany" label="采购公司" width="180" align="center " />
<el-table-column label="商品图片" width="180" align="center">
<template #default="props">
<img :src="props.row.photo" class='el-Img'>
</template>
</el-table-column>
<el-table-column prop="buyingTime" label="购买时间" width="180" align="center "/>
<el-table-column prop="notes" label="备注" width="180" align="center "/>
<el-table-column prop="warrantyPeriodEndTime" label="保修截止时间" width="180" align="center "/>
<el-table-column fixed="right" label="操作" width="280" align="center ">
<template #default>
<el-button link type="primary" icon="el-icon-delete" @click="handleDelete">删除</el-button>
<el-button link type="primary" icon="el-icon-view" @click="handleEdit(row)">编辑</el-button>
<el-button link type="primary" icon="el-icon-view" @click="handleview(row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<!-- 表格翻页功能 -->
<div class="demo-pagination-block">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="pageList"
:small="small"
:disabled="disabled"
:background="background"
layout="total, sizes, prev, pager, next, jumper"
:total="2"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<img :src="props.row.photo" class="el-Img" />
</template>
</el-table-column>
<el-table-column prop="buyingTime" label="购买时间" width="180" align="center " />
<el-table-column prop="notes" label="备注" width="180" align="center " />
<el-table-column
prop="warrantyPeriodEndTime"
label="保修截止时间"
width="180"
align="center "
/>
<el-table-column fixed="right" label="操作" width="280" align="center ">
<template #default>
<el-button link type="primary" icon="el-icon-delete" @click="handleDelete"
>删除</el-button
>
<el-button link type="primary" icon="el-icon-view" @click="handleEdit(row)"
>编辑</el-button
>
<el-button link type="primary" icon="el-icon-view" @click="handleview(row)"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 表格翻页功能 -->
<div class="demo-pagination-block">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="pageList"
:small="small"
:disabled="disabled"
:background="background"
layout="total, sizes, prev, pager, next, jumper"
:total="2"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
<!-- 弹窗组件 -->
<div class="addlalog">
<el-dialog v-model="AddLalog" title="新增产品">
<el-form label-position="top" label-width="100px" :model="AddForm">
<el-form-item label="产品名称">
<el-input v-model="AddForm.name" placeholder="请输入产品名称" />
</el-form-item>
<el-form-item label="购买金额">
<el-input v-model="AddForm.purchaseAmount" placeholder="请输入购买金额" />
</el-form-item>
<el-form-item label="当前使用仓">
<el-input v-model="AddForm.currentUsageWarehouse" placeholder="请输入当前使用仓" />
</el-form-item>
</div>
<!-- 弹窗组件 -->
<div class='addlalog'>
<el-dialog v-model="AddLalog" title="新增产品" >
<el-form label-position="top" label-width="100px" :model="AddForm">
<el-form-item label="产品名称">
<el-input v-model="AddForm.name" placeholder="请输入产品名称"/>
</el-form-item>
<el-form-item label="购买金额">
<el-input v-model="AddForm.purchaseAmount" placeholder="请输入购买金额"/>
</el-form-item>
<el-form-item label="当前使用仓">
<el-input v-model="AddForm.currentUsageWarehouse" placeholder="请输入当前使用仓"/>
</el-form-item>
<el-form-item label="设备序列号S/N">
<el-input v-model="AddForm.deviceSerialNumber" placeholder="请输入设备序列号" />
</el-form-item>
<el-form-item label="是否收取押金">
<el-select v-model="AddForm.isDeposit" class="m-2" placeholder="选择是否收取押金">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="采购公司">
<el-input v-model="AddForm.purchasingCompany" placeholder="请输入采购公司"/>
</el-form-item>
<el-form-item label="保修截至时间">
<el-date-picker
v-model="AddForm.warrantyPeriodEndTime"
type="date"
placeholder="选择保修截至日期"
size="default"
format="YYYY/MM/DD"
/>
</el-form-item>
<el-form-item label="图片">
<!-- photo -->
<el-upload
ref="uploadRef"
class="upload-demo"
action="api/blade-resource/oss/endpoint/put-file"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<el-form-item label="设备序列号S/N">
<el-input v-model="AddForm.deviceSerialNumber" placeholder="请输入设备序列号" />
</el-form-item>
<template #trigger>
<div class='img-icon'>
<el-button type="primary">点击上传图片</el-button>
<el-icon><UploadFilled /></el-icon>
</div>
</template>
</el-upload>
</el-form-item>
<el-form-item label="是否收取押金">
<el-select v-model="AddForm.isDeposit" class="m-2" placeholder="选择是否收取押金">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="采购公司">
<el-input v-model="AddForm.purchasingCompany" placeholder="请输入采购公司" />
</el-form-item>
<el-form-item label="保修截至时间">
<el-date-picker
v-model="AddForm.warrantyPeriodEndTime"
type="date"
placeholder="选择保修截至日期"
size="default"
format="YYYY/MM/DD"
/>
</el-form-item>
<el-form-item label="图片">
<!-- photo -->
<el-upload
ref="uploadRef"
class="upload-demo"
action="api/blade-resource/oss/endpoint/put-file"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<template #trigger>
<div class="img-icon">
<el-button type="primary">点击上传图片</el-button>
<el-icon><UploadFilled /></el-icon>
</div>
</template>
</el-upload>
</el-form-item>
<el-form-item label="型号">
<el-input v-model="AddForm.model" placeholder="请输入型号"/>
</el-form-item>
<el-form-item label="型号">
<el-input v-model="AddForm.model" placeholder="请输入型号" />
</el-form-item>
<el-form-item label="状态">
<el-select v-model="AddForm.state" class="m-2" placeholder="选择状态">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-select v-model="AddForm.state" class="m-2" placeholder="选择状态">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="使用人">
<el-input v-model="AddForm.user" placeholder="请输入使用人"/>
</el-form-item>
<el-form-item label="使用人">
<el-input v-model="AddForm.user" placeholder="请输入使用人" />
</el-form-item>
<el-form-item label="使用人岗位">
<el-input v-model="AddForm.userPosition" placeholder="请输入使用人岗位"/>
</el-form-item>
<el-input v-model="AddForm.userPosition" placeholder="请输入使用人岗位" />
</el-form-item>
<el-form-item label="押金金额(RMB)">
<el-input v-model="AddForm.deposit" placeholder="请输入押金金额(元)" />
</el-form-item>
<el-form-item label="押金金额(RMB)">
<el-input v-model="AddForm.deposit" placeholder="请输入押金金额(元)" />
</el-form-item>
<el-form-item label="购买时间">
<el-date-picker
v-model="AddForm.buyingTime"
type="date"
placeholder="选择购买日期"
size="default"
format="YYYY/MM/DD"
/>
</el-form-item>
<el-form-item label="购买时间">
<el-date-picker
v-model="AddForm.buyingTime"
type="date"
placeholder="选择购买日期"
size="default"
format="YYYY/MM/DD"
/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="AddForm.notes" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<!-- 弹窗底部提交按钮 -->
<div class='el-dialog-button'>
<el-button type="danger" @click="submit">
<el-icon><Select/></el-icon>
确认提交
</el-button>
</div>
</el-dialog>
<el-form-item label="备注">
<el-input v-model="AddForm.notes" placeholder="请输入备注" />
</el-form-item>
</el-form>
<!-- 弹窗底部提交按钮 -->
<div class="el-dialog-button">
<el-button type="danger" @click="submit">
<el-icon><Select /></el-icon>
确认提交
</el-button>
</div>
</el-dialog>
</div>
<!-- 弹窗结束 -->
</div>
<!-- 弹窗结束 -->
</div>
</template>
<script setup lang='ts'>
import { ref, reactive,onMounted } from 'vue';
import { getList, getDetail, add, update, remove,$_TableList } from '@/api/basic/basicPda'; //API
import { ElMessage, type UploadProps } from 'element-plus'
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import { getList, getDetail, add, update, remove, $_TableList } from '@/api/basic/basicPda'; //API
import { ElMessage, type UploadProps } from 'element-plus';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
const currentPage = ref(1); //
const pageSize = ref(30); //
const pageList = ref([5, 10, 50, 100, 200]); //
@ -200,18 +234,19 @@ const small = ref(false);
const background = ref(true); //
const disabled = ref(false); // 使
const data = ref([]); //
const TabHeight = ref();//
const AddLalog = ref(false)//
const TabHeight = ref(); //
const AddLalog = ref(false); //
const AddForm = ref({
name: '',
region: '',
type: '',
})
const value1 = ref('') //
const optionsvalue = ref('')//
const optionsvalue2=ref('')//
const uploadRef = ref()//
const options = [//
});
const value1 = ref(''); //
const optionsvalue = ref(''); //
const optionsvalue2 = ref(''); //
const uploadRef = ref(); //
const options = [
//
{
value: '0',
label: '是',
@ -220,9 +255,9 @@ const options = [//下拉选择框
value: '1',
label: '否',
},
]
const options2 = [//
];
const options2 = [
//
{
value: '1',
label: '正常',
@ -235,114 +270,114 @@ const options2 = [//下拉选择框
value: '3',
label: '不能使用(不能开机)',
},
]
];
//
function onLoad(){
// API$_TableList
$_TableList({ current:currentPage.value, size: pageSize.value }).then(res=>{
function onLoad() {
// API$_TableList
$_TableList({ current: currentPage.value, size: pageSize.value }).then(res => {
console.log(res.data.data.records);
//
data.value=res.data.data.records
})
data.value = res.data.data.records;
});
}
// DOM
onMounted(() => {
//88
TabHeight.value = TabHeight.value.offsetHeight-91;
// DOM
onLoad()
})
//88
TabHeight.value = TabHeight.value.offsetHeight - 91;
// DOM
onLoad();
});
//
const AddInfo=()=>{
const AddInfo = () => {
console.log(111);
AddLalog.value=true;
}
AddLalog.value = true;
};
//
const imageUrl = ref('')
const imageUrl = ref('');
//
const handleAvatarSuccess: UploadProps['onSuccess'] = (response,uploadFile) => {
console.log(response,uploadFile,'123123123123123122312123');
}
const handleAvatarSuccess: UploadProps['onSuccess'] = (response, uploadFile) => {
console.log(response, uploadFile, '123123123123123122312123');
};
//
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
const beforeAvatarUpload: UploadProps['beforeUpload'] = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!')
return false
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!')
return false
ElMessage.error('图片格式只能为image/png!');
return false;
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
return true
}
const res = await compressImageBlob(rawFile);
return res;
};
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
// IDV
.el-content-el {
padding: 0 8px;
padding-top:8px;
padding-top: 8px;
background-color: #fff;
height: 100%;
box-sizing: border-box;
//
:deep(.el-Cart-button) {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
}
//
.el-Cart-button-left,.el-Cart-button-right{
display: flex;
margin: 0 0px;
justify-content: space-between;
}
.el-Cart-button-left{
:deep( button){
padding: 0 7px;
min-width: 70px;
//
:deep(.el-Cart-button) {
margin-bottom: 8px;
display: flex;
span{
width: 100%;
display: inline-flex;
align-items: center;
justify-content: space-between;
i{
margin-right: 6px;
}
}
}
}
//
.el-Cart-button-left,
.el-Cart-button-right {
display: flex;
margin: 0 0px;
justify-content: space-between;
}
.el-Cart-button-left {
:deep(button) {
padding: 0 7px;
min-width: 70px;
display: flex;
span {
width: 100%;
display: inline-flex;
align-items: center;
justify-content: space-between;
i {
margin-right: 6px;
}
}
}
.el-Cart-button-right {
}
.el-Cart-button-right {
display: flex;
margin: 0 0px;
justify-content: space-between;
align-items: center;
button {
background-color: transparent;
border-radius: 50%;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #ccc;
margin-right: 8px;
&:hover {
background-color: #172e601f;
i {
color: #0e2549;
}
}
//
&:last-child {
margin-right: 0;
background-color: transparent;
border-radius: 50%;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #ccc;
margin-right: 8px;
&:hover {
background-color: #172e601f;
i {
color: #0e2549;
}
}
//
&:last-child {
margin-right: 0;
}
}
}
.el-Cart {
//
:deep(.el-table__header) {
@ -375,89 +410,87 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
}
}
//
:deep(.addlalog){
//
.el-dialog__header{
border-bottom: 1px solid #172e607d ;
margin-right:0;
margin-bottom:0;
padding-bottom:20px;
position: relative;
i{
color:#172e60;
}
}
// 线
.el-dialog__header::after{
content: "";
display: block;
width: 3px;
height: 16px;
background-color: #172e60;
position: absolute;
left: 8px;
top: 24px;
}
.el-dialog__body{
.el-form{
width: 100%;
display:flex;
flex-wrap: wrap;
justify-content: space-between;
:deep(.addlalog) {
//
.el-dialog__header {
border-bottom: 1px solid #172e607d;
margin-right: 0;
margin-bottom: 0;
padding-bottom: 20px;
position: relative;
i {
color: #172e60;
}
}
.el-form-item{
width:276px;
// 线
.el-dialog__header::after {
content: '';
display: block;
width: 3px;
height: 16px;
background-color: #172e60;
position: absolute;
left: 8px;
top: 24px;
}
/* 去掉第三个、第六个、第九个div的右外边距 */
.el-form-item:nth-child(3n) {
margin-right: 0;
}
}
.el-form-item__content{
height:30px;
//
.el-input{
width: 100%;
height:30px !important;
}
//
.el-select{
width: 100%;
.el-dialog__body {
.el-form {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.el-form-item {
width: 276px;
}
/* 去掉第三个、第六个、第九个div的右外边距 */
.el-form-item:nth-child(3n) {
margin-right: 0;
}
}
}
.el-form-item__content {
height: 30px;
//
.el-input {
width: 100%;
height: 30px !important;
}
//
.el-select {
width: 100%;
}
}
}
//
.el-dialog-button{
display:flex;
justify-content: flex-end;
.el-dialog-button {
display: flex;
justify-content: flex-end;
}
//
.img-icon{
.img-icon {
width: 100%;
position: relative;
.el-button{
width: 100%;
background-color: #fff;
color: #a8abb9;
justify-content: flex-start;
border: 1px solid #dcdfe6;
.el-button {
width: 100%;
background-color: #fff;
color: #a8abb9;
justify-content: flex-start;
border: 1px solid #dcdfe6;
}
i{
position:absolute;
i {
position: absolute;
left: 110px;
top: 8px;
font-size:18px
font-size: 18px;
}
}
:deep(.upload-demo){
width:100%;
.el-upload{
width:100%
:deep(.upload-demo) {
width: 100%;
.el-upload {
width: 100%;
}
}
}
</style>
</style>

11
src/views/distribution/artery/TripartiteTransfer.vue

@ -597,6 +597,7 @@ import type { UploadRawFile, UploadFiles, UploadFile } from 'element-plus';
import { useRouter } from 'vue-router';
import type { UploadProps } from 'element-plus';
import { getToken } from '@/utils/auth';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import print from '@/utils/print';
//
@ -1470,7 +1471,7 @@ const handlePictureCardPreview: UploadProps['onPreview'] = uploadFile => {
};
/** 上传前类型检测 */
const handleBeforeUpload = (rawFile: UploadRawFile) => {
const handleBeforeUpload = async (rawFile: UploadRawFile) => {
console.log('rawFile :>> ', rawFile);
const _nameArr = rawFile.name.split('.');
@ -1483,9 +1484,11 @@ const handleBeforeUpload = (rawFile: UploadRawFile) => {
const _whiteArr = ['png', 'jpg', 'jpeg'];
if (_whiteArr.includes(_name.toLocaleLowerCase())) return true;
ElMessage.warning('请上传png、jpg、jpeg的类型图片');
return false;
if (!_whiteArr.includes(_name.toLocaleLowerCase()))
return ElMessage.warning('请上传png、jpg、jpeg的类型图片');
const res = await compressImageBlob(rawFile);
return res;
};
/** 上传成功 */

24
src/views/distribution/artery/VehicleStowageDetails.vue

@ -399,6 +399,7 @@
action="/api/blade-resource/oss/endpoint/put-file"
list-type="picture-card"
:headers="details.headers"
:before-upload="handleBeforeUpload"
:multiple="true"
>
<el-icon><Plus /></el-icon>
@ -469,7 +470,7 @@ import {
} from '@/utils/util';
import { detailsColumnList, nodeInfoColumnList } from '@/option/distribution/addVehicleStowage';
import { detailsColumnList as abnormalColumn } from '@/option/distribution/TripartiteTransfer';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
import {
@ -741,6 +742,27 @@ const initOriginWarehouseOrder = async () => {
}
};
/** 上传前类型检测 */
const handleBeforeUpload = async (rawFile: UploadRawFile) => {
console.log('rawFile :>> ', rawFile);
const _nameArr = rawFile.name.split('.');
if (_nameArr.length === 0) {
ElMessage.warning('异常类型文件');
return false;
}
const _name = _nameArr[_nameArr.length - 1];
const _whiteArr = ['png', 'jpg', 'jpeg'];
if (!_whiteArr.includes(_name.toLocaleLowerCase()))
return ElMessage.warning('请上传png、jpg、jpeg的类型图片');
const res = await compressImageBlob(rawFile);
return res;
};
/** 请求日志跟踪 */
const handleSignLoadScanLogs = async () => {
try {

15
src/views/distribution/artery/directGoMarketDetails.vue

@ -355,6 +355,7 @@
:on-success="handleSiginImgSuccess"
:headers="details.headers"
:on-remove="handleRemove"
:before-upload="beforeAvatarUpload"
multiple
>
<el-icon><Plus /></el-icon>
@ -413,6 +414,7 @@ import {
postSignOrderZeroSuppleList,
} from '@/api/distribution/directGoMarket';
import { postAddZeroSupple } from '@/api/distribution/zeroAdditionalRecording';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { postFindSignPhotoList } from '@/api/distribution/directMerchantSign.js';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
@ -980,6 +982,19 @@ const handleZeroSubmit = async () => {
}
};
//
const beforeAvatarUpload: UploadProps['beforeUpload'] = async rawFile => {
if (rawFile.type !== 'image/png') {
ElMessage.error('图片格式只能为image/png!');
return false;
} else if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片大小不能大于2MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
/** 签收 -- 订单 */
const handleOrderSigin = async ({ row }) => {
if (!ChecksWhetherTheWarehouseIsSelected())

26
src/views/distribution/deliverylist/distributionDeliveryListedt.vue

@ -756,6 +756,7 @@
:on-preview="EnlargeTheTmageA"
:on-remove="handleRemove"
:on-success="ImgSuccessA"
:before-upload="handleBeforeUpload"
:headers="headers"
multiple
drag
@ -775,6 +776,7 @@
list-type="picture-card"
:on-preview="EnlargeTheTmageB"
:on-remove="handleRemove"
:before-upload="handleBeforeUpload"
:on-success="ImgSuccessB"
:headers="headers"
multiple
@ -795,6 +797,7 @@
list-type="picture-card"
:on-preview="EnlargeTheTmageC"
:on-remove="handleRemove"
:before-upload="handleBeforeUpload"
:on-success="ImgSuccessC"
:headers="headers"
multiple
@ -815,6 +818,7 @@
list-type="picture-card"
:on-preview="EnlargeTheTmageD"
:on-remove="handleRemove"
:before-upload="handleBeforeUpload"
:on-success="ImgSuccessD"
:headers="headers"
multiple
@ -835,6 +839,7 @@
list-type="picture-card"
:on-preview="EnlargeTheTmageE"
:on-remove="handleRemove"
:before-upload="handleBeforeUpload"
:on-success="ImgSuccessE"
:headers="headers"
multiple
@ -4652,9 +4657,8 @@ export default {
.catch(() => {});
},
//
//
abnormalretention(row) {
ElMessageBox.confirm('是否确认滞留操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -5476,7 +5480,25 @@ export default {
break;
}
},
async handleBeforeUpload(rawFile) {
console.log('rawFile :>> ', rawFile);
const _nameArr = rawFile.name.split('.');
if (_nameArr.length === 0) {
this.$message.warning('异常类型文件');
return false;
}
const _name = _nameArr[_nameArr.length - 1];
const _whiteArr = ['png', 'jpg', 'jpeg'];
if (!_whiteArr.includes(_name.toLocaleLowerCase()))
return this.$message.warning('请上传png、jpg、jpeg的类型图片');
const res = await compressImageBlob(rawFile);
return res;
},
//
checkFn(row) {
console.log('签收>>>>>>>>>>', row);

12
src/views/distribution/inventory/distrilbutionBillLading.vue

@ -206,6 +206,7 @@
multiple
:on-preview="handlePreview"
:disabled="smIMG"
:before-upload="beforeUpload"
:on-success="
(response, file, fileList) => {
uploadSuccess(fileListSell);
@ -229,6 +230,7 @@
:action="action"
:headers="headers"
multiple
:before-upload="beforeUpload"
:disabled="smIMG"
:on-preview="handlePreview"
:on-success="
@ -254,6 +256,7 @@
class="upload-demo"
:action="action"
:headers="headers"
:before-upload="beforeUpload"
:disabled="smIMG"
multiple
:on-preview="handlePreview"
@ -284,6 +287,7 @@
class="upload-demo"
:action="action"
:headers="headers"
:before-upload="beforeUpload"
multiple
:on-preview="handlePreview"
:on-success="
@ -308,6 +312,7 @@
class="upload-demo"
:action="action"
:headers="headers"
:before-upload="beforeUpload"
multiple
:on-preview="handlePreview"
:on-success="
@ -331,6 +336,7 @@
v-model:file-list="fileListLibrary"
class="upload-demo"
:action="action"
:before-upload="beforeUpload"
:headers="headers"
multiple
:on-preview="handlePreview"
@ -675,6 +681,7 @@ import dayjs from 'dayjs';
import { detail } from '@/api/flow/flow';
import { nextTick, ref } from 'vue';
import { useStore } from 'vuex';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { setNodeHeight } from '@/utils/util.js';
import error from '@/error';
const $store = useStore();
@ -3321,6 +3328,11 @@ export default {
this.form = res.data.data;
});
},
/** 上传 */
async beforeUpload(file) {
const compressedBlob = await compressImageBlob(file);
return compressedBlob;
},
//
handleAddOrder() {
this.selectionList = [];

160
src/views/distribution/signfor/distributionSignforedt.vue

@ -27,12 +27,12 @@
<div class="el-txt">
<el-icon><School /></el-icon>
<span class="title-name">商场名称:</span>
<el-input v-model="form.mallName" disabled placeholder="暂无商场名称" />
<el-input v-model="form.mallName" disabled placeholder="暂无商场名称" />
</div>
<div class="el-txt">
<el-icon><Calendar /></el-icon>
<span class="title-name"> 预约时间:</span>
<el-input v-model="form.reservationDate" disabled placeholder="暂无预约时间" />
<el-input v-model="form.reservationDate" disabled placeholder="暂无预约时间" />
</div>
</div>
@ -42,32 +42,32 @@
<div class="el-txt">
<el-icon><Van /></el-icon>
<span class="title-name">配送车次:</span>
<el-input v-model="form.trainNumber" disabled placeholder="暂无配送车次" />
<el-input v-model="form.trainNumber" disabled placeholder="暂无配送车次" />
</div>
<div class="el-txt">
<el-icon><User /></el-icon>
<span class="title-name">司机姓名:</span>
<el-input v-model="form.driverName" disabled placeholder="暂无司机姓名" />
<el-input v-model="form.driverName" disabled placeholder="暂无司机姓名" />
</div>
<div class="el-txt">
<el-icon><Postcard /></el-icon>
<span class="title-name"> 车辆牌照:</span>
<el-input v-model="form.vehicleName" disabled placeholder="暂无车辆牌照" />
<el-input v-model="form.vehicleName" disabled placeholder="暂无车辆牌照" />
</div>
<div class="el-txt">
<el-icon><Van /></el-icon>
<span class="title-name"> 装车班组:</span>
<el-input v-model="form.loadingTeamName" disabled placeholder="暂无装车班组" />
<el-input v-model="form.loadingTeamName" disabled placeholder="暂无装车班组" />
</div>
<div class="el-txt" style="margin-top: 20px">
<el-icon><Van /></el-icon>
<span class="title-name"> 卸车班组:</span>
<el-input v-model="form.unLoadingTeamName" disabled placeholder="暂无卸车班组" />
<el-input v-model="form.unLoadingTeamName" disabled placeholder="暂无卸车班组" />
</div>
<div class="el-txt" style="margin-top: 20px">
<el-icon><Stopwatch /></el-icon>
<span class="title-name"> 实际配送时间:</span>
<el-input v-model="pageRow.taskTime" disabled placeholder="卸车班组" />
<el-input v-model="pageRow.taskTime" disabled placeholder="卸车班组" />
</div>
</div>
@ -77,7 +77,7 @@
<div class="el-txt">
<el-icon><User /></el-icon>
<span class="title-name">收货人姓名:</span>
<el-input v-model="form.consignee" disabled placeholder="暂无收货人姓名" />
<el-input v-model="form.consignee" disabled placeholder="暂无收货人姓名" />
</div>
<div class="el-txt">
<el-icon><User /></el-icon>
@ -102,12 +102,12 @@
<div class="el-txt">
<el-icon><Van /></el-icon>
<span class="title-name"> 是否加急:</span>
<el-input v-model="form.isUrgent" disabled placeholder="是否加急" />
<el-input v-model="form.isUrgent" disabled placeholder="是否加急" />
</div>
<div class="el-txt notes">
<el-icon><Edit /></el-icon>
<span class="title-name title-notes"> 客户备注:</span>
<el-input v-model="form.remarks" disabled placeholder="暂无客户备注" />
<el-input v-model="form.remarks" disabled placeholder="暂无客户备注" />
</div>
</div>
<!-- 签收信息 -->
@ -124,12 +124,12 @@
<div class="el-txt el-positioning">
<el-icon><LocationInformation /></el-icon>
<span class="title-name">定位打卡:</span>
<el-input
class="positioning"
v-model="form.positioningAdr"
disabled
placeholder="暂无定位打卡"
/>
<el-input
class="positioning"
v-model="form.positioningAdr"
disabled
placeholder="暂无定位打卡"
/>
</div>
<div class="el-sw">
<div class="el-box">
@ -137,13 +137,12 @@
<el-icon><LocationInformation /></el-icon>
<span class="title-name">文员备注:</span>
</div>
<el-input
class="positioning"
v-model="form.clerkSignRemarks"
disabled
placeholder="暂无文员备注"
/>
<el-input
class="positioning"
v-model="form.clerkSignRemarks"
disabled
placeholder="暂无文员备注"
/>
</div>
<div class="el-box">
@ -151,14 +150,13 @@
<el-icon><LocationInformation /></el-icon>
<span class="title-name">司机备注:</span>
</div>
<el-input
class="positioning"
v-model="form.driverRemarks"
disabled
placeholder="暂无司机备注"
/>
<el-input
class="positioning"
v-model="form.driverRemarks"
disabled
placeholder="暂无司机备注"
/>
</div>
</div>
</div>
@ -167,41 +165,40 @@
<div class="el-txt">
<el-icon><User /></el-icon>
<span class="title-name">计划件数:</span>
<el-input v-model="pageRow.reservationNum" disabled placeholder="暂无计划件数"/>
<el-input v-model="pageRow.reservationNum" disabled placeholder="暂无计划件数" />
</div>
<div class="el-txt">
<el-icon><User /></el-icon>
<span class="title-name">装车件数:</span>
<el-input v-model="pageRow.loadedNumber" disabled placeholder="暂无装车件数"/>
<el-input v-model="pageRow.loadedNumber" disabled placeholder="暂无装车件数" />
</div>
<div class="el-txt">
<el-icon><Postcard /></el-icon>
<span class="title-name"> 签收件数:</span>
<el-input v-model="pageRow.receivedQuantity" disabled placeholder="暂无签收件数"/>
<el-input v-model="pageRow.receivedQuantity" disabled placeholder="暂无签收件数" />
</div>
<div class="el-txt">
<el-icon><Van /></el-icon>
<span class="title-name"> 复核人:</span>
<el-input v-model="pageRow.examineUserName" disabled placeholder="暂无复核人"/>
<el-input v-model="pageRow.examineUserName" disabled placeholder="暂无复核人" />
</div>
<div class="el-txt" style=" margin-top: 24px;">
<div class="el-txt" style="margin-top: 24px">
<el-icon><Van /></el-icon>
<span class="title-name"> 签收人:</span>
<el-input v-model="pageRow.signeeName" disabled placeholder="暂无签收人"/>
</div>
<el-input v-model="pageRow.signeeName" disabled placeholder="暂无签收人" />
</div>
<div class="el-txt" style=" margin-top: 24px;">
<div class="el-txt" style="margin-top: 24px">
<el-icon><Van /></el-icon>
<span class="title-name"> 签收完成时间:</span>
<el-input v-model="pageRow.sjsigningTime" disabled placeholder="暂无签收完成时间" />
</div>
<el-input v-model="pageRow.sjsigningTime" disabled placeholder="暂无签收完成时间" />
</div>
<div class="el-txt" style=" margin-top: 24px;">
<div class="el-txt" style="margin-top: 24px">
<el-icon><Van /></el-icon>
<span class="title-name"> 文员复核时间:</span>
<el-input v-model="pageRow.signingTime" disabled placeholder="暂无文员复核时间" />
</div>
<el-input v-model="pageRow.signingTime" disabled placeholder="暂无文员复核时间" />
</div>
</div>
<div class="FImg">
@ -217,6 +214,7 @@
:on-preview="EnlargeTheTmageA"
:on-remove="handleRemove"
:on-success="ImgSuccessA"
:before-upload="beforeAvatarUpload"
:headers="headers"
disabled
>
@ -248,6 +246,7 @@
list-type="picture-card"
:on-preview="EnlargeTheTmageB"
:on-remove="handleRemove"
:before-upload="beforeAvatarUpload"
:on-success="ImgSuccessB"
:headers="headers"
disabled
@ -281,6 +280,7 @@
:action="doubledCount"
list-type="picture-card"
:on-preview="EnlargeTheTmageC"
:before-upload="beforeAvatarUpload"
:on-remove="handleRemove"
:on-success="ImgSuccessC"
:headers="headers"
@ -314,6 +314,7 @@
list-type="picture-card"
:on-preview="EnlargeTheTmageD"
:on-remove="handleRemove"
:before-upload="beforeAvatarUpload"
:on-success="ImgSuccessD"
:headers="headers"
disabled
@ -346,6 +347,7 @@
:action="doubledCount"
list-type="picture-card"
:on-preview="EnlargeTheTmageE"
:before-upload="beforeAvatarUpload"
:on-remove="handleRemove"
:on-success="ImgSuccessE"
:headers="headers"
@ -370,8 +372,10 @@
</div>
<!-- 签收信息 -->
<el-button style="margin-top:10px" type="primary" icon="Position" @click="Signforexport">导出</el-button>
<el-collapse class="el_commodity" v-model="activeNames" >
<el-button style="margin-top: 10px" type="primary" icon="Position" @click="Signforexport"
>导出</el-button
>
<el-collapse class="el_commodity" v-model="activeNames">
<el-collapse-item title="商品信息" name="1">
<el-tabs
v-loading="editLoading"
@ -379,7 +383,6 @@
type="border-card"
@tab-click="tabClick"
>
<template v-for="item in Tabs" :key="item.name">
<el-tab-pane :label="item.label" :name="item.name">
<template v-if="item.type === 'package'">
@ -706,6 +709,7 @@ import { getToken } from '@/utils/auth';
import { ElMessage } from 'element-plus';
import { ElMessageBox } from 'element-plus';
import { setNodeHeight } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { onMounted } from 'vue';
import { downloadXls } from '@/utils/util';
const form = ref({}); //
@ -1557,7 +1561,7 @@ const menuData3 = ref([
{
prop: 'signingStatus',
label: '签收状态',
type:1,
type: 1,
values: '',
width: '200',
checkarr: [],
@ -1854,14 +1858,14 @@ const btnClass = type => {
ElBtnClass.value = 'el-Btn-btn';
}
};
const pageRow=ref({});//
const pageRow = ref({}); //
//
const onLoad = () => {
menuData.value = menuData1.value; //
data.value = InitializeTable.value; //
pageRow.value=JSON.parse(route.query.row)
pageRow.value = JSON.parse(route.query.row);
};
console.log(route.query,'route.query');
console.log(route.query, 'route.query');
// RouterId.value = '1721707916601487362';
// RouterReservationId.value = '1721707896171032578';
@ -2114,8 +2118,8 @@ const ConfirmSubmission = () => {
DataInfo.deliveryId = RouterId.value; //ID
DataInfo.addvalueType = TcIndex.value; //
DataInfo.packageEntityList = data; //
console.log(TcData.value,'TcData.value');
console.log(TcData.value, 'TcData.value');
console.log(DataInfo, '最后要提交的值');
//
@ -2163,7 +2167,7 @@ const serviceSearch = val => {
//
editLoading.value = true; //
getDetail(RouterId.value).then(res => {
if(!res.data.data){
if (!res.data.data) {
return;
}
editLoading.value = false; //
@ -2257,8 +2261,8 @@ function InventoryList() {
editLoading.value = true; //
data.value = [];
signforInventoryList(RouterId.value).then(res => {
console.log(res,'库存品');
console.log(res, '库存品');
if (res.data.code !== 200) return;
console.log(res, '库存品列表');
// data.value = res.data.data || [];
@ -2292,6 +2296,20 @@ const tabClick = val => {
}
};
//
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
//
const Signforexport = () => {
console.log(SignforMenu.value);
@ -2303,20 +2321,20 @@ const Signforexport = () => {
.then(() => {
let data = {
id: RouterId.value,
};
};
editLoading.value = true;
return $_distributionSignforDetailExcel(data)
.then(res => {
downloadXls(res.data, `${SignforMenu.value.label}.xlsx`);
ElMessage({
type: 'success',
message: '导出成功',
});
})
.catch(() => {})
.finally(() => {
editLoading.value = false;
.then(res => {
downloadXls(res.data, `${SignforMenu.value.label}.xlsx`);
ElMessage({
type: 'success',
message: '导出成功',
});
})
.catch(() => {})
.finally(() => {
editLoading.value = false;
});
//
// if (SignforMenu.value.label == '') {
// return $_distributionSignforOrderList(data)
@ -2742,8 +2760,8 @@ const handleChooseSigneState = val => {
.goodsTable {
flex: 1;
}
.el_Server{
.el-tab-pane{
.el_Server {
.el-tab-pane {
display: flex;
flex-direction: column;
}

16
src/views/finance/SettlementInformation.vue

@ -62,6 +62,7 @@
multiple
:limit="10"
:on-preview="handlePictureCardPreview"
:before-upload="beforeAvatarUpload"
:on-remove="handleRemove"
:headers="details.headers"
>
@ -149,6 +150,7 @@ import type { UploadUserFile, UploadProps } from 'element-plus';
import { useRoute, useRouter } from 'vue-router';
import { getOpenOrderAdvanceFindWarehouseList } from '@/api/distribution/CreateOrder.js';
import { debounce, getObjType } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
import { useStore } from 'vuex';
@ -425,6 +427,20 @@ const handleShowImg = ({ row }) => {
console.log('details.imgList :>> ', details.imgList);
details.popUpShow.showImgVisited = true;
};
//
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
</script>
<style scoped lang="scss">

16
src/views/finance/SettlementTransactionInformation.vue

@ -89,6 +89,7 @@
action="/api/blade-resource/oss/endpoint/put-file"
multiple
:limit="10"
:before-upload="beforeAvatarUpload"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:headers="details.headers"
@ -176,6 +177,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
import type { UploadUserFile, UploadProps } from 'element-plus';
import { useRoute, useRouter } from 'vue-router';
import { getOpenOrderAdvanceFindWarehouseList } from '@/api/distribution/CreateOrder.js';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { debounce, getObjType } from '@/utils/util';
import { getToken } from '@/utils/auth';
import { useStore } from 'vuex';
@ -461,6 +463,20 @@ const handleShowImg = ({ row }) => {
console.log('details.imgList :>> ', details.imgList);
details.popUpShow.showImgVisited = true;
};
//
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
</script>
<style scoped lang="scss">

16
src/views/finance/TransactionInformation.vue

@ -104,6 +104,7 @@
drag
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
multiple
:before-upload="beforeAvatarUpload"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
@ -187,6 +188,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
import type { UploadUserFile, UploadProps } from 'element-plus';
import { useRoute, useRouter } from 'vue-router';
import { getOpenOrderAdvanceFindWarehouseList } from '@/api/distribution/CreateOrder.js';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { debounce, getObjType } from '@/utils/util';
import { useStore } from 'vuex';
@ -658,6 +660,20 @@ const handleShowImg = ({ row }) => {
console.log('details.imgList :>> ', details.imgList);
details.popUpShow.showImgVisited = true;
};
//
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
</script>
<style scoped lang="scss">

16
src/views/finance/WaybillAudit.vue

@ -125,6 +125,7 @@
action="/api/blade-resource/oss/endpoint/put-file"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:before-upload="beforeAvatarUpload"
:headers="details.header"
:on-remove="handleRemove"
>
@ -160,6 +161,7 @@ import {
} from '@/api/waybill/TemporaryStorageList';
import { postPageFinanceWaybillList } from '@/api/finance/WaybillAudit';
import { postCheckWaybill } from '@/api/distribution/CreateOrder.js';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { postAbolishWaybill, postSaveWaybillReturn } from '@/api/waybill/WaybillOrderList.js';
import {
downloadXls,
@ -512,6 +514,20 @@ const handleUploadReceiptSubmit = async () => {
}
};
//
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
/** 图片删除 */
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles);

18
src/views/supervise/IndicatorList.vue

@ -229,6 +229,7 @@
<el-upload
v-model:file-list="srcList"
list-type="picture-card"
:before-upload="beforeAvatarUpload"
:on-preview="Photoviewing"
>
<el-icon><Plus /></el-icon>
@ -378,6 +379,7 @@
<el-upload
disabled
v-model:file-list="srcList"
:before-upload="beforeAvatarUpload"
list-type="picture-card"
:on-preview="Photoviewing"
>
@ -426,6 +428,7 @@ import { IndicatorColumnList } from '@/option/supervise/supervise.js';
import functions from '@/utils/functions.js';
import { setNodeHeight, deepClone } from '@/utils/util';
import { downloadXls } from '@/utils/util';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import {
$_Getclassify,
$_newlyadded,
@ -581,6 +584,21 @@ const loadChildren = (targetList, parentId, indicatorValue) => {
return Promise.all(childRequests);
});
};
//
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
//
const classification = (val, index) => {
console.log(index, '当前点击的谁');

12
src/views/supervise/management.vue

@ -820,7 +820,7 @@ const selectsc = () => {};
const PointsManagementFn = () => {};
/** 上传文件 */
const handleBeforeUpload = file => {
const handleBeforeUpload = async file => {
console.log('file :>> ', file);
details.loadingObj.UploadLoadong = true;
@ -830,11 +830,13 @@ const handleBeforeUpload = file => {
const whiteArr = ['xls', 'xlsx'];
if (whiteArr.indexOf(_fileType) !== -1) return true;
if (whiteArr.indexOf(_fileType) !== -1) {
details.loadingObj.UploadLoadong = false;
return ElMessage.warning('请传入xls或xlsx格式的文件');
}
ElMessage.warning('请传入xls或xlsx格式的文件');
details.loadingObj.UploadLoadong = false;
return false;
const res = await compressImageBlob(rawFile);
return res;
};
/** 长传成功 */

13
src/views/system/pdaversion/pdaversionManage.vue

@ -179,6 +179,7 @@
import { getList, getDetail, add, update, remove, tenantpage } from '@/api/system/pdaversionManage';
import option from '@/option/system/pdaversionManage';
import { mapGetters } from 'vuex';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { getToken } from '@/utils/auth';
import { handleClearTableQuery } from '@/utils/util';
import axios from "axios";
@ -436,8 +437,16 @@ export default {
handleClearTableQuery(this.columnList);
this.onLoad(this.page);
},
uploadBefore(file, done, loading, column) {
return true; // true false
uploadBefore(rawFile, done, loading, column) {
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
},
async customUploadRequest({ file }) {
try {

16
src/views/waybill/WaybillOrderList.vue

@ -215,6 +215,7 @@
action="/api/blade-resource/oss/endpoint/put-file"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:before-upload="beforeAvatarUpload"
:headers="details.header"
:on-remove="handleRemove"
>
@ -278,6 +279,7 @@ import {
postUnFreezeWaybill,
postExport,
} from '@/api/waybill/WaybillOrderList.js';
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import {
downloadXls,
setNodeHeight,
@ -499,6 +501,20 @@ const onLoad = async (page?: any, params = {}) => {
onLoad();
//
const beforeAvatarUpload = async rawFile => {
console.log(rawFile);
if (rawFile.type !== 'image/png' && rawFile.type !== 'image/jpeg') {
ElMessage.error('图片格式只能为 png/jpg!');
return false;
} else if (rawFile.size / 1024 / 1024 > 10) {
ElMessage.error('图片大小不能大于10MB!');
return false;
}
const res = await compressImageBlob(rawFile);
return res;
};
/** 搜索 */
const searchChange = () => {
onLoad(details.page);

Loading…
Cancel
Save