From 24fd3e45b613f483ac61f81e222f7af746777c3d Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Tue, 26 Nov 2024 18:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/equipCardNew/index.vue | 36 + src/http/api/order/index.ts | 6 + src/http/api/usercenter/goodsmang.ts | 46 +- src/router/index.ts | 11 + src/views/equip/detail.vue | 13 +- src/views/home/index.vue | 1 + src/views/order/index.vue | 406 ++++++++++++ src/views/user/goodsManagement/index.vue | 810 +++++++++++------------ 8 files changed, 898 insertions(+), 431 deletions(-) create mode 100644 src/http/api/order/index.ts create mode 100644 src/views/order/index.vue diff --git a/src/components/equipCardNew/index.vue b/src/components/equipCardNew/index.vue index 90425be..9d49619 100644 --- a/src/components/equipCardNew/index.vue +++ b/src/components/equipCardNew/index.vue @@ -27,6 +27,11 @@ diff --git a/src/views/user/goodsManagement/index.vue b/src/views/user/goodsManagement/index.vue index 1388b27..7b847b7 100644 --- a/src/views/user/goodsManagement/index.vue +++ b/src/views/user/goodsManagement/index.vue @@ -4,20 +4,13 @@ import PagingComponent from 'components/PagingComponent/index.vue' import uploadComponent from 'components/uploadComponent/index.vue' import previewImg from './previewImg/index.vue' - import { ElMessage } from 'element-plus' - - import { ref } from 'vue' - + import { ElMessage } from 'element-plus' + import { ref } from 'vue' import { useStore } from 'store/user' - const store = useStore() - - import { mainStore } from 'store/main' - + const store = useStore() + import { mainStore } from 'store/main' import { - equipmentDeploymentApi, - getEquipmentListApi, - deleteGoodstApi, - equipmentEditApi + getEquipmentListApi,getEquipmentTypeApi,getCompanyListApi } from 'http/api/usercenter/goodsmang' // 注册地址拼装 @@ -25,159 +18,165 @@ const deviceType: any = reactive([]) onMounted(() => { + // 获取装备树 + getTypeTreeData() + // 获取下拉 + getCompanyList() // 获取省级数据 - store.getprovinceList() + // store.getprovinceList() // 获取设备类型 - store.getDeviceTypeList() + // store.getDeviceTypeList() }) - + // 设备类型树 + const deviceTypeTree: any = ref([]) + const partTypeTreeProps: any = ref({ + children: "children", + label: "name", + multiple: false, + value: "id" + }) + // 获取装备树 + const getTypeTreeData = async () => { + const res: any = await getEquipmentTypeApi(); + console.log("treeData==========", res); + deviceTypeTree.value = res.data; + } + const deviceTypeChange = (val: any) => { + console.log(val) + if(val.length > 0) { + queryParams.value.typeId = val[3] + } else { + queryParams.value.typeId = "" + } + } + /* 查询参数 */ + const deviceTypeList: any = ref([]) + const dateRange: any = ref([]) /* 查询参数 */ const queryParams: any = ref({ - code: '', - maStatus: '', - leaseScope: '', - typeName: '', deviceName: '', + code: '', + maStatus: '', + typeId: '', pageSize: 10, pageNum: 1 }) + const total: any = ref(0) + const tableData: any = ref([]) - // 省级数据源 - const selProvinceList: any = computed(() => { - return store.provinceList - }) + // // 省级数据源 + // const selProvinceList: any = computed(() => { + // return store.provinceList + // }) - // 获取市级数据源 - const selMarketList: any = computed(() => { - return store.marketList - }) + // // 获取市级数据源 + // const selMarketList: any = computed(() => { + // return store.marketList + // }) - // 获取区级数据源 - const selAreaList: any = computed(() => { - return store.areaList - }) + // // 获取区级数据源 + // const selAreaList: any = computed(() => { + // return store.areaList + // }) - // 设备类型大类 - const selDeviceTypeList: any = computed(() => { - return store.deviceTypeList - }) + // // 设备类型大类 + // const selDeviceTypeList: any = computed(() => { + // return store.deviceTypeList + // }) - // 设备类型子类 - const selDeviceTypeSonList: any = computed(() => { - return store.deviceTypeSonList - }) + // // 设备类型子类 + // const selDeviceTypeSonList: any = computed(() => { + // return store.deviceTypeSonList + // }) - // 设备类型小类 - const selDeviceTypeSunList: any = computed(() => { - return store.deviceTypeSunList - }) + // // 设备类型小类 + // const selDeviceTypeSunList: any = computed(() => { + // return store.deviceTypeSunList + // }) + + // // 省级下拉框选中时获取市级 + // const changeProvince = (val: any) => { + // // console.log(val, '省选择**') + // store.getmarketList(val.split(',')[0]) + // // AssemblyRegisterAddress[0] = val.split(',')[1] + // } + // // 市级下拉框选中获取区级数据 + // const changeMarket = (val: any) => { + // store.getareaList(val.split(',')[0]) + // // AssemblyRegisterAddress[1] = val.split(',')[1] + // } + // // 区级下拉框获取区级数据 + // const opeChangeArea = (val: any) => { + // // AssemblyRegisterAddress[2] = val.split(',')[1] + // } + // // 设备类型大类 + // const changeDeviceType = (val: any) => { + // store.getDeviceTypeSonList(val) + // // deviceType[0] = val.split(',')[1] + // } + // // 设备类型子类 + // const changeDeviceTypeSon = (val: any) => { + // store.getDeviceTypeSunList(val) + // // deviceType[1] = val.split(',')[1] + // } + // // 设备类型小类 + // const changeDeviceTypeSun = (val: any) => { + // // deviceType[2] = val.split(',')[1] + // } + + + // 弹窗 /* 查看 */ - const disabledForm = ref(false) - + const disabledForm = ref(false) /* 编辑 */ const isEditDisabled = ref(false) - /* 入驻框的标题 */ const settleinTitle = ref('') - - // 省级下拉框选中时获取市级 - const changeProvince = (val: any) => { - // console.log(val, '省选择**') - store.getmarketList(val.split(',')[0]) - - // AssemblyRegisterAddress[0] = val.split(',')[1] - } - - // 市级下拉框选中获取区级数据 - const changeMarket = (val: any) => { - store.getareaList(val.split(',')[0]) - // AssemblyRegisterAddress[1] = val.split(',')[1] - } - // 区级下拉框获取区级数据 - const opeChangeArea = (val: any) => { - // AssemblyRegisterAddress[2] = val.split(',')[1] - } - - // 设备类型大类 - const changeDeviceType = (val: any) => { - store.getDeviceTypeSonList(val) - // deviceType[0] = val.split(',')[1] - } - // 设备类型子类 - const changeDeviceTypeSon = (val: any) => { - store.getDeviceTypeSunList(val) - // deviceType[1] = val.split(',')[1] - } - // 设备类型小类 - const changeDeviceTypeSun = (val: any) => { - // deviceType[2] = val.split(',')[1] - } - + //所属公司 + const companyDataList: any = ref([]) /* * 商品入驻弹框参数 */ const equipmentDeploymentParams: any = ref({ - /* 企业Id */ - ownCo: mainStore().userInfo.companyId, - /* 租赁范围 */ - leaseScope: '', - /* 设备所在地 */ - location: '', - /* 省 */ - provinceId: '', - /* 市 */ - cityId: '', - /* 区 */ - areaId: '', - /* 设备所在地 省 */ - addressEconomize: '', - /* 设备所在地 市 */ - addressProvince: '', - /* 设备所在地 区 */ - addressArea: '', - /* 设备类型 */ + /* 设备名称 */ + deviceName: '', + deviceTypeList: [], + deviceCount: 1, + unitName: '', + code: '', + brand: '', typeId: '', - /* 设备类型大类 */ - deviceType: '', - /* 设备类型子类 */ - deviceTypeSon: '', - /* 设备类型小类*/ - deviceTypeSun: '', - /* 设备品牌 */ - brand: '', - /* 设备型号 */ - modelName: '', - /* 出场日期 */ + companyId: '', productionDate: '', - /* 工作小时数 */ - workingHours: '', - /* 整机序列号 */ - serialNumber: '', - /* 月租金 */ - monthLeasePrice: '', - /* 日租金 */ dayLeasePrice: '', - /* 是否提供机手 */ - isOperator: '', - /* 机手月费用 */ - jsMonthPrice: '', - /* 机手日费用 */ - jsDayPrice: '', - /* 详细说明 */ - description: '', - /* 设备主图片 */ - picUrl: '', - /* 检测信息 ,保险信息*/ - fileList: [], - /* 设备状态 */ - maStatus: 15 + person: '', + personPhone: '', + deviceWeight: '', }) - - const total: any = ref(0) - - const tableData: any = ref([]) - + //编码类型禁止修改数目 + const countDisabled = ref(false) + const dialogTypeCascader = ref() + //装备类目-change + const dialogTypeChange = () => { + const deviceTypeList = dialogTypeCascader.value.getCheckedNodes() + console.log(deviceTypeList) + equipmentDeploymentParams.value.unitName = deviceTypeList[0].data.unitName + let manageType = deviceTypeList[0].data.manageType + if(manageType=='1'){//数量 + equipmentDeploymentParams.value.deviceCount=1 + countDisabled.value=false + }else if(manageType=='0'){//编码 + equipmentDeploymentParams.value.deviceCount=1 + countDisabled.value=true + } + } + //获取下拉数据 + const getCompanyList = async () => { + const res: any = await getCompanyListApi() + console.log(res, '列表数据**--**') + companyDataList.value = res.data + } // 获取数据列表 const getList = async () => { console.log(queryParams.value.pageNum, '***9999', queryParams.value.pageSize) @@ -187,8 +186,9 @@ total.value = res.total tableData.value = res.rows.filter((item: any) => item !== null) } - getList() + + // 选择复选框时获取需要删除的数据源 const getRowId = (val: any) => { console.log(val, '需要删除的数据源**') @@ -216,19 +216,19 @@ /* 查看按钮 */ const previewRowInfo = (row: any) => { - settleinTitle.value = '装备入驻详情' + settleinTitle.value = '装备详情' row.devPicList = [] - row.fileList.map((item) => { - if (item.dicId == 28) { - row.jcUrl = item.fileUrl - } - if (item.dicId == 29) { - row.bsUrl = item.fileUrl - } - if (item.dicId == 20) { - row.devPicList.push(item.fileUrl) - } - }) + // row.fileList.map((item) => { + // if (item.dicId == 28) { + // row.jcUrl = item.fileUrl + // } + // if (item.dicId == 29) { + // row.bsUrl = item.fileUrl + // } + // if (item.dicId == 20) { + // row.devPicList.push(item.fileUrl) + // } + // }) getRowList(row) disabledForm.value = true @@ -366,15 +366,7 @@ } }) } - - // 表单 lable 数据 - const formItemList: any = ref([ - { v_label: '编码', v_typ: 'ipt' }, - { v_label: '状态', v_typ: 'ipt' }, - { v_label: '租赁范围', v_typ: 'sel' }, - { v_label: '装备类型', v_typ: 'sel' }, - { v_label: '装备名称', v_typ: 'ipt' } - ]) + // 装备入驻弹框显示隐藏 const dialogFormVisibleSettlein: any = ref(false) @@ -570,78 +562,72 @@ - + + + + - + - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + 查询 重置 - 装备入驻 + 装备新增 - - - - + + - - + + - + + + @@ -674,174 +660,136 @@ :total="total" /> - - - - - - - - + +
+ + 基本信息 +
+ + + + - - - - + + + + + + + + + + - - - - - - - - - + + - + + + + + placeholder="请选择所属公司" + clearable style="width: 350px"> - - - - - - - - - - + v-for="item in companyDataList" + :key="item.companyId" + :label="item.companyName" + :value="item.companyId" + /> + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - 小时 - - - - - - - 元/月 - - - - 元/天 - - + + + + + - - + + --> +
-