接口调用,打包配置

This commit is contained in:
13218645326 2023-12-08 17:03:26 +08:00
parent 3ee01f9594
commit ab3d43f629
9 changed files with 234 additions and 108 deletions

3
components.d.ts vendored
View File

@ -17,6 +17,7 @@ declare module 'vue' {
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
@ -28,6 +29,8 @@ declare module 'vue' {
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElProgress: typeof import('element-plus/es')['ElProgress']
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']
ElTable: typeof import('element-plus/es')['ElTable']

2
env/.env.sit vendored
View File

@ -3,4 +3,4 @@ VITE_ENV = 'production'
VITE_BUILD_MODE = 'sit'
# 线上环境接口地址
VITE_API_URL = 'https://testSit.com'
VITE_API_URL = 'http://192.168.1.3:10086'

View File

@ -1,14 +1,14 @@
{
"name": "vue3pctemplate",
"name": "zrpt_front",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite --mode dev",
"serve1": "vite --mode serve1",
"build": "npm run build:pro",
"build:sit": "vue-tsc && vite build --mode sit",
"build:uat": "vue-tsc && vite build --mode uat",
"build:pro": "vue-tsc && vite build --mode production",
"build:sit": "vite build --mode sit",
"build:uat": "vite build --mode uat",
"build:pro": "vite build --mode production",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"

View File

@ -5,7 +5,7 @@
:action="props.actionUrl"
:auto-upload="props.autoUpload"
style="width: 100%"
:on-success="(response, file) => successUpload(response, file)"
:on-success="(response:any, file:any) => successUpload(response, file)"
:on-error="errorUpload"
:accept="props.acceptTypeList.join(',')"
:before-upload="beforeUpload"
@ -15,9 +15,9 @@
:file-list="props.fileList"
:disabled="props.disabledFlag"
:on-change="changeFileFn"
:on-remove="(file, fileList) => removeFile(file, fileList)"
:on-preview="(file) => preview(file)"
:on-progress="(event, file, fileList) => onProgressFn(event, file, fileList)"
:on-remove="(file:any, fileList:any) => removeFile(file, fileList)"
:on-preview="(file:any) => preview(file)"
:on-progress="(event:any, file:any, fileList:any) => onProgressFn(event, file, fileList)"
:list-type="props.listType">
<!-- 上传的按钮 或者 icon 通过具名插槽的方式 -->
<slot name="default"></slot>
@ -164,7 +164,7 @@
message: '上传失败请重试!'
})
}
const beforeUpload = (file) => {
const beforeUpload = (file:any) => {
const { name = '', size } = file
if (size > props.maxSize * 1024 * 1000) {
ElMessage({
@ -182,7 +182,7 @@
return false
}
}
const handleExceed = (files, fileList) => {
const handleExceed = (files:any, fileList:any) => {
ElMessage({
type: 'warning',
message: `当前限制选择 10 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
@ -191,12 +191,12 @@
})
}
//
const removeFile = (file, data) => {
const removeFile = (file:any, data:any) => {
console.log(file, data)
props.fileList = data
// props.fileList = data
}
//
const preview = (data) => {
const preview = (data:any) => {
const { url, response = {} } = data || {}
let name = data.name
const downLoadTypeList = props.downLoadTypeList
@ -229,7 +229,7 @@
}
}
const onProgressFn = (event, file, fileList) => {
const onProgressFn = (event:any, file:any, fileList:any) => {
processFlag.value = true
loadProcess.value = event.percent.toFixed(2)
if (loadProcess.value >= 100) {

View File

@ -33,7 +33,7 @@ export const ElMessageBoxOpert = (title = '', text = "", onfirmText = "", cancel
inputErrorMessage: inputErrorMessage,
confirmButtonClass:confirmButtonClass
})
.then(({ value }) => {
.then(( value ) => {
callBack(row,value)
})
.catch(() => {

View File

@ -4,8 +4,32 @@
"updateBy": null,
"updateTime": null,
"remark": null,
"id": 1,
"orderId": 1,
"code": "订单编号202311001",
"time": "2023-12-1",
"endTime": null,
"deposit": null,
"cost": null,
"payType": null,
"supplier": null,
"orderStatus": "36",
"orderUser": null,
"orderCompany": null,
"typeName": "装备类别:\ ",
"groupName": "
",
"deviceName": "220E星牌挖掘机",
"deviceCode": ,
"devicePicUrl": "https://imgproduct.cehome.com/g2/o/00/39/a57044cc230ac7c9.JPG",
"deviceBrand": "品牌 ",
"deviceSpecification": "
",
"deviceLocation": "
",
"deviceMonthLeasePrice": "2000 /",
"maId": 1,
"orderPhone": null,
"supplierCompany": null,
"needCompany": "夏普公司",
"planStartTime": "2023.12.2",
"isMachinist": "1",
@ -14,23 +38,17 @@
"duration": "工期时长20天",
"invoiceType": "发票类型",
"description": "项目说明",
"maId": 1,
"leaseType": 1,
"leasePrice": "20000",
"machinistPrice": "3600",
"orderContract": "https://hzgyp-prod-1259451974.cos.ap-guangzhou.myqcloud.com/enterprise/serviceAgreement.pdf",
"machinistName": "机手姓名",
"phone": "联系电话13899995555",
"logisticsPhone": "物流司机电话13899995555",
"orderContract": "",
"machinistName": "213123",
"phone": "321321",
"logisticsPhone": "21321",
"realStartTime": "设备实际进场时间",
"renterName": null,
"tenantName": null,
"entryAttachment": null,
"typeName": null,
"groupName": null,
"deviceName": null,
"code": "订单编号202311001",
"orderTime": "2023-12-1",
"orderStatus": "订单状态",
"contractUrl": null
"contractUrl": null,
"pid": null
}

View File

@ -18,7 +18,7 @@
}}</el-form-item>
<el-form-item label="租赁时长" class="table_item">
<!-- {{ detailsInfo.}} -->
{{ detailsInfo.duration}}
<!-- 暂无 --></el-form-item>
<el-form-item label="设备进场地址:" class="table_item">{{
detailsInfo.addressId
@ -26,9 +26,9 @@
<el-form-item label="进场时间:" class="table_item">{{
detailsInfo.realStartTime
}}</el-form-item>
<el-form-item label="是否需求机手:" class="table_item">{{
detailsInfo.isMachinist
}}</el-form-item>
<el-form-item label="是否需求机手:" class="table_item">
{{ detailsInfo.isMachinist == 0 ? '否' : '是' }}
</el-form-item>
<el-form-item label="详细地址:" class="table_item">{{
detailsInfo.address
}}</el-form-item>
@ -45,26 +45,49 @@
xxxx-xx-xx ~ xxxx-xx-xx
</el-form-item> -->
<!-- 表格 -->
<orderTable :tableInfo="tableInfo" style="width: 760px">
<!-- <template v-slot:rentMoney>
<h1>6666</h1>
</template> -->
<orderTable :tableInfo="tableInfo">
<template v-slot:rentMoney>
<div style="margin-left: 80px">
<!-- <div>
<div>
<span>装备</span>
<span style="color: #f00">¥{{ tableInfo.money }}</span>
/{{ tableInfo.unit }}
<span>
装备
</span>
<span style="color: #f00">¥
{{ tableInfo.devicePrice }}
</span> /
</div>
<div>
<span></span>
<span style="color: #f00">¥{{ tableInfo.money }}</span>
/{{ tableInfo.unit }}
<div v-if="detailsInfo.isMachinist != 0">
<span>
机手
</span>
<span style="color: #f00">¥
{{ tableInfo.machinistPrice }}
</span> /
</div>
</div> -->
<div>
<div class="equipMoneyClass">
<span>
装备
</span>
<span style="color: #f00">¥
</span>
<el-input v-model.trim="equipMoneyInfo.equipMoney" placeholder="请输入企业类型" clearable maxlength="30" />
/
</div>
<div v-if="detailsInfo.isMachinist != 0" class="equipMoneyClass">
<span>
机手
</span>
<span style="color: #f00">¥
</span>
<el-input v-model.trim="equipMoneyInfo.phoneMoney" placeholder="请输入企业类型" clearable
maxlength="30" />/
</div>
</div>
</template>
</orderTable>
<div class="total_money">合计234234</div>
<div class="total_money">合计{{ totalMoneyFn() }}</div>
<!-- <el-form-item label="订单合同:" style="width: 800px;margin-top:12px;">
xxxxxxxxxxxx.pdf
</el-form-item>
@ -79,13 +102,14 @@
</el-form-item> -->
<el-form-item label="订单合同:" style="width: 800px" v-if="stepVal == '1'">
<div>
<uploadComponent :maxLimit="1" listType="text" :acceptTypeList="['.pdf']" :scuccesCallback="scuccesCallback" height="32px" width="360px">
<uploadComponent :maxLimit="1" listType="text" :acceptTypeList="['.pdf']" :scuccesCallback="scuccesCallback"
height="32px" width="360px">
<template v-slot:default>
<el-button type="primary">上传文件</el-button>
</template>
</uploadComponent>
<div class="error_tip_c" v-show="errorTipFlag==2">请上传文件</div>
<div class="error_tip_c" v-show="errorTipFlag == 2">请上传文件</div>
</div>
</el-form-item>
<div v-else-if="stepVal == '2'">
@ -141,7 +165,7 @@
<script setup lang="ts">
import orderTable from './orderTable.vue'
import { reactive } from 'vue'
import timeLineHorizontal from './timeLineHorizontal.vue'
import uploadComponent from 'components/uploadComponent/index.vue'
import { ElMessageBoxOpert } from 'utils/elementCom'
@ -151,20 +175,25 @@ const router = useRouter()
const route = useRoute()
const ruleFormRef = ref()
const tableInfo = reactive({
v_equipment_title: '220E履带挖掘机',
v_equipment_code: '88888',
v_equipment_group_type: '挖掘机械',
v_equipment_brand: '挖掘机',
v_equipment_weight: '22吨',
v_equipment_volume: '1立方米',
v_equipment_address: '广东省广州市',
money: '2000',
unit: '月',
v_equipment_title: '',
v_equipment_code: '',
typeName: '',
v_equipment_group_type: '',
v_equipment_brand: '',
v_equipment_size: '',
v_equipment_volume: '',
v_equipment_address: '',
devicePrice: '',
machinistPrice: '',
imgUrl: ''
})
const errorTipFlag= ref(0)
const errorTipFlag = ref(0)
const equipMoneyInfo = reactive({
equipMoney: '',
phoneMoney: ''
})
const stepVal = ref('0')
@ -188,18 +217,18 @@ const timeLineList = reactive({
]
})
const driverInfo = reactive({
list: [
{
value: 'Option1',
label: 'Option1'
},
{
value: 'Option2',
label: 'Option2'
}
]
})
// const driverInfo = reactive({
// list: [
// {
// value: 'Option1',
// label: 'Option1'
// },
// {
// value: 'Option2',
// label: 'Option2'
// }
// ]
// })
const submitInfo = reactive({
driver: '',
driverPhone: '',
@ -219,19 +248,39 @@ const formConfirmRules = reactive<FormRules<any>>({
})
let fileItem:any=null
let fileItem: any = null
const demandConfirmFn = () => {
if(!equipMoneyInfo.equipMoney){
return ElMessage({
type:'warning',
message:'请输入装备租金'
})
}
if(!equipMoneyInfo.phoneMoney){
return ElMessage({
type:'warning',
message:'请输入机手租金'
})
}
stepVal.value = '1'
timeLineList.list[1].done = true
}
const rejectCallBack = async (row: any, value: any) => {
console.log('editCallBack', row, value)
let params = {
rejectReason:value.value,
orderId: detailsInfo.orderId
}
const res = await apiOrderReject(params)
if(res.code == 200){
ElMessage({
type:'success',
message:'驳回成功'
})
}
}
const demandRejectFn = (row: any) => {
const demandRejectFn = (row="") => {
ElMessageBoxOpert(
'驳回原因',
'填写驳回原因',
@ -251,11 +300,11 @@ const demandRejectFn = (row: any) => {
}
const nextFn = () => {
if(!fileItem){
errorTipFlag.value=2
}else{
if (!fileItem) {
errorTipFlag.value = 2
} else {
stepVal.value = '2'
}
@ -263,24 +312,38 @@ const nextFn = () => {
}
const detailsInfo: any = reactive({})
const initApiOrderDetails = async () => {
let id = route.query.id||'1'
let id = route.query.id || '1'
const res: any = await apiOrderInfoDetails(id)
// const res:any = dataJson
console.log('res-apiOrderDetails', res)
Object.assign(detailsInfo, res.data)
const deviceInfo = res.data
tableInfo.v_equipment_title = deviceInfo.deviceName
tableInfo.v_equipment_code = deviceInfo.deviceCode
tableInfo.typeName = deviceInfo.typeName
tableInfo.v_equipment_group_type = deviceInfo.groupName
tableInfo.v_equipment_brand = deviceInfo.deviceBrand
tableInfo.v_equipment_size = deviceInfo.deviceSpecification
tableInfo.v_equipment_address = deviceInfo.deviceLocation
tableInfo.devicePrice = deviceInfo.deviceMonthLeasePrice
tableInfo.machinistPrice = deviceInfo.machinistPrice
tableInfo.imgUrl = deviceInfo.devicePicUrl
}
const confirmSendFn = () => {
const confirmSendFn = () => {
if (!ruleFormRef) return
ruleFormRef.value.validate(async(valid: any) => {
ruleFormRef.value.validate(async (valid: any) => {
if (valid) {
let params = {
orderId: detailsInfo.orderId,
contractUrl: 'https://hzgyp-prod-1259451974.cos.ap-guangzhou.myqcloud.com/enterprise/serviceAgreement.pdf',//
machinistName: submitInfo.driver,//
logisticsPhone: submitInfo.deliverPhone,//
phone: submitInfo.driverPhone//
phone: submitInfo.driverPhone,//
leasePrice:equipMoneyInfo.equipMoney,
machinistPrice:equipMoneyInfo.phoneMoney
}
const res = await apiUpdateOrderInfo(params)
console.log("resapiUpdateOrderInfo", res)
@ -303,10 +366,16 @@ const backFn = () => {
router.go(-1)
}
const scuccesCallback =(ev:any)=>{
console.log("list0000",ev)
fileItem=ev
errorTipFlag.value=1
const scuccesCallback = (ev: any) => {
console.log("list0000", ev)
fileItem = ev
errorTipFlag.value = 1
}
const totalMoneyFn = () => {
return Number(equipMoneyInfo.equipMoney) + Number(equipMoneyInfo.phoneMoney) + '元'
}
onBeforeMount(() => {
initApiOrderDetails()
@ -350,15 +419,26 @@ onBeforeMount(() => {
display: flex;
justify-content: flex-start;
}
.error_tip_c{
.error_tip_c {
color: #ff0000;
}
:deep(.equipMoneyClass){
display: flex;
justify-content: flex-start;
margin-top: 6px;
.el-input{
display: inline-block;
width: 160px;
padding: 0 12px;
}
}
</style>
<style>
.dangerC{
background-color: #F56C6C!important;
border: #F56C6C ;
.dangerC {
background-color: #F56C6C !important;
border: #F56C6C;
}
</style>

View File

@ -14,7 +14,7 @@
{{ detailsInfo.phone }}
</el-form-item>
<el-form-item label="租赁时长" class="table_item">
<!-- {{ detailsInfo.}} -->
{{ detailsInfo.duration}}
<!-- 暂无 -->
</el-form-item>
<el-form-item label="设备进场地址:" class="table_item">
@ -24,7 +24,7 @@
{{ detailsInfo.realStartTime }}
</el-form-item>
<el-form-item label="是否需求机手:" class="table_item">
{{ detailsInfo.isMachinist }}
{{ detailsInfo.isMachinist == 0 ? '否' : '是' }}
<!-- 枚举值 待确认-->
</el-form-item>
<el-form-item label="详细地址:" class="table_item">
@ -47,8 +47,20 @@
<orderTable :tableInfo="tableInfo">
<template v-slot:rentMoney>
<div>
<span style="color: #f00">{{ tableInfo.money }}</span>
/{{ tableInfo.unit }}
<span>
装备
</span>
<span style="color: #f00">¥
{{ tableInfo.devicePrice }}
</span> /
</div>
<div v-if="detailsInfo.isMachinist != 0">
<span>
机手
</span>
<span style="color: #f00">¥
{{ tableInfo.machinistPrice }}
</span> /
</div>
</template>
</orderTable>
@ -93,15 +105,16 @@ import { ElMessage } from 'element-plus'
const router = useRouter()
const route = useRoute()
const tableInfo = reactive({
v_equipment_title: '220E履带挖掘机',
v_equipment_code: '88888',
v_equipment_group_type: '挖掘机械',
v_equipment_brand: '挖掘机',
v_equipment_weight: '22吨',
v_equipment_volume: '1立方米',
v_equipment_address: '广东省广州市',
money: '2000',
unit: '月',
v_equipment_title: '',
v_equipment_code: '',
typeName: '',
v_equipment_group_type: '',
v_equipment_brand: '',
v_equipment_size: '',
v_equipment_volume: '',
v_equipment_address: '',
devicePrice: '',
machinistPrice: '',
imgUrl: ''
})
const stepListOrder: any = reactive({
@ -116,6 +129,18 @@ const initApiOrderDetails = async () => {
// const res:any = dataJson
console.log('res-apiOrderDetails', res)
Object.assign(detailsInfo, res.data)
const deviceInfo = res.data
tableInfo.v_equipment_title = deviceInfo.deviceName
tableInfo.v_equipment_code = deviceInfo.deviceCode
tableInfo.typeName = deviceInfo.typeName
tableInfo.v_equipment_group_type = deviceInfo.groupName
tableInfo.v_equipment_brand = deviceInfo.deviceBrand
tableInfo.v_equipment_size = deviceInfo.deviceSpecification
tableInfo.v_equipment_address = deviceInfo.deviceLocation
tableInfo.devicePrice = deviceInfo.deviceMonthLeasePrice
tableInfo.machinistPrice = deviceInfo.machinistPrice
tableInfo.imgUrl = deviceInfo.devicePicUrl
}
const initApiOrderInfoList = async () => {

View File

@ -45,13 +45,13 @@
{{ props.tableInfo.v_equipment_brand }}
</div>
</div>
<div class="item item_sub_out">
<div class="item">
<div class="label">
设备规格
</div>
<div class="value">
<div class="sub_item">
{{ props.tableInfo.v_equipment_size }}
<!-- <div class="sub_item">
<div class="sub_label">
操作重量
</div>
@ -66,7 +66,7 @@
<div class="sub_value">
{{ props.tableInfo.v_equipment_volume }}
</div>
</div>
</div> -->
</div>
</div>
<div class="item">