Merge branch 'ah-simple' of http://192.168.0.75:3000/bonus/Zlpt_Portal into ah-simple
This commit is contained in:
commit
ff4a303c97
|
|
@ -23,13 +23,11 @@ declare module 'vue' {
|
|||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||
ElCountdown: typeof import('element-plus/es')['ElCountdown']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
|
|
@ -37,18 +35,15 @@ declare module 'vue' {
|
|||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElStep: typeof import('element-plus/es')['ElStep']
|
||||
ElSteps: typeof import('element-plus/es')['ElSteps']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTag: typeof import('element-plus/es')['ElTag']
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ VITE_API_URL = '/proxyApi'
|
|||
|
||||
# VITE_proxyTarget = 'http://192.168.0.234:28080' # 马帅
|
||||
# VITE_proxyTarget = 'http://192.168.2.122:28080' # 梁超
|
||||
VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试÷服务
|
||||
# VITE_proxyTarget = 'http://36.33.26.201:17788/proxyApi' # 测试÷服务
|
||||
# VITE_proxyTarget = 'http://192.168.0.244:28580' # 测试服务
|
||||
# VITE_proxyTarget = 'http://192.168.2.75:28080' # 盛旭
|
||||
VITE_proxyTarget = 'http://192.168.0.96:28080' # 马帅
|
||||
|
||||
# VITE_proxyTarget = 'http://10.40.92.185:9206' # 赵福海 ( 设备类型)
|
||||
# VITE_proxyTarget = 'http://10.40.92.16:9502' # 牛 (个人中心 基础信息企业申请认证)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
<template>
|
||||
<div class="custom-date-picker">
|
||||
<el-button @click="showPicker = !showPicker" :size="size" class="date-picker-button">
|
||||
<el-button
|
||||
@click="showPicker = !showPicker"
|
||||
:size="size"
|
||||
class="date-picker-button"
|
||||
:disabled="props.isDisabled"
|
||||
>
|
||||
{{ displayDate }}
|
||||
</el-button>
|
||||
<el-date-picker
|
||||
|
|
@ -25,7 +30,7 @@ const disabledDate = (date) => {
|
|||
const today = new Date()
|
||||
// 禁用今天之前的日期
|
||||
// return date.getTime() < today.getTime()
|
||||
return date.setHours(0, 0, 0, 0) < today.setHours(0, 0, 0, 0);
|
||||
return date.setHours(0, 0, 0, 0) < today.setHours(0, 0, 0, 0)
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -65,6 +70,10 @@ const props = defineProps({
|
|||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isDisabled: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'onLeaseDateChange'])
|
||||
|
|
|
|||
|
|
@ -72,12 +72,19 @@
|
|||
v-model="goods.isChecked"
|
||||
@change="onChangeGoods(index)"
|
||||
:key="goods.id"
|
||||
:disabled="goods.maStatus != 2"
|
||||
>
|
||||
</el-checkbox>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="9" class="goods-info">
|
||||
<img :src="goods.picUrl" alt="" />
|
||||
<div class="img-box">
|
||||
<img :src="goods.picUrl" alt="" />
|
||||
<div class="img-mask" v-if="goods.maStatus != 2">
|
||||
<span> 装备已下架 </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="goods-code">
|
||||
<div style="font-size: 14px; font-weight: bold">
|
||||
{{ goods.deviceName }}
|
||||
|
|
@ -112,6 +119,7 @@
|
|||
size="large"
|
||||
placeholder="选择日期"
|
||||
@onLeaseDateChange="onLeaseDateChange"
|
||||
:isDisabled="goods.maStatus != 2"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
|
|
@ -133,6 +141,7 @@
|
|||
:min="1"
|
||||
:max="goods.deviceCount || 1"
|
||||
size="small"
|
||||
:disabled="goods.maStatus != 2"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
|
|
@ -406,7 +415,9 @@ const onChangeAll = (e: boolean) => {
|
|||
cardList.value.forEach((item: any) => {
|
||||
item.isChecked = e
|
||||
item.devInfoVoList.forEach((j: any) => {
|
||||
j.isChecked = e
|
||||
if (j.maStatus == 2) {
|
||||
j.isChecked = e
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
@ -419,7 +430,11 @@ const onChangeGoods = (index: number) => {
|
|||
}
|
||||
// 公司全选事件
|
||||
const onChangeCompany = (e: boolean, index: number, item: any) => {
|
||||
cardList.value[index].devInfoVoList.every((j) => (j.isChecked = e))
|
||||
cardList.value[index].devInfoVoList.every((j: any) => {
|
||||
if (j.maStatus == 2) {
|
||||
j.isChecked = e
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 计算所有装备
|
||||
|
|
@ -435,7 +450,7 @@ const allChecked = computed(() => {
|
|||
if (cardList.value.length < 1) {
|
||||
return false
|
||||
} else {
|
||||
return cardList.value.every((e: any) => e.isChecked === true)
|
||||
return cardList.value.every((e: any) => e.maStatus == 2 && e.isChecked === true)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -444,19 +459,19 @@ const amountDevice = computed(() => {
|
|||
let amountNum = 0
|
||||
cardList.value.forEach((e: any) => {
|
||||
e.devInfoVoList.forEach((g: any) => {
|
||||
if (g.isChecked) {
|
||||
if (g.isChecked && g.maStatus == 2) {
|
||||
amountNum++
|
||||
}
|
||||
})
|
||||
})
|
||||
return amountNum
|
||||
})
|
||||
// 已勾选的装备数量
|
||||
// 已勾选的装备列表
|
||||
const amountDeviceList = computed(() => {
|
||||
let selectList: any = []
|
||||
cardList.value.forEach((e: any) => {
|
||||
e.devInfoVoList.forEach((g: any) => {
|
||||
if (g.isChecked) {
|
||||
if (g.isChecked && g.maStatus == 2) {
|
||||
selectList.push(g)
|
||||
}
|
||||
})
|
||||
|
|
@ -469,7 +484,7 @@ const orderAmountPice = computed(() => {
|
|||
let orderAmountPice = 0
|
||||
cardList.value.forEach((e: any) => {
|
||||
e.devInfoVoList.forEach((g: any) => {
|
||||
if (g.isChecked) {
|
||||
if (g.isChecked && g.maStatus == 2) {
|
||||
orderAmountPice = g.num * g.dayLeasePrice * g.days + orderAmountPice
|
||||
}
|
||||
})
|
||||
|
|
@ -854,6 +869,30 @@ getReceiptGoodsAddress()
|
|||
display: flex;
|
||||
align-content: center;
|
||||
|
||||
.img-box {
|
||||
position: relative;
|
||||
|
||||
.img-mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 10px;
|
||||
opacity: 0.6;
|
||||
background-color: #333;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 160px;
|
||||
height: 100px;
|
||||
|
|
|
|||
|
|
@ -166,30 +166,38 @@ const onChangeGoods = (index: number) => {
|
|||
}
|
||||
|
||||
// 确认收获按钮
|
||||
const confirmReceipt = () => {
|
||||
pickUpCodeFormRef.value.validate((valid:any) => {
|
||||
const confirmReceipt = () => {
|
||||
pickUpCodeFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
ElMessageBox.confirm('是否确定收货?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.log('xxxxxxxxxxxxxxxx',indexPickUpCode.value,pickUpCodeForm.pickUpCode)
|
||||
return passApi({ orderId: cardList.value[indexPickUpCode.value].orderId, orderStatus: 4,pickupCode:pickUpCodeForm.pickUpCode })
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '确定收货成功',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.log(
|
||||
'xxxxxxxxxxxxxxxx',
|
||||
indexPickUpCode.value,
|
||||
pickUpCodeForm.pickUpCode,
|
||||
)
|
||||
return passApi({
|
||||
orderId: cardList.value[indexPickUpCode.value].orderId,
|
||||
orderStatus: 4,
|
||||
pickupCode: pickUpCodeForm.pickUpCode,
|
||||
})
|
||||
})
|
||||
numberTemp.value = numberTemp.value + 1
|
||||
dialogVisiblePickUpCodeOut.value = false
|
||||
getList()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '确定收货成功',
|
||||
})
|
||||
numberTemp.value = numberTemp.value + 1
|
||||
dialogVisiblePickUpCodeOut.value = false
|
||||
getList()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -357,7 +365,7 @@ const handleViewWord = async (index: Number, row: any) => {
|
|||
// cardList.value = res.rows
|
||||
// 打开租赁协议弹框
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
wordUrl.value = res.data.url
|
||||
wordUrl.value = res.data.url
|
||||
} else {
|
||||
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
|
||||
}
|
||||
|
|
@ -392,23 +400,23 @@ const downloadContract = () => {
|
|||
|
||||
// 下载合同附件
|
||||
const downloadAnnex = async () => {
|
||||
const fileUrl = `https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/2025/contract-annex.docx`;
|
||||
|
||||
const fileUrl = `https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/2025/contract-annex.docx`
|
||||
|
||||
try {
|
||||
const response = await fetch(fileUrl);
|
||||
if (!response.ok) throw new Error('网络响应不正常');
|
||||
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.style.display = 'none';
|
||||
a.href = url;
|
||||
a.download = 'contract-annex.docx'; // 设置下载文件名
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
const response = await fetch(fileUrl)
|
||||
if (!response.ok) throw new Error('网络响应不正常')
|
||||
|
||||
const blob = await response.blob()
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.style.display = 'none'
|
||||
a.href = url
|
||||
a.download = 'contract-annex.docx' // 设置下载文件名
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error('下载失败:', error);
|
||||
console.error('下载失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -495,43 +503,51 @@ const costSubmit = () => {
|
|||
}
|
||||
|
||||
//取件码弹窗参数
|
||||
const dialogVisiblePickUpCode = ref(false);
|
||||
const dialogVisiblePickUpCode = ref(false)
|
||||
// 新增变量来存储取件码
|
||||
const pickUpCode = ref('');
|
||||
const pickUpView = async(item: any) => {
|
||||
console.log('item',item)
|
||||
const res: any = await getOrderCodeApi({orderId:item.orderId})
|
||||
console.log('res',res)
|
||||
const pickUpCode = ref('')
|
||||
const pickUpView = async (item: any) => {
|
||||
console.log('item', item)
|
||||
const res: any = await getOrderCodeApi({ orderId: item.orderId })
|
||||
console.log('res', res)
|
||||
pickUpCode.value = res.data
|
||||
dialogVisiblePickUpCode.value = true;
|
||||
};
|
||||
dialogVisiblePickUpCode.value = true
|
||||
}
|
||||
|
||||
const indexPickUpCode = ref(0);
|
||||
const indexPickUpCode = ref(0)
|
||||
//出库弹窗参数
|
||||
const dialogVisiblePickUpCodeOut = ref(false);
|
||||
const dialogVisiblePickUpCodeOut = ref(false)
|
||||
// 新增变量来存储取件码
|
||||
const pickUpCodeOut = ref('');
|
||||
const pickUpCodeOut = ref('')
|
||||
const pickUpViewOut = (index: number) => {
|
||||
indexPickUpCode.value = index;
|
||||
pickUpCodeForm.pickUpCode = '';
|
||||
dialogVisiblePickUpCodeOut.value = true;
|
||||
};
|
||||
indexPickUpCode.value = index
|
||||
pickUpCodeForm.pickUpCode = ''
|
||||
dialogVisiblePickUpCodeOut.value = true
|
||||
}
|
||||
const pickUpCodeFormRef = ref()
|
||||
//取件码表单校验规则
|
||||
const pickUpCodeRules = ref({
|
||||
pickUpCode:[
|
||||
pickUpCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入取件码',
|
||||
trigger: 'blur',
|
||||
}
|
||||
},
|
||||
],
|
||||
})
|
||||
const pickUpCodeForm = reactive<any>({
|
||||
pickUpCode: '',
|
||||
})
|
||||
|
||||
|
||||
const onJumpDetails = (goods: any) => {
|
||||
console.log(goods, 'goods')
|
||||
router.push({
|
||||
name: 'equipDetail',
|
||||
query: {
|
||||
id: goods.maId,
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -722,7 +738,12 @@ const pickUpCodeForm = reactive<any>({
|
|||
: ''
|
||||
"
|
||||
>
|
||||
<img :src="goods.url" style="width: 110px; height: 80px" alt="" />
|
||||
<img
|
||||
:src="goods.url"
|
||||
style="width: 110px; height: 80px; cursor: pointer"
|
||||
alt=""
|
||||
@click="onJumpDetails(goods)"
|
||||
/>
|
||||
<div
|
||||
style="
|
||||
flex: 1;
|
||||
|
|
@ -752,11 +773,22 @@ const pickUpCodeForm = reactive<any>({
|
|||
</span>
|
||||
<span v-if="item.orderStatus == 20">
|
||||
{{
|
||||
isNaN(momentInit(goods.takeOverTime).diff(goods.rentOverTime, 'day'))
|
||||
isNaN(
|
||||
momentInit(goods.takeOverTime).diff(
|
||||
goods.rentOverTime,
|
||||
'day',
|
||||
),
|
||||
)
|
||||
? '-'
|
||||
: momentInit(goods.takeOverTime).diff(goods.rentOverTime, 'day') == 0
|
||||
: momentInit(goods.takeOverTime).diff(
|
||||
goods.rentOverTime,
|
||||
'day',
|
||||
) == 0
|
||||
? 1
|
||||
: momentInit(goods.takeOverTime).diff(goods.rentOverTime, 'day')
|
||||
: momentInit(goods.takeOverTime).diff(
|
||||
goods.rentOverTime,
|
||||
'day',
|
||||
)
|
||||
}}{{ ' ' + '天' }}
|
||||
</span>
|
||||
|
||||
|
|
@ -887,7 +919,7 @@ const pickUpCodeForm = reactive<any>({
|
|||
确认收货
|
||||
</el-button> -->
|
||||
|
||||
<el-button
|
||||
<el-button
|
||||
v-if="item.orderStatus == '2' || item.orderStatus == '3'"
|
||||
type="primary"
|
||||
size="small"
|
||||
|
|
@ -1476,7 +1508,6 @@ const pickUpCodeForm = reactive<any>({
|
|||
<!-- </div> -->
|
||||
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px">
|
||||
<span class="dialog-footer">
|
||||
|
||||
<el-button @click="downloadAnnex" type="success"> 下载附件 </el-button>
|
||||
<el-button @click="downloadContract" type="success"> 下载合同 </el-button>
|
||||
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
|
||||
|
|
@ -1495,19 +1526,24 @@ const pickUpCodeForm = reactive<any>({
|
|||
align-center
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" style="font-size: 18px; font-weight:">
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCode"
|
||||
clearable
|
||||
style="font-size: 18px; font-weight: bold;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item
|
||||
label="取件码:"
|
||||
prop="pickUpCode"
|
||||
label-width="100px"
|
||||
style="font-size: 18px; font-weight: "
|
||||
>
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCode"
|
||||
clearable
|
||||
style="font-size: 18px; font-weight: bold"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisiblePickUpCode = false">关闭</el-button>
|
||||
|
|
@ -1516,43 +1552,38 @@ const pickUpCodeForm = reactive<any>({
|
|||
</el-dialog>
|
||||
|
||||
<!-- 收货取件码弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisiblePickUpCodeOut"
|
||||
title="出库"
|
||||
width="30%"
|
||||
align-center
|
||||
>
|
||||
<el-dialog v-model="dialogVisiblePickUpCodeOut" title="出库" width="30%" align-center>
|
||||
<el-form
|
||||
ref="pickUpCodeFormRef"
|
||||
label-position="right"
|
||||
:model="pickUpCodeForm"
|
||||
:rules="pickUpCodeRules"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" >
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCodeForm.pickUpCode"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="button-container">
|
||||
<el-button type="primary" class="primary-lease" @click="dialogVisiblePickUpCodeOut=false">
|
||||
关闭
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="primary-lease"
|
||||
@click="confirmReceipt"
|
||||
ref="pickUpCodeFormRef"
|
||||
label-position="right"
|
||||
:model="pickUpCodeForm"
|
||||
:rules="pickUpCodeRules"
|
||||
>
|
||||
收货
|
||||
</el-button>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px">
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCodeForm.pickUpCode"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="button-container">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="primary-lease"
|
||||
@click="dialogVisiblePickUpCodeOut = false"
|
||||
>
|
||||
关闭
|
||||
</el-button>
|
||||
<el-button type="primary" class="primary-lease" @click="confirmReceipt">
|
||||
收货
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -158,17 +158,17 @@ const onAcceptOrders = (item: any) => {
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async() => {
|
||||
const passApiRes = await passApi({ orderId: item.orderId, orderStatus: 2 });
|
||||
if (passApiRes && passApiRes.code === 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '接单成功',
|
||||
duration: 1000,
|
||||
});
|
||||
numberTemp.value = numberTemp.value + 1;
|
||||
getList();
|
||||
}
|
||||
.then(async () => {
|
||||
const passApiRes = await passApi({ orderId: item.orderId, orderStatus: 2 })
|
||||
if (passApiRes && passApiRes.code === 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '接单成功',
|
||||
duration: 1000,
|
||||
})
|
||||
numberTemp.value = numberTemp.value + 1
|
||||
getList()
|
||||
}
|
||||
// 检查 passApi 是否成功
|
||||
// if (passApiRes && passApiRes.code === 200) {
|
||||
// // 如果 passApi 成功,调用 passApi(原代码中的 passApiTwo 可能是拼写错误)
|
||||
|
|
@ -187,42 +187,40 @@ const onAcceptOrders = (item: any) => {
|
|||
.catch(() => {})
|
||||
}
|
||||
|
||||
|
||||
const indexPickUpCode = ref(0);
|
||||
const indexPickUpCode = ref(0)
|
||||
//出库弹窗参数
|
||||
const dialogVisiblePickUpCodeOut = ref(false);
|
||||
const dialogVisiblePickUpCodeOut = ref(false)
|
||||
// 新增变量来存储取件码
|
||||
const pickUpCodeOut = ref('');
|
||||
const pickUpCodeOut = ref('')
|
||||
const pickUpViewOut = (index: number) => {
|
||||
indexPickUpCode.value = index;
|
||||
pickUpCodeForm.pickUpCode = '';
|
||||
pickUpCodeForm.orderRemark = '';
|
||||
dialogVisiblePickUpCodeOut.value = true;
|
||||
};
|
||||
indexPickUpCode.value = index
|
||||
pickUpCodeForm.pickUpCode = ''
|
||||
pickUpCodeForm.orderRemark = ''
|
||||
dialogVisiblePickUpCodeOut.value = true
|
||||
}
|
||||
const pickUpCodeFormRef = ref()
|
||||
//取件码表单校验规则
|
||||
const pickUpCodeRules = ref({
|
||||
pickUpCode:[
|
||||
pickUpCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入取件码',
|
||||
trigger: 'blur',
|
||||
}
|
||||
},
|
||||
],
|
||||
orderRemark:[
|
||||
orderRemark: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入备注',
|
||||
trigger: 'blur',
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
})
|
||||
const pickUpCodeForm = reactive<any>({
|
||||
pickUpCode: '',
|
||||
orderRemark: '',
|
||||
})
|
||||
|
||||
|
||||
//出库按钮
|
||||
const confirmPass = async (index: number) => {
|
||||
ElMessageBox.confirm('是否确定出库?', {
|
||||
|
|
@ -719,7 +717,7 @@ const handleViewWord = async (index: Number, row: any) => {
|
|||
// cardList.value = res.rows
|
||||
// 打开租赁协议弹框
|
||||
if (import.meta.env.VITE_API_URL == '/proxyApi') {
|
||||
wordUrl.value = res.data.url
|
||||
wordUrl.value = res.data.url
|
||||
} else {
|
||||
wordUrl.value = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + res.data.url
|
||||
}
|
||||
|
|
@ -753,69 +751,88 @@ const downloadContract = () => {
|
|||
|
||||
// 下载合同附件
|
||||
const downloadAnnex = async () => {
|
||||
const fileUrl = `https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/2025/contract-annex.docx`;
|
||||
|
||||
const fileUrl = `https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/2025/contract-annex.docx`
|
||||
|
||||
try {
|
||||
const response = await fetch(fileUrl);
|
||||
if (!response.ok) throw new Error('网络响应不正常');
|
||||
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.style.display = 'none';
|
||||
a.href = url;
|
||||
a.download = 'contract-annex.docx'; // 设置下载文件名
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
const response = await fetch(fileUrl)
|
||||
if (!response.ok) throw new Error('网络响应不正常')
|
||||
|
||||
const blob = await response.blob()
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.style.display = 'none'
|
||||
a.href = url
|
||||
a.download = 'contract-annex.docx' // 设置下载文件名
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
} catch (error) {
|
||||
console.error('下载失败:', error);
|
||||
console.error('下载失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const wordUrl = ref('')
|
||||
|
||||
//取件码弹窗参数
|
||||
const dialogVisiblePickUpCode = ref(false);
|
||||
const dialogVisiblePickUpCode = ref(false)
|
||||
// 新增变量来存储取件码
|
||||
const pickUpCode = ref('');
|
||||
const pickUpView = async(item: any) => {
|
||||
console.log('item',item)
|
||||
const res: any = await getOrderCodeApi({orderId:item.orderId})
|
||||
console.log('res',res)
|
||||
const pickUpCode = ref('')
|
||||
const pickUpView = async (item: any) => {
|
||||
console.log('item', item)
|
||||
const res: any = await getOrderCodeApi({ orderId: item.orderId })
|
||||
console.log('res', res)
|
||||
pickUpCode.value = res.data
|
||||
dialogVisiblePickUpCode.value = true;
|
||||
};
|
||||
dialogVisiblePickUpCode.value = true
|
||||
}
|
||||
|
||||
// 确认收获按钮
|
||||
const confirmReceipt = () => {
|
||||
pickUpCodeFormRef.value.validate((valid:any) => {
|
||||
const confirmReceipt = () => {
|
||||
pickUpCodeFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
ElMessageBox.confirm('是否确定出库?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.log('xxxxxxxxxxxxxxxx',indexPickUpCode.value,pickUpCodeForm.pickUpCode)
|
||||
return passApi({ orderId: cardList.value[indexPickUpCode.value].orderId, orderStatus: 4,pickupCode:pickUpCodeForm.pickUpCode,orderRemark:pickUpCodeForm.orderRemark })
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '确定出库成功',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
console.log(
|
||||
'xxxxxxxxxxxxxxxx',
|
||||
indexPickUpCode.value,
|
||||
pickUpCodeForm.pickUpCode,
|
||||
)
|
||||
return passApi({
|
||||
orderId: cardList.value[indexPickUpCode.value].orderId,
|
||||
orderStatus: 4,
|
||||
pickupCode: pickUpCodeForm.pickUpCode,
|
||||
orderRemark: pickUpCodeForm.orderRemark,
|
||||
})
|
||||
})
|
||||
numberTemp.value = numberTemp.value + 1
|
||||
dialogVisiblePickUpCodeOut.value = false
|
||||
getList()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '确定出库成功',
|
||||
})
|
||||
numberTemp.value = numberTemp.value + 1
|
||||
dialogVisiblePickUpCodeOut.value = false
|
||||
getList()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const onJumpDetails = (goods: any) => {
|
||||
console.log(goods, 'goods')
|
||||
|
||||
router.push({
|
||||
name: 'equipDetail',
|
||||
query: {
|
||||
id: goods.maId,
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -1010,7 +1027,12 @@ const confirmReceipt = () => {
|
|||
"
|
||||
style="min-height: 100px"
|
||||
>
|
||||
<img :src="goods.url" style="width: 110px; height: 80px" alt="" />
|
||||
<img
|
||||
:src="goods.url"
|
||||
style="width: 110px; height: 80px; cursor: pointer"
|
||||
alt=""
|
||||
@click="onJumpDetails(goods)"
|
||||
/>
|
||||
<div
|
||||
style="
|
||||
min-height: 100px;
|
||||
|
|
@ -1040,11 +1062,22 @@ const confirmReceipt = () => {
|
|||
</span>
|
||||
<span v-if="item.orderStatus == 20">
|
||||
{{
|
||||
isNaN(momentInit(goods.takeOverTime).diff(goods.rentOverTime, 'day'))
|
||||
isNaN(
|
||||
momentInit(goods.takeOverTime).diff(
|
||||
goods.rentOverTime,
|
||||
'day',
|
||||
),
|
||||
)
|
||||
? '-'
|
||||
: momentInit(goods.takeOverTime).diff(goods.rentOverTime, 'day') == 0
|
||||
: momentInit(goods.takeOverTime).diff(
|
||||
goods.rentOverTime,
|
||||
'day',
|
||||
) == 0
|
||||
? 1
|
||||
: momentInit(goods.takeOverTime).diff(goods.rentOverTime, 'day')
|
||||
: momentInit(goods.takeOverTime).diff(
|
||||
goods.rentOverTime,
|
||||
'day',
|
||||
)
|
||||
}}{{ ' ' + '天' }}
|
||||
</span>
|
||||
|
||||
|
|
@ -2123,7 +2156,7 @@ const confirmReceipt = () => {
|
|||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="display: flex; justify-content: flex-end; margin-bottom: 10px">
|
||||
<span class="dialog-footer">
|
||||
<span class="dialog-footer">
|
||||
<el-button type="success" @click="downloadAnnex"> 下载附件 </el-button>
|
||||
<el-button @click="downloadContract" type="success"> 下载合同 </el-button>
|
||||
<el-button type="primary" @click="dialogFormVisibleSettleWord = false"
|
||||
|
|
@ -2142,19 +2175,24 @@ const confirmReceipt = () => {
|
|||
align-center
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" style="font-size: 18px; font-weight:">
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCode"
|
||||
clearable
|
||||
style="font-size: 18px; font-weight: bold;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item
|
||||
label="取件码:"
|
||||
prop="pickUpCode"
|
||||
label-width="100px"
|
||||
style="font-size: 18px; font-weight: "
|
||||
>
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCode"
|
||||
clearable
|
||||
style="font-size: 18px; font-weight: bold"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisiblePickUpCode = false">关闭</el-button>
|
||||
|
|
@ -2163,58 +2201,53 @@ const confirmReceipt = () => {
|
|||
</el-dialog>
|
||||
|
||||
<!-- 收货取件码弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisiblePickUpCodeOut"
|
||||
title="出库"
|
||||
width="30%"
|
||||
align-center
|
||||
>
|
||||
<el-dialog v-model="dialogVisiblePickUpCodeOut" title="出库" width="30%" align-center>
|
||||
<el-form
|
||||
ref="pickUpCodeFormRef"
|
||||
label-position="right"
|
||||
:model="pickUpCodeForm"
|
||||
:rules="pickUpCodeRules"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" >
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCodeForm.pickUpCode"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="备注:" prop="orderRemark" label-width="100px" >
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCodeForm.orderRemark"
|
||||
clearable
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="button-container">
|
||||
<el-button type="primary" class="primary-lease" @click="dialogVisiblePickUpCodeOut=false">
|
||||
关闭
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="primary-lease"
|
||||
@click="confirmReceipt"
|
||||
ref="pickUpCodeFormRef"
|
||||
label-position="right"
|
||||
:model="pickUpCodeForm"
|
||||
:rules="pickUpCodeRules"
|
||||
>
|
||||
出库
|
||||
</el-button>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px">
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCodeForm.pickUpCode"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="备注:" prop="orderRemark" label-width="100px">
|
||||
<el-input
|
||||
autocomplete="off"
|
||||
maxlength="20"
|
||||
v-model="pickUpCodeForm.orderRemark"
|
||||
clearable
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="button-container">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="primary-lease"
|
||||
@click="dialogVisiblePickUpCodeOut = false"
|
||||
>
|
||||
关闭
|
||||
</el-button>
|
||||
<el-button type="primary" class="primary-lease" @click="confirmReceipt">
|
||||
出库
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue