Commit 1b80516b authored by 刘杰's avatar 刘杰

企业微信前端

parent 10e13acc
...@@ -9,6 +9,24 @@ import { ...@@ -9,6 +9,24 @@ import {
} from "../publicConfig/config"; } from "../publicConfig/config";
export function createNewOrderRelease(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.createNewOrderRelease`, data)
}
export function getOptionEnumMd(type) {
return Request(`/api/query/choice.${type}/action/auto_choice`)
}
export function getOptionEnumThing(data) {
return Request(`/api/query/biz.md.Product.md_product_d001_auto/auto`,data)
}
export function queryCustomerAll(data) {
return Request(`/api/query/biz.md.Customer.md_customer_enable_search1/paging`, data)
}
export function queryDailyReport(data) {
return Request(`/api/query/biz.zcgyl.DailyReport.zcgyl_dailyreport_boss_search/paging`, data)
}
export function searchBossCard(data) { export function searchBossCard(data) {
return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchBossCard`, data) return Request(`/api/entry/{mini}/m-action/biz.tm.OrderRelease.service.searchBossCard`, data)
...@@ -33,6 +51,9 @@ export function BindCompany(data) { ...@@ -33,6 +51,9 @@ export function BindCompany(data) {
export function selectDailyReport(data) { export function selectDailyReport(data) {
return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.selectDailyReport`, data) return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.selectDailyReport`, data)
} }
export function queryByStaffCode(data) {
return Request(`/api/entry/{mini}/m-action/biz.zcgyl.DailyReport.service.queryByStaffCode`, data)
}
export function selectDailyReportList(data) { export function selectDailyReportList(data) {
return Request(`/api/query/biz.zcgyl.DailyReport.zcgyl_dailyreport_search/paging`, data) return Request(`/api/query/biz.zcgyl.DailyReport.zcgyl_dailyreport_search/paging`, data)
} }
...@@ -413,14 +434,14 @@ export function GetBindCompanyInfo(data) { ...@@ -413,14 +434,14 @@ export function GetBindCompanyInfo(data) {
export function queryOriginalAddress(data) { export function queryOriginalAddress(data) {
return Request( return Request(
`/api/entry/{mini}/m-action/biz.md.Address.md_address_m_search.paging`, `/api/entry/{mini}/m-action/biz.md.Address.md_address_admin_search.paging`,
data data
); );
} }
export function queryDestinationAddress(data) { export function queryDestinationAddress(data) {
return Request( return Request(
`/api/entry/{mini}/m-action/biz.md.Address.md_address_search.paging`, `/api/entry/{mini}/m-action/biz.md.Address.md_address_admin_search.paging`,
data data
); );
} }
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<view class="uploade-file"> <view class="uploade-file">
<view class="uploade-title" v-if="uploadTitle"> <view class="uploade-title" v-if="uploadTitle">
<text style="color: #f56c6c;position: absolute;left: 18rpx;" v-if="required">*</text> <text style="color: #f56c6c;position: absolute;left: 18rpx;" v-if="required">*</text>
<text>{{uploadTitle}}{{fileList.length}}/6)</text> <!-- <text>{{uploadTitle}}{{fileList.length}}/6)</text> -->
<text class="label"><text class="label-line"></text>{{uploadTitle}}{{fileList.length}}/6)</text>
</view> </view>
<view class="fileList flex flex_wrap"> <view class="fileList flex flex_wrap">
<view class="previewImages" v-for="(item,index) in fileDetailList" :key="index"> <view class="previewImages" v-for="(item,index) in fileDetailList" :key="index">
...@@ -107,6 +108,23 @@ ...@@ -107,6 +108,23 @@
font-size: 28rpx; font-size: 28rpx;
color: #8C8C8C; color: #8C8C8C;
margin-bottom: 24rpx; margin-bottom: 24rpx;
.label {
display: flex;
align-items: center;
font-size: 14px;
color: #333;
margin-bottom: 8px;
.label-line {
display: inline-block;
width: 3px;
height: 14px;
background-color: #2E75E6;
margin-right: 8px;
border-radius: 2px;
}
}
} }
.fileList { .fileList {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<u-checkbox name="userAuth" shape="circle" size="44" iconSize='44' @change="onChange" /> <u-checkbox name="userAuth" shape="circle" size="44" iconSize='44' @change="onChange" />
</u-checkbox-group> </u-checkbox-group>
<text>请您详细阅读并授权</text> <text>请您详细阅读并授权</text>
<text class="special-text" @click="onVisible(true)">运匠用户协议</text> <text class="special-text" @click="onVisible(true)">兆驰用户协议</text>
<text></text> <text></text>
<text class="special-text" @click="onVisible(true)">隐私政策</text> <text class="special-text" @click="onVisible(true)">隐私政策</text>
......
...@@ -64,16 +64,16 @@ ...@@ -64,16 +64,16 @@
<!-- 右侧数据统计 --> <!-- 右侧数据统计 -->
<view class="statistics"> <view class="statistics">
<view class="stat-row" v-if="staffKind==='simulatedBoss'"> <view class="stat-row" v-if="staffKind==='simulatedBoss'||staffKind==='Leader'">
<view class="stat-item"> <view class="stat-item">
<view class="stat-block green "> <view class="stat-block green ">
<text class="number">{{currentSearchData.overview.stats.shippingCount}}</text> <text class="number">{{currentSearchData.overview.stats.shippingCount||0}}</text>
<text class="rate">运输中</text> <text class="rate">运输中</text>
</view> </view>
</view> </view>
<view class="stat-item"> <view class="stat-item">
<view class="stat-block green "> <view class="stat-block green ">
<text class="number">{{currentSearchData.overview.stats.positionCount}}</text> <text class="number">{{currentSearchData.overview.stats.positionCount||0}}</text>
<text class="rate">开启定位</text> <text class="rate">开启定位</text>
</view> </view>
</view> </view>
...@@ -163,10 +163,6 @@ ...@@ -163,10 +163,6 @@
<!-- 应付模块 --> <!-- 应付模块 -->
<view class="finance-block"> <view class="finance-block">
<view class="finance-item payable"> <view class="finance-item payable">
<!-- 左侧图标 -->
<!-- <view class="left-section">
<view class="icon"></view>
</view> -->
<view class="left-section"> <view class="left-section">
<view class="icon"> <view class="icon">
<img src="../../static/img/boss/zhichu.png" alt="图标" /> <img src="../../static/img/boss/zhichu.png" alt="图标" />
...@@ -217,7 +213,7 @@ ...@@ -217,7 +213,7 @@
</view> </view>
<!-- 模拟老板对比图表区域 --> <!-- 模拟老板对比图表区域 -->
<view class="chart-container" v-if="staffKind==='boss'"> <view class="chart-container" v-if="isBoss">
<view class="chart-header"> <view class="chart-header">
<text class="chart-title">模拟老板对比</text> <text class="chart-title">模拟老板对比</text>
<view class="sort-buttons"> <view class="sort-buttons">
...@@ -293,10 +289,11 @@ ...@@ -293,10 +289,11 @@
</view> </view>
<view class="table-body"> <view class="table-body">
<view class="table-row" v-for="(item, index) in currentData.tableData" :key="index"> <view class="table-row" v-for="(item, index) in currentData.tableData" :key="index">
<view v-if="staffKind==='boss'" class="table-cell fixed-column" @click="clickSimulatedBoss(item.boss)"> <view v-if="isBoss" class="table-cell fixed-column"
@click="clickSimulatedBoss(item.boss)">
<a :class="{'active': isActive(item.boss)}">{{ item.boss }}</a> <a :class="{'active': isActive(item.boss)}">{{ item.boss }}</a>
</view> </view>
<view v-if="staffKind!=='boss'" class="table-cell fixed-column"> <view v-if="!isBoss" class="table-cell fixed-column">
{{ item.boss }} {{ item.boss }}
</view> </view>
<view class="table-cell">{{ item.receivable }}</view> <view class="table-cell">{{ item.receivable }}</view>
...@@ -314,7 +311,7 @@ ...@@ -314,7 +311,7 @@
</view> </view>
<!-- 模拟老板项目运营表格 --> <!-- 模拟老板项目运营表格 -->
<view class="table-container" v-if="staffKind==='boss' && activeBoss !=='' "> <view class="table-container" v-if="isBoss && activeBoss !=='' ">
<text class="table-title">模拟老板项目运营情况</text> <text class="table-title">模拟老板项目运营情况</text>
<scroll-view scroll-x class="table-scroll" @touchmove.stop> <scroll-view scroll-x class="table-scroll" @touchmove.stop>
<view class="table"> <view class="table">
...@@ -393,7 +390,8 @@ ...@@ -393,7 +390,8 @@
showOrderEvent: false, showOrderEvent: false,
tableName: "", tableName: "",
bossProject: [], bossProject: [],
activeBoss: '' activeBoss: '',
isBoss: false
} }
}, },
computed: { computed: {
...@@ -426,14 +424,19 @@ ...@@ -426,14 +424,19 @@
} }
}, },
async mounted() { async mounted() {
await this.initData()
this.staffKind = uni.getStorageSync(`uc_staff_kind`); this.staffKind = uni.getStorageSync(`uc_staff_kind`);
if (this.staffKind === 'boss') { if (this.staffKind === 'President' || this.staffKind === 'VicePresident' ||
this.initLeaderChart() this.staffKind === 'PresidentHelp' || this.staffKind === 'Leader') {
this.tableName = '模拟老板' this.tableName = '模拟老板'
this.isBoss = true
} else { } else {
this.tableName = '项目' this.tableName = '项目'
} }
await this.initData()
if (this.isBoss) {
this.initLeaderChart()
}
this.initProjectChart() this.initProjectChart()
// 在 Vue 的下一个 DOM 更新循环中执行 // 在 Vue 的下一个 DOM 更新循环中执行
...@@ -444,7 +447,7 @@ ...@@ -444,7 +447,7 @@
this.loading = false this.loading = false
} }
// 对领导图表进行排序,按应收数据排序 // 对领导图表进行排序,按应收数据排序
if (this.staffKind === 'boss') { if (this.isBoss) {
this.sortChart('receivable', 'myLeaderChart') this.sortChart('receivable', 'myLeaderChart')
} }
// 对项目图表进行排序,按应收数据排序 // 对项目图表进行排序,按应收数据排序
...@@ -466,7 +469,7 @@ ...@@ -466,7 +469,7 @@
console.log("name" + name); console.log("name" + name);
this.activeBoss = name; this.activeBoss = name;
this.staffKind = uni.getStorageSync('uc_staff_kind'); this.staffKind = uni.getStorageSync('uc_staff_kind');
if (this.staffKind === 'boss') { if (this.isBoss) {
this.bossProject = [] this.bossProject = []
const data = { const data = {
"aux": { "aux": {
...@@ -836,7 +839,7 @@ ...@@ -836,7 +839,7 @@
// 更新图表数据 // 更新图表数据
this.updateChartSeries() this.updateChartSeries()
if (this.staffKind === 'boss') { if (this.isBoss) {
this.sortChart('receivable', 'myLeaderChart') this.sortChart('receivable', 'myLeaderChart')
} }
// 对项目图表进行排序,按应收数据排序 // 对项目图表进行排序,按应收数据排序
...@@ -986,7 +989,7 @@ ...@@ -986,7 +989,7 @@
} }
}, },
updateChartSeries() { updateChartSeries() {
if (this.staffKind === 'boss') { if (this.isBoss) {
this.myLeaderChart.setOption({ this.myLeaderChart.setOption({
series: [{ series: [{
data: this.currentData.leaderChartData.receivable data: this.currentData.leaderChartData.receivable
...@@ -1793,7 +1796,7 @@ ...@@ -1793,7 +1796,7 @@
} }
.chart-wrapper { .chart-wrapper {
height: 220px; height: 250px;
width: 100%; width: 100%;
padding: 0 0 5px 0; padding: 0 0 5px 0;
min-width: 100%; min-width: 100%;
......
...@@ -5,19 +5,18 @@ ...@@ -5,19 +5,18 @@
<view class="report-card" v-for="(report, index) in dailyReportList" :key="index"> <view class="report-card" v-for="(report, index) in dailyReportList" :key="index">
<view class="card-header"> <view class="card-header">
<view class="left"> <view class="left">
<text class="name">汇报对象:{{ report.reporterTo__name }}</text>
<!-- <text class="status" :class="report.status==='submitted' ? 'submitted' : 'unSubmitted'"> <text v-if="staffKind==='staff'" class="name">汇报对象:{{ report.reporterTo__name }}</text>
{{ report.status==='submitted' ? '已提交' : '未提交' }} <text v-if="staffKind!=='staff'" class="name">汇报对象:老板</text>
</text> -->
</view> </view>
<text class="time">{{ report.date || '-' }}</text> <text class="time">{{ report.date_str || '-' }}</text>
</view> </view>
<view class="card-content"> <view class="card-content">
<view class="work-item"> <view class="work-item">
<view class="work-header"> <view class="work-header">
<text class="work-title">今日重点工作</text> <text class="work-title">是否超时</text>
</view> </view>
<view class="work-content">{{ report.today_work }}</view> <view class="work-content">{{ report.is_over_time }}</view>
</view> </view>
<view class="work-item"> <view class="work-item">
<view class="work-header"> <view class="work-header">
...@@ -25,6 +24,12 @@ ...@@ -25,6 +24,12 @@
</view> </view>
<view class="work-content">{{ report.week_work }}</view> <view class="work-content">{{ report.week_work }}</view>
</view> </view>
<view class="work-item">
<view class="work-header">
<text class="work-title">今日重点工作</text>
</view>
<view class="work-content">{{ report.today_work }}</view>
</view>
<view class="work-item"> <view class="work-item">
<view class="work-header"> <view class="work-header">
<text class="work-title">是否请假</text> <text class="work-title">是否请假</text>
...@@ -147,7 +152,7 @@ ...@@ -147,7 +152,7 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
const data = res.data.data.datas; const data = res.data.data.datas;
data.map(item => { //格式化时间 data.map(item => { //格式化时间
item.date = formatGMT(item.date, 'T') item.insert_date = formatGMT(item.insert_date, 'T')
}) })
...@@ -184,21 +189,20 @@ ...@@ -184,21 +189,20 @@
.add-button { .add-button {
position: fixed; position: fixed;
bottom: 10px; bottom: 20px;
left: 0; left: 0;
right: 0; right: 0;
background-color: #3278e9;
background-color: #2E75E6;
color: white; color: white;
border: none; border: none;
border-radius: 48rpx; border-radius: 24px;
padding: 8px; padding: 8px;
font-size: 16px; font-size: 16px;
font-weight: bolder; font-weight: bolder;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
cursor: pointer; cursor: pointer;
z-index: 1000; z-index: 1000;
width: 90%; width: 40%;
} }
.add-button:hover { .add-button:hover {
......
<template> <template>
<view class="orderInsert"> <view class="orderInsert">
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<u--form :model="formData" :rules="rules" ref="myForm" errorType='none'> <u--form :model="formData" :rules="rules" ref="form" errorType='none'>
<!-- 基本信息 --> <!-- 基本信息 -->
<view class="module-title flex"> <view class="module-title flex">
<text class="font_bolder">基本信息</text> <text class="font_bolder">基本信息</text>
...@@ -10,113 +10,146 @@ ...@@ -10,113 +10,146 @@
<u-form-item prop="customerOrderNo" label="客户单号" labelWidth="25%" borderBottom> <u-form-item prop="customerOrderNo" label="客户单号" labelWidth="25%" borderBottom>
<u-input border="none" placeholder="请输入" v-model="formData.customerOrderNo" /> <u-input border="none" placeholder="请输入" v-model="formData.customerOrderNo" />
</u-form-item> </u-form-item>
<u-form-item prop="project.name" label="项目" labelWidth="25%" borderBottom <u-form-item required label="部门" @click="openDepartmentPopup" labelWidth="25%" borderBottom>
@click="onVisible('project.name')"> <text v-if="formData.uc_department">{{departmentMethodFilter(formData.uc_department)}}</text>
<view> <text v-else class="input-tip">请选择部门</text>
<u-input border="none" placeholder="请选择" :value="formData['project.name']" /> <u-icon slot="right" name="arrow-right" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="project.name" />
</u-form-item> </u-form-item>
<u-form-item prop="transportMode.name" label="运输方式" labelWidth="25%" borderBottom <u-form-item required="formData.uc_department==='D003'" v-if="formData.uc_department==='D003'"
@click="onVisible('transportMode.name')"> label="VIN" labelWidth="25%" borderBottom>
<view> <u-input v-model="formData.vin" border="none" placeholder="请输入VIN"
<u-input border="none" placeholder="请选择" :value="formData['transportMode.name']" /> placeholderStyle="font-size:28rpx;color:#BFBFBF" />
</view>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="transportMode.name" />
</u-form-item> </u-form-item>
<u-form-item prop="transportProduct.name" label="运输产品" labelWidth="25%" <u-form-item required label="客户" labelWidth="25%" @click="openCustomerPopup" borderBottom>
@click="onVisible('transportProduct.name')"> <text v-if="formData.customer">{{formData.customerName}}</text>
<view> <text v-else class="input-tip">请选客户</text>
<u-input border="none" placeholder="请选择" :value="viewEnums[formData.transportProduct]" /> <u-icon slot="right" name="arrow-right" />
</view> </u-form-item>
<u-icon slot="right" name="arrow-right" @click="onVisible" index="transportProduct.name" /> <u-form-item label="接单日期" labelWidth="25%" prop="orderDate" borderBottom @click="showOrderDate = true"
required>
<bs-dateTimePicker2 v-model="formData.orderDate" type="date" placeholder="请选择接单日期">
<u-icon slot="rightIcon" name="arrow-right" />
</bs-dateTimePicker2>
</u-form-item>
<u-form-item prop="transportMode" label="运输方式" labelWidth="25%" @click="openTransportMethodPopup"
borderBottom required>
<text v-if="formData.transportMode">{{transportMethodFilter(formData.transportMode)}}</text>
<text v-else class="input-tip">请选择运输方式</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="urgentGrade" label="紧急程度" labelWidth="25%" @click="openUrgentGradeMethodPopup"
borderBottom required>
<text v-if="formData.urgentGrade">{{urgentGradeMethodFilter(formData.urgentGrade)}}</text>
<text v-else class="input-tip">请选择紧急程度</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="uc_transport_type" label="运输类型" labelWidth="25%"
@click="openTransportTypeMethodPopup" borderBottom required>
<text
v-if="formData.uc_transport_type">{{transportTypeMethodFilter(formData.uc_transport_type)}}</text>
<text v-else class="input-tip">请选择运输类型</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="goodsType" label="货物类型" labelWidth="25%" @click="openGoodsTypeMethodPopup"
borderBottom required>
<text v-if="formData.goodsType">{{goodsTypeMethodFilter(formData.goodsType)}}</text>
<text v-else class="input-tip">请选择货物类型</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item prop="uc_settlementtype" label="结算方式" labelWidth="25%"
@click="openSettlementtypeMethodPopup" borderBottom required>
<text
v-if="formData.uc_settlementtype">{{settlementtypeMethodFilter(formData.uc_settlementtype)}}</text>
<text v-else class="input-tip">请选择结算方式</text>
<u-icon slot="right" name="arrow-right" />
</u-form-item>
<u-form-item label="提货时间" labelWidth="25%" borderBottom>
<bs-dateTimePicker2 v-model="formData.earliestPickUpTime" placeholder="请选择提货时间">
<u-icon slot="rightIcon" name="arrow-right" />
</bs-dateTimePicker2>
</u-form-item>
<u-form-item label="送货时间" labelWidth="25%">
<bs-dateTimePicker2 v-model="formData.latestArrivalTime" placeholder="请选择送货时间">
<u-icon slot="rightIcon" name="arrow-right" />
</bs-dateTimePicker2>
</u-form-item> </u-form-item>
</view> </view>
<!-- 订单任务 --> <!-- 订单任务 -->
<view class="module-title flex"> <view class="module-title flex">
<text class="font_bolder">订单任务</text> <text class="font_bolder">发货地</text>
</view>
<view class="orderTask" v-for="(item, index) in formData.tasks" :key="index"
style="padding-bottom: 12px; margin-bottom:12px">
<view class="order_title">
订单任务明细{{ toChineseNumber(index + 1) }}
</view> </view>
<u-form-item prop="original.name" label="发货地址" labelWidth="25%" borderBottom <view class="orderTask" style="padding-bottom: 12px; margin-bottom:12px">
@click="onVisible(index + '.original.name')"> <u-form-item prop="originalAddress.fullName" label="发货地" labelWidth="25%" borderBottom
@click="onVisible('originalAddress.fullName')">
<view> <view>
<u-input border="none" placeholder="请选择" :value="item['original.name']" /> <u-input border="none" placeholder="请选择发货地" :value="formData['originalAddress.fullName']" />
</view> </view>
<u-icon slot="right" name="arrow-right" @click="onVisible" :index="index + '.original.name'" /> <u-icon slot="right" name="arrow-right" @click="onVisible" index="originalAddress.fullName" />
</u-form-item> </u-form-item>
<u-form-item prop="destination.name" label="收货地址" labelWidth="25%" borderBottom
@click="onVisible(index + '.destination.name')">
<view>
<u-input border="none" placeholder="请选择" :value="item['destination.name']" />
</view> </view>
<u-icon slot="right" name="arrow-right" @click="onVisible" :index="index + '.destination.name'" />
</u-form-item> <view class="module-title flex">
<u-form-item prop="earliestPickUpTime" label="提货时间" labelWidth="25%" borderBottom <text class="font_bolder">目的地</text>
@click="onVisibleDate(index + '.earliestPickUpTime')">
<view>
<u-input border="none" placeholder="请选择"
:value="convertTime(formData.tasks[index].earliestPickUpTime)" />
</view> </view>
<u-icon slot="right" name="arrow-right" @click="onVisibleDate" <view class="orderTask" style="padding-bottom: 12px; margin-bottom:12px">
:index="index + '.earliestPickUpTime'" />
</u-form-item> <u-form-item prop="destinationAddress.fullName" label="目的地" labelWidth="25%" borderBottom
<u-form-item prop="earliestArrivalTime" label="到达时间" labelWidth="25%" @click="onVisible('destinationAddress.fullName')">
@click="onVisibleDate(index + '.earliestArrivalTime')">
<view> <view>
<u-input border="none" placeholder="请选择" <u-input border="none" placeholder="请选择目的地" :value="formData['destinationAddress.fullName']" />
:value="convertTime(formData.tasks[index].earliestArrivalTime)" />
</view> </view>
<u-icon slot="right" name="arrow-right" @click="onVisibleDate" <u-icon slot="right" name="arrow-right" @click="onVisible" index="destinationAddress.fullName" />
:index="index + '.earliestArrivalTime'" />
</u-form-item> </u-form-item>
<view v-for="(line, lineIndex) in item.lines" :key="lineIndex">
</view>
<view class="module-title flex" v-if="formData.uc_department==='D001'||formData.uc_department==='D002'">
<text class="font_bolder">订单明细</text>
</view>
<view class="orderTask" style="padding-bottom: 12px; margin-bottom:12px"
v-if="formData.uc_department==='D001'||formData.uc_department==='D002'">
<view v-for="(line, lineIndex) in formItems" :key="lineIndex">
<view class=" order_title"> <view class=" order_title">
货物明细{{ toChineseNumber(lineIndex + 1) }} 货物明细{{ toChineseNumber(lineIndex + 1) }}
</view> </view>
<u-form-item prop="thing.code" label="货物代码" labelWidth="25%" borderBottom <u-form-item prop="goodsName" label="零件名称" labelWidth="25%" borderBottom
@click="onVisible(index + '.' + lineIndex + '.thing.code')"> @click="onVisible(lineIndex + '.thing.code')">
<view> <view>
<u-input border="none" placeholder="请选择" :value="line['thing.code']" /> <u-input border="none" placeholder="请选择" :value="line.goodsName" />
</view> </view>
<u-icon slot="right" name="arrow-right" @click="onVisible" <u-icon slot="right" name="arrow-right" @click="onVisible" :index="lineIndex + '.thing.code'" />
:index="index + '.' + lineIndex + '.thing.code'" />
</u-form-item> </u-form-item>
<u-form-item prop="thing.name" label="货物名称" labelWidth="25%" borderBottom> <u-form-item prop="name" label="货物名称" labelWidth="25%" borderBottom>
<view> <view>
<u-input border="none" readonly :value="line['thing.name']" /> <u-input border="none" readonly v-model="line.name" />
</view> </view>
</u-form-item> </u-form-item>
<u-form-item prop="qty" label="数量(件)" labelWidth="25%" borderBottom> <u-form-item prop="qty" label="数量(件)" labelWidth="25%" borderBottom>
<view> <view>
<u-input border="none" placeholder="请输入" v-model="line.qty" /> <u-input border="none" type="number" placeholder="请输入" v-model="line.qty" />
</view> </view>
</u-form-item> </u-form-item>
<u-form-item prop="weight" label="重量(kg)" labelWidth="25%" borderBottom> <u-form-item prop="weight" label="重量(kg)" labelWidth="25%" borderBottom>
<view> <view>
<u-input border="none" placeholder="请输入" v-model="line.weight" /> <u-input border="none" type="number" placeholder="请输入" v-model="line.weight" />
</view> </view>
</u-form-item> </u-form-item>
<u-form-item prop="volume" label="体积(m³)" labelWidth="25%"> <u-form-item prop="volume" label="体积(m³)" labelWidth="25%">
<view> <view>
<u-input border="none" placeholder="请输入" v-model="line.volume" /> <u-input border="none" type="number" placeholder="请输入" v-model="line.volume" />
</view> </view>
</u-form-item> </u-form-item>
<button class="add_button" @click="removeLine(index)">移除货物</button>
</view> </view>
<button class="add_button" @click="addLine(index)">新增货物</button> <button class="add_button" @click="addLine(index)">新增货物</button>
</view> </view>
<button class="add_button" @click="addTask">新增订单任务</button> <!-- <button class="add_button" @click="addTask">新增订单任务</button> -->
...@@ -132,14 +165,69 @@ ...@@ -132,14 +165,69 @@
<!-- 时间选择 --> <!-- 时间选择 -->
<bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate" <bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate"
@onSelsectDate="onSelsectDate" /> @onSelsectDate="onSelsectDate" />
<!-- 运输方式弹窗 -->
<popupRadio :radioShow="showTransportMethodPopup" :closeable="true" :radioList="transportMethodOption"
title="运输方式" :currentSelect="formData.transportMode" @cancel="showTransportMethodPopup = false"
@onChange="transportMethodChange">
</popupRadio>
<!-- 紧急程度弹窗 -->
<popupRadio :radioShow="showUrgentGradeMethodPopup" :closeable="true" :radioList="urgentGradeMethodOption"
title="紧急程度" :currentSelect="formData.urgentGrade" @cancel="showUrgentGradeMethodPopup = false"
@onChange="urgentGradeMethodChange">
</popupRadio>
<!-- 部门弹窗 -->
<popupRadio :radioShow="showDepartmentPopup" :closeable="true" :radioList="departmentOption" title="部门"
:currentSelect="formData.uc_department" @cancel="showDepartmentPopup = false" @onChange="departmentChange">
</popupRadio>
<!-- 运输类型 -->
<popupRadio :radioShow="showTransportTypeMethodPopup" :closeable="true" :radioList="transportTypeMethodOption"
title="运输类型" :currentSelect="formData.uc_transport_type" @cancel="showTransportTypeMethodPopup = false"
@onChange="transportTypeMethodChange">
</popupRadio>
<!-- 货物 -->
<popupRadio :radioShow="showGoodsTypeMethodPopup" :closeable="true" :radioList="goodsTypeMethodOption"
title="货物类型" :currentSelect="formData.goodsType" @cancel="showGoodsTypeMethodPopup = false"
@onChange="goodsTypeChange">
</popupRadio>
<!-- 结算方式 -->
<popupRadio :radioShow="showSettlementtypeMethodPopup" :closeable="true" :radioList="settlementtypeMethodOption"
title="结算方式" :currentSelect="formData.uc_settlementtype" @cancel="showSettlementtypeMethodPopup = false"
@onChange="settlementTypeMethodChange">
</popupRadio>
<!-- 客户弹窗 -->
<popupRadio :radioShow="showCustomerPopup" :closeable="true" :radioList="customerOption" title="客户"
:currentSelect="formData.customer" @cancel="showCustomerPopup = false" @onChange="customerChange">
</popupRadio>
</view> </view>
</template> </template>
<script> <script>
import {
import { orderInsert, queryThing, queryObject, queryOriginalAddress, queryDestinationAddress, queryTransportMode,queryTransportProduct } from '../../api/apiList' queryCustomerAll,
export default { getOptionEnumMd,
options: { styleIsolation: 'shared' }, getOptionEnumThing,
orderInsert,
queryThing,
queryObject,
queryOriginalAddress,
queryDestinationAddress,
queryTransportMode,
queryTransportProduct,
createNewOrderRelease
} from '../../api/apiList'
import {
formatTime
} from '../../utils/util'
export default {
options: {
styleIsolation: 'shared'
},
props: { props: {
isEdit: { isEdit: {
type: Boolean, type: Boolean,
...@@ -157,96 +245,46 @@ export default { ...@@ -157,96 +245,46 @@ export default {
data() { data() {
return { return {
formData: { formData: {
"orderNo": null, uc_department: "",
"customerOrderNo": null, urgentGrade: "",
"extCustomerNo": null, customerOrderNo: "",
"orderDate": "", vin: "",
"billType": "Logistics", customer: "",
"orderType.name": null, customerName: "",
"project.name": null, transportMode: "",
"customer.name": "", originalAddress: "", //发货地址id
"organization.name": null, uc_source_prov_tmp: "",
"qty": null, uc_source_city_tmp: "",
"weight": null, uc_source_dist_tmp: "",
"volume": null, uc_source_name_tmp: "",
"orderStatus": "", uc_source_contact_tmp: "",
"carrier.name": null, uc_source_detail_tmp: "",
"truck.name": null, uc_source_tel_tmp: "",
"driver.name": null, destinationAddress: "", //收货地址id
"driver.tel": null, uc_dest_prov_tmp: "",
"line.name": null, uc_dest_city_tmp: "",
uc_dest_dist_tmp: "",
"line.id": null, uc_dest_name_tmp: "",
"transportMode": null, uc_dest_contact_tmp: "",
"transportMode.name": null, uc_dest_detail_tmp: "",
"transportProduct":null, uc_dest_tel_tmp: "",
"transportProduct.name":null, latestArrivalTime: "",
"consignor.name": null, earliestPickUpTime: "",
"consignee.name": null, orderDate: "",
"originalContact.name": null, uc_transport_type: "",
"destinationContact.name": null, uc_settlementtype: "",
"advanceAmount": null, "originalAddress.fullName": "",
"advanceOil": null, "destinationAddress.fullName": ""
"arrivalAmount": null,
"arrivalOil": null,
"podAmount": null,
"buyFixedAmount": null,
"sellFixedAmount": null,
"project": null,
"carrier": null,
"tasks": [
{
"customerOrderNo": "",
"consignor.name": null,
"original.name": "",
"originalContact": "",
"originalContact.name": null,
"consignee.name": null,
"destination.name": "",
"destinationContact": "",
"destinationContact.name": "",
"earliestPickUpTime": null,
"latestPickUpTime": null,
"earliestArrivalTime": null,
"latestArrivalTime": null,
"originalRequirement": null,
"destinationRequirement": null,
"transportRequest": null,
"goodsType": null,
"goodsLabel": null,
"truckType": null,
"truckLength": null,
"containerQty": null,
"middleStop1.name": null,
"middleStop2.name": null,
"middleStop3.name": null,
"qty": null,
"weight": null,
"volume": null,
"destination": "",
"original": "",
"lines": [{
"thing.name": "",
"height": 0,
"weight": 0,
"volume": 0,
"qty": 0,
"thing.code": "",
"thing": "",
}]
}
],
"customer": "",
}, },
rules: { rules: {
'name': { required: true }, transportMode: [{
'tel': { required: true }, required: true
}]
}, },
formItems: [],
visibleKey: '', //当前显示字段的key visibleKey: '', //当前显示字段的key
optionEnums: [], //候选项枚举 optionEnums: [], //候选项枚举
genderViewEnums: [],//性别枚举 genderViewEnums: [], //性别枚举
viewEnums: [], //视图枚举 viewEnums: [], //视图枚举
visible: false, //类型选择 visible: false, //类型选择
...@@ -254,19 +292,192 @@ export default { ...@@ -254,19 +292,192 @@ export default {
carrierList: [], carrierList: [],
carrierViewEnums: [], carrierViewEnums: [],
keyWord: '', keyWord: '',
visibleType: '' visibleType: '',
showTransportMethodPopup: false,
showUrgentGradeMethodPopup: false,
showTransportTypeMethodPopup: false,
showSettlementtypeMethodPopup: false,
showGoodsTypeMethodPopup: false,
transportMethodOption: [],
urgentGradeMethodOption: [],
goodsTypeMethodOption: [],
transportTypeMethodOption: [{
"label": "单程",
"value": "T001"
},
{
"label": "往返",
"value": "T002"
}
],
settlementtypeMethodOption: [{
"label": "现结",
"value": "ST001"
},
{
"label": "月结",
"value": "ST002"
}
],
goodsTypeListOption: [],
customerOption: [],
departmentOption: [{
"label": "零部件物流",
"value": "D001"
},
{
"label": "综合物流",
"value": "D002"
},
{
"label": "整车物流",
"value": "D003"
}
],
goodsList: [],
showCustomerPopup: false,
showDepartmentPopup: false,
} }
}, },
onShow() { onShow() {
},
async mounted() {
await this.initData();
}, },
methods: { methods: {
initData(formData) { async initData(formData) {
console.log(formData); let res = await getOptionEnumMd('md.TransportMode');
this.transportMethodOption = res.data.data.datas;
let res2 = await getOptionEnumMd('md.UrgentGrade');
this.urgentGradeMethodOption = res2.data.data.datas;
let res3 = await getOptionEnumMd('md.GoodsType');
this.goodsTypeMethodOption = res3.data.data.datas;
this.addLine()
},
openUrgentGradeMethodPopup() {
this.showUrgentGradeMethodPopup = true;
},
openTransportMethodPopup() {
this.showTransportMethodPopup = true;
},
openGoodsTypeMethodPopup() {
this.showGoodsTypeMethodPopup = true;
},
openTransportTypeMethodPopup() {
this.showTransportTypeMethodPopup = true;
},
openSettlementtypeMethodPopup() {
this.showSettlementtypeMethodPopup = true;
},
transportMethodChange(value) {
this.showTransportMethodPopup = false;
this.formData.transportMode = value;
},
urgentGradeMethodChange(value) {
this.showUrgentGradeMethodPopup = false;
this.formData.urgentGrade = value;
},
goodsTypeChange(value) {
this.showGoodsTypeMethodPopup = false;
this.formData.goodsType = value;
},
transportTypeMethodChange(value) {
this.showTransportTypeMethodPopup = false;
this.formData.uc_transport_type = value;
},
settlementTypeMethodChange(value) {
this.showSettlementtypeMethodPopup = false;
this.formData.uc_settlementtype = value;
},
customerChange(value) {
this.showCustomerPopup = false;
this.formData.customer = value;
this.formData.customerName = this.customerOption.find(item => item.value == value).label;
},
openDepartmentPopup() {
this.showDepartmentPopup = true;
},
departmentChange(value) {
this.showDepartmentPopup = false;
this.formData.uc_department = value;
this.getCustomerOption();
},
departmentMethodFilter(value) {
return this.departmentOption.find(item => item.value == value).label
},
goodsTypeMethodFilter(value) {
return this.goodsTypeMethodOption.find(item => item.value == value).label
},
transportTypeMethodFilter(value) {
return this.transportTypeMethodOption.find(item => item.value == value).label
},
transportMethodFilter(value) {
return this.transportMethodOption.find(item => item.value == value).label
},
urgentGradeMethodFilter(value) {
return this.urgentGradeMethodOption.find(item => item.value == value).label
},
settlementtypeMethodFilter(value) {
return this.settlementtypeMethodOption.find(item => item.value == value).label
},
async getCustomerOption() {
let params = {
"getTotalBy": "count",
"fields": [],
"keyword": {
"value": "",
"fields": ["code", "refer_code", "name"],
"exact": false,
"partialMatchMode": "contain",
"caseSensitive": true
},
"filter": {
"fields": []
},
"refFields": [],
"order": [],
"quickFilter": {
"relationDataset": "md_customer_enable_search1__quickFilterDataSet",
"fields": [{
"name": "uc_department",
"label": "所属部门",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "uc_department",
"restriction": "eq",
"value": this.formData.uc_department,
"num": 0
}]
},
"tableHeaderFilter": {
"relationDataset": "md_customer_enable_search1__tableHeaderFilterDataSet",
"fields": []
},
"pageNum": 1,
"pageSize": 200,
"aggregation": {}
}
let res = await queryCustomerAll(params)
this.customerOption = res.data.data.datas.map(item => {
return {
label: item.name,
value: item.id
}
});
},
openCustomerPopup() {
if (this.formData.uc_department === '') {
this.$refs.uToast.show({
message: '请先选择部门'
})
return
} else {
this.showCustomerPopup = true;
this.formData = formData; }
this.formData.transportMode.name=this.formData.transportMode
console.log(this.formData.transportMode.name);
}, },
toChineseNumber(n) { toChineseNumber(n) {
if (!Number.isInteger(n) && n < 0) { if (!Number.isInteger(n) && n < 0) {
...@@ -294,65 +505,33 @@ export default { ...@@ -294,65 +505,33 @@ export default {
} }
return result; return result;
}, },
addLine(index) { async addLine(index) {
this.formData.tasks[index].lines.push({ this.formItems.push({
"thing.name": "", "goodsName": "",
"height": 0, "goodsId": "",
"weight": 0, "name": "",
"volume": 0, // "weight": 0,
"qty": 0, // "volume": 0,
"thing.code": "", // "qty": 0,
"thing": "",
})
},
addTask() {
this.formData.tasks.push({
"customerOrderNo": "",
"consignor.name": null,
"original.name": "",
"originalContact": "",
"originalContact.name": null,
"consignee.name": null,
"destination.name": "",
"destinationContact": "",
"destinationContact.name": "",
"earliestPickUpTime": null,
"latestPickUpTime": null,
"earliestArrivalTime": null,
"latestArrivalTime": null,
"originalRequirement": null,
"destinationRequirement": null,
"transportRequest": null,
"goodsType": null,
"goodsLabel": null,
"truckType": null,
"truckLength": null,
"containerQty": null,
"middleStop1.name": null,
"middleStop2.name": null,
"middleStop3.name": null,
"qty": null,
"weight": null,
"volume": null,
"destination": "",
"original": "",
"lines": []
}) })
}, },
removeLine(index) {
this.formItems.splice(index, 1);
},
async changeKeyWord(keyWord) { async changeKeyWord(keyWord) {
this.keyWord = keyWord this.keyWord = keyWord
let type = this.visibleType let type = this.visibleType
let optionEnums = [] let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key let setKey = 'viewEnums' //要设置的字段Key
if (type.includes('destination.name')) { if (type.includes('destinationAddress.fullName')) {
const res = await queryDestinationAddress( const res = await queryDestinationAddress({
{
"args": { "args": {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 20,
restrictions: [{ restrictions: [{
"field": "name", "field": "fullName",
"type": "LK", "type": "LK",
"value": this.keyWord "value": this.keyWord
}] }]
...@@ -365,44 +544,77 @@ export default { ...@@ -365,44 +544,77 @@ export default {
...item ...item
} }
}) })
} else if (type.includes('original.name')) { } else if (type.includes('originalAddress.fullName')) {
const res = await queryOriginalAddress( const res = await queryOriginalAddress({
{
"args": { "args": {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10,
restrictions: [{ restrictions: [{
"field": "name", "field": "fullName",
"type": "LK", "type": "LK",
"value": this.keyWord "value": this.keyWord
}] }]
} }
} })
)
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.name, label: item.name,
value: item.id, ...item value: item.id,
...item
} }
}) })
} else if (type.includes('project.name')) { } else if (type.includes('customer.name')) {
const res = await queryObject( let params = {
{ "getTotalBy": "count",
"args": { "fields": [],
pageNum: 1, "keyword": {
pageSize: 10000, "value": "",
restrictions: [{ "fields": ["code", "refer_code", "name"],
"field": "name", "exact": false,
"type": "LK", "partialMatchMode": "contain",
"value": this.keyWord "caseSensitive": true
},
"filter": {
"fields": []
},
"refFields": [],
"order": [],
"quickFilter": {
"relationDataset": "md_customer_enable_search1__quickFilterDataSet",
"fields": [{
"name": "name",
"label": "名称",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "name",
"restriction": "like",
"value": this.keyWord,
"num": 0
}, {
"name": "uc_department",
"label": "所属部门",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "uc_department",
"restriction": "eq",
"value": this.formData.uc_department,
"num": 1
}] }]
},
"tableHeaderFilter": {
"relationDataset": "md_customer_enable_search1__tableHeaderFilterDataSet",
"fields": []
},
"pageNum": 1,
"pageSize": 200,
"aggregation": {}
} }
} let res = await queryCustomerAll(params)
)
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.name, label: item.name,
value: item.id, ...item value: item.id,
...item
} }
}) })
} else if (type.includes('transportMode.name')) { } else if (type.includes('transportMode.name')) {
...@@ -412,33 +624,29 @@ export default { ...@@ -412,33 +624,29 @@ export default {
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.label, label: item.label,
value: item.value, ...item value: item.value,
...item
} }
}) })
}else if (type.includes('transportProduct.name')) { } else if (type.includes('transportProduct.name')) {
const res = await queryTransportProduct( const res = await queryTransportProduct(
) )
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.label, label: item.label,
value: item.value, ...item value: item.value,
...item
} }
}) })
} else if (type.includes('thing.code')) { } else if (type.includes('thing.code')) {
const res = await queryThing( const res = await getOptionEnumThing({
{ "partialMatchMode": "contain",
"args": { "size": 10,
pageNum: 1, "valueField": "id",
pageSize: 10000, "pageNum": 0,
restrictions: [{ "caseSensitive": true
"field": "name", })
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.code, label: item.code,
...@@ -447,6 +655,23 @@ export default { ...@@ -447,6 +655,23 @@ export default {
...item ...item
} }
}) })
} else if (type === 'uc_department.name') {
optionEnums.push({
'label': "零部件物流",
'value': "D001",
'enabled': true
})
optionEnums.push({
'label': "综合物流",
'value': "D002",
'enabled': true
})
optionEnums.push({
'label': "整车物流",
'value': "D003",
'enabled': true
})
} }
this.setViewEnums(optionEnums, setKey) this.setViewEnums(optionEnums, setKey)
...@@ -465,100 +690,78 @@ export default { ...@@ -465,100 +690,78 @@ export default {
// 提交表单数据 // 提交表单数据
onSubmitForm() { onSubmitForm() {
orderInsert({ if (this.formItems.length == 0 && this.formData.uc_department != 'D003') {
aux: { this.$refs.uToast.show({
selectedRows: [this.formData] message: '请完善必填信息'
})
return
} }
}).then(result => { if (!this.formData.destinationAddress || !this.formData.originalAddress) {
if (this.isEdit) { this.$refs.uToast.show({
this.$emit('close') message: '请完善地址信息'
} else { })
this.formData = { return
"orderNo": null,
"customerOrderNo": null,
"extCustomerNo": null,
"orderDate": "",
"billType": "Logistics",
"orderType.name": null,
"project.name": null,
"customer.name": "",
"organization.name": null,
"qty": null,
"weight": null,
"volume": null,
"orderStatus": "",
"carrier.name": null,
"truck.name": null,
"driver.name": null,
"driver.tel": null,
"line.name": null,
"transportProduct": null,
"transportProduct.name":null,
"line.id": null,
"transportMode": null,
"transportMode.name": null,
"consignor.name": null,
"consignee.name": null,
"originalContact.name": null,
"destinationContact.name": null,
"advanceAmount": null,
"advanceOil": null,
"arrivalAmount": null,
"arrivalOil": null,
"podAmount": null,
"buyFixedAmount": null,
"sellFixedAmount": null,
"project": null,
"carrier": null,
"tasks": [
{
"customerOrderNo": "",
"consignor.name": null,
"original.name": "",
"originalContact": "",
"originalContact.name": null,
"consignee.name": null,
"destination.name": "",
"destinationContact": "",
"destinationContact.name": "",
"earliestPickUpTime": null,
"latestPickUpTime": null,
"earliestArrivalTime": null,
"latestArrivalTime": null,
"originalRequirement": null,
"destinationRequirement": null,
"transportRequest": null,
"goodsType": null,
"goodsLabel": null,
"truckType": null,
"truckLength": null,
"containerQty": null,
"middleStop1.name": null,
"middleStop2.name": null,
"middleStop3.name": null,
"qty": null,
"weight": null,
"volume": null,
"destination": "",
"original": "",
"lines": [{
"thing.name": "",
"height": 0,
"weight": 0,
"volume": 0,
"qty": 0,
"thing.code": "",
"thing": "",
}]
} }
], this.$refs.form.validate().then(res => {
"customer": "", let headerData = {
...this.formData
}
if (this.formData.earliestPickUpTime) {
headerData.earliestPickUpTime = formatTime(this.formData.earliestPickUpTime)
} }
if (this.formData.earliestPickUpTime) {
headerData.latestArrivalTime = formatTime(this.formData.latestArrivalTime)
} }
uni.showToast({ headerData.orderDate = formatTime(this.formData.orderDate)
icon: 'success',
title: '操作成功' let data = {
aux: {
"uc_department": headerData.uc_department,
"urgentGrade": headerData.urgentGrade,
"customerOrderNo": headerData.customerOrderNo,
"uc_vin": headerData.vin,
"customer": headerData.customer,
"transportMode": headerData.transportMode,
"originalAddress": headerData.originalAddress,
"uc_source_prov_tmp": this.formData.uc_source_prov_tmp,
"uc_source_city_tmp": this.formData.uc_source_city_tmp,
"uc_source_dist_tmp": this.formData.uc_source_dist_tmp,
"uc_source_name_tmp": this.formData.uc_source_name_tmp,
"uc_source_contact_tmp": this.formData.uc_source_contact_tmp,
"uc_source_detail_tmp": this.formData.uc_source_detail_tmp,
"uc_source_tel_tmp": this.formData.uc_source_tel_tmp,
"destinationAddress": headerData.destinationAddress,
"uc_dest_prov_tmp": this.formData.uc_dest_prov_tmp,
"uc_dest_city_tmp": this.formData.uc_dest_city_tmp,
"uc_dest_dist_tmp": this.formData.uc_dest_dist_tmp,
"uc_dest_name_tmp": this.formData.uc_dest_name_tmp,
"uc_dest_contact_tmp": this.formData.uc_dest_contact_tmp,
"uc_dest_detail_tmp": this.formData.uc_dest_detail_tmp,
"uc_dest_tel_tmp": this.formData.uc_dest_tel_tmp,
"latestArrivalTime": headerData.latestArrivalTime,
"earliestPickUpTime": headerData.earliestPickUpTime,
"orderDate": headerData.orderDate,
"uc_transport_type": headerData.uc_transport_type,
"uc_settlementtype": headerData.uc_settlementtype,
"goodsType": headerData.goodsType,
"lines": this.formItems
}
}
// let data = {"aux":{"uc_department":"D001","urgentGrade":"NORMAL","customerOrderNo":"123","uc_vin":"","customer":"797668003956129792","transportMode":"LTL","originalAddress":"811197013654765568","uc_source_prov_tmp":"","uc_source_city_tmp":"","uc_source_dist_tmp":"","uc_source_name_tmp":"","uc_source_contact_tmp":"","uc_source_detail_tmp":"","uc_source_tel_tmp":"","destinationAddress":"811197015739334656","uc_dest_prov_tmp":"","uc_dest_city_tmp":"","uc_dest_dist_tmp":"","uc_dest_name_tmp":"","uc_dest_contact_tmp":"","uc_dest_detail_tmp":"","uc_dest_tel_tmp":"","latestArrivalTime":"2025-03-19T18:00:18+08:00","earliestPickUpTime":"2025-03-19T18:00:18+08:00","orderDate":"2025-03-19T00:00:00+08:00","uc_transport_type":"T001","uc_settlementtype":"ST001","goodsType":"HEAVY","lines":[{"goodsName":"TEST001","goodsId":"807192134724616192","name":"测试分类","qty":"11","weight":"1","volume":"1"}]}}
console.log(JSON.stringify(data))
createNewOrderRelease(data).then(res => {
this.$refs.uToast.show({
message: res.data.data,
duration: 6000
})
setTimeout(() => {
uni.navigateBack()
}, 6000)
})
}).catch(err => {
console.log(err)
this.$refs.uToast.show({
message: '请完善必填信息'
}) })
}) })
...@@ -566,6 +769,7 @@ export default { ...@@ -566,6 +769,7 @@ export default {
//类型选择 //类型选择
async onVisible(type) { async onVisible(type) {
console.log("type:" + type)
this.visibleType = type this.visibleType = type
if (this.visible) { if (this.visible) {
this.keyWord = '' this.keyWord = ''
...@@ -573,15 +777,14 @@ export default { ...@@ -573,15 +777,14 @@ export default {
} else { } else {
let optionEnums = [] let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key let setKey = 'viewEnums' //要设置的字段Key
if (type.includes('destination.name')) { if (type.includes('destinationAddress.fullName')) {
const res = await queryDestinationAddress( const res = await queryDestinationAddress({
{
"args": { "args": {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 20,
restrictions: [{ restrictions: [{
"field": "name", "field": "fullName",
"type": "LK", "type": "LK",
"value": this.keyWord "value": this.keyWord
}] }]
...@@ -594,44 +797,77 @@ export default { ...@@ -594,44 +797,77 @@ export default {
...item ...item
} }
}) })
} else if (type.includes('original.name')) { } else if (type.includes('originalAddress.fullName')) {
const res = await queryOriginalAddress( const res = await queryOriginalAddress({
{
"args": { "args": {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10,
restrictions: [{ restrictions: [{
"field": "name", "field": "fullName",
"type": "LK", "type": "LK",
"value": this.keyWord "value": this.keyWord
}] }]
} }
} })
)
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.name, label: item.name,
value: item.id, ...item value: item.id,
...item
} }
}) })
} else if (type.includes('project.name')) { } else if (type.includes('customer.name')) {
const res = await queryObject( let params = {
{ "getTotalBy": "count",
"args": { "fields": [],
pageNum: 1, "keyword": {
pageSize: 10000, "value": "",
restrictions: [{ "fields": ["code", "refer_code", "name"],
"field": "name", "exact": false,
"type": "LK", "partialMatchMode": "contain",
"value": this.keyWord "caseSensitive": true
},
"filter": {
"fields": []
},
"refFields": [],
"order": [],
"quickFilter": {
"relationDataset": "md_customer_enable_search1__quickFilterDataSet",
"fields": [{
"name": "name",
"label": "名称",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "name",
"restriction": "like",
"value": this.keyWord,
"num": 0
}, {
"name": "uc_department",
"label": "所属部门",
"ignore": false,
"caseSensitive": true,
"quickFilterField": "uc_department",
"restriction": "eq",
"value": this.formData.uc_department,
"num": 1
}] }]
},
"tableHeaderFilter": {
"relationDataset": "md_customer_enable_search1__tableHeaderFilterDataSet",
"fields": []
},
"pageNum": 1,
"pageSize": 200,
"aggregation": {}
} }
} let res = await queryCustomerAll(params)
)
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.name, label: item.name,
value: item.id, ...item value: item.id,
...item
} }
}) })
} else if (type.includes('transportMode.name')) { } else if (type.includes('transportMode.name')) {
...@@ -641,7 +877,8 @@ export default { ...@@ -641,7 +877,8 @@ export default {
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.label, label: item.label,
value: item.value, ...item value: item.value,
...item
} }
}) })
} else if (type.includes('transportProduct.name')) { } else if (type.includes('transportProduct.name')) {
...@@ -651,33 +888,47 @@ export default { ...@@ -651,33 +888,47 @@ export default {
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.label, label: item.label,
value: item.value, ...item value: item.value,
...item
} }
}) })
} else if (type.includes('thing.code')) { } else if (type.includes('thing.code')) {
const res = await queryThing( const res = await getOptionEnumThing({
{ "partialMatchMode": "contain",
"args": { "size": 10,
pageNum: 1, "valueField": "id",
pageSize: 10000, "pageNum": 0,
restrictions: [{ "caseSensitive": true
"field": "name", })
"type": "LK",
"value": this.keyWord
}]
}
}
)
optionEnums = res.data.data.datas.map(item => { optionEnums = res.data.data.datas.map(item => {
return { return {
label: item.code, label: item.name,
value: item.id, value: item.id,
name: item.name, name: item.name,
...item ...item
} }
}) })
} } else if (type === 'uc_department.name') {
optionEnums.push({
'label': "零部件物流",
'value': "D001",
'enabled': true
})
optionEnums.push({
'label': "综合物流",
'value': "D002",
'enabled': true
})
optionEnums.push({
'label': "整车物流",
'value': "D003",
'enabled': true
})
}
console.log("optionEnums" + JSON.stringify(optionEnums))
this.setViewEnums(optionEnums, setKey) this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums this.optionEnums = optionEnums
this.visibleKey = type this.visibleKey = type
...@@ -700,7 +951,9 @@ export default { ...@@ -700,7 +951,9 @@ export default {
// 时间选择 // 时间选择
onSelsectDate(dateInfo) { onSelsectDate(dateInfo) {
const { timestamp } = dateInfo const {
timestamp
} = dateInfo
this.setFormData(new Date(timestamp).toISOString()) this.setFormData(new Date(timestamp).toISOString())
this.showPopup = false this.showPopup = false
}, },
...@@ -720,17 +973,26 @@ export default { ...@@ -720,17 +973,26 @@ export default {
this.formData['transportProduct'] = this.viewEnums[value] this.formData['transportProduct'] = this.viewEnums[value]
} }
if (key.includes('uc_department')) {
this.formData[key] = this.viewEnums[value]
this.formData['uc_department'] = this.viewEnums[value]
}
console.log("keys" + JSON.stringify(this.optionEnums))
console.log("keys" + JSON.stringify(this.viewEnums))
if (!isNaN(parseInt(keys[0])) && !key.includes('thing.code')) { if (!isNaN(parseInt(keys[0])) && !key.includes('thing.code')) {
this.formData.tasks[keys[0]][keys.slice(1).join('.')] = this.viewEnums[value] this.formData[key] = this.viewEnums[value]
this.formData.tasks[keys[0]][keys.slice(1)[0]] = value this.formData[keys[0]] = value
} else if (!isNaN(parseInt(keys[0])) && key.includes('thing.code')) { } else if (!isNaN(parseInt(keys[0])) && key.includes('thing.code')) {
this.formData.tasks[keys[0]].lines[keys[1]]['thing.code'] = this.viewEnums[value] this.formItems[keys[0]].goodsName = this.viewEnums[value]
this.formData.tasks[keys[0]].lines[keys[1]]['thing'] = value this.formItems[keys[0]].goodsId = value
console.log("formItems:" + JSON.stringify(this.formItems[keys[0]]))
this.optionEnums.map(item => { this.optionEnums.map(item => {
if (item.value == value) { if (item.value == value) {
this.formData.tasks[keys[0]].lines[keys[1]]['thing.name'] = item.name this.formItems[keys[0]].name = item.category__name
} }
}) })
...@@ -764,12 +1026,13 @@ export default { ...@@ -764,12 +1026,13 @@ export default {
}, },
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.orderInsert { .orderInsert {
padding: 0 12px; padding: 0 12px;
padding-top: 45px;
.module-title { .module-title {
padding: 32px 32px 16px; padding: 32px 32px 16px;
...@@ -941,5 +1204,5 @@ export default { ...@@ -941,5 +1204,5 @@ export default {
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -70,9 +70,13 @@ ...@@ -70,9 +70,13 @@
</template> </template>
<script> <script>
import { OrderQuery, getOptionEnum, GetOrderDetailInfo } from '../../api/apiList' import {
OrderQuery,
getOptionEnum,
GetOrderDetailInfo
} from '../../api/apiList'
export default { export default {
data() { data() {
return { return {
orderList: [], orderList: [],
...@@ -82,10 +86,18 @@ export default { ...@@ -82,10 +86,18 @@ export default {
showPop: false, showPop: false,
filterLabelArr: [], filterLabelArr: [],
choiceSubscribeType: [], choiceSubscribeType: [],
range: [ range: [{
{ value: 0, text: "篮球" }, value: 0,
{ value: 1, text: "足球" }, text: "篮球"
{ value: 2, text: "游泳" }, },
{
value: 1,
text: "足球"
},
{
value: 2,
text: "游泳"
},
], ],
value: 0, value: 0,
filterEnums: { filterEnums: {
...@@ -108,7 +120,11 @@ export default { ...@@ -108,7 +120,11 @@ export default {
methods: { methods: {
getOrderDetailInfo(id) { getOrderDetailInfo(id) {
const that = this const that = this
GetOrderDetailInfo({ "aux": { "_ID": id } }).then(res => { GetOrderDetailInfo({
"aux": {
"_ID": id
}
}).then(res => {
that.$refs.orderInsertContent.initData(res.data.data) that.$refs.orderInsertContent.initData(res.data.data)
}) })
...@@ -216,15 +232,16 @@ export default { ...@@ -216,15 +232,16 @@ export default {
}) })
}, },
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.queueSubscribeTitle { .queueSubscribeTitle {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #FFFFFF; background-color: #FFFFFF;
padding-top: 45px;
.u-input { .u-input {
height: 32px; height: 32px;
...@@ -240,24 +257,24 @@ export default { ...@@ -240,24 +257,24 @@ export default {
color: #FFFFFF !important; color: #FFFFFF !important;
} }
} }
.scroll-Y { .scroll-Y {
height: 100vh; height: 100vh;
} }
.expense_list_filter { .expense_list_filter {
color: #434343; color: #434343;
padding-right: 24px; padding-right: 24px;
margin-left: 24px; margin-left: 24px;
} }
.expense_list_pop_content { .expense_list_pop_content {
margin: 24px; margin: 24px;
height: calc(100vh - 144px); height: calc(100vh - 144px);
} }
.expense_list_pop_foot { .expense_list_pop_foot {
height: 144px; height: 144px;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
...@@ -274,9 +291,9 @@ export default { ...@@ -274,9 +291,9 @@ export default {
color: #434343; color: #434343;
line-height: 88px; line-height: 88px;
} }
} }
.expense_list_pop_content_type { .expense_list_pop_content_type {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -291,12 +308,12 @@ export default { ...@@ -291,12 +308,12 @@ export default {
margin: 24px; margin: 24px;
color: #323233; color: #323233;
} }
} }
.expense_list_pop_content_connect { .expense_list_pop_content_connect {
margin: 0 16px; margin: 0 16px;
height: 0; height: 0;
width: 39px; width: 39px;
border: 2px solid #BFBFBF; border: 2px solid #BFBFBF;
} }
</style>></style> </style>></style>
\ No newline at end of file
<template> <template>
<view :class="[(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name' )? '' : 'selectPicker']" @touchmove.stop.prevent="moveHandle"> <view
<u-picker v-if="(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name' )" ref="uPicker" keyName="label" immediateChange :class="[(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name' || visibleType ==='uc_department.name' )? '' : 'selectPicker']"
confirmText="确定" :show="visible" :title="PanelTitle" :closeOnClickOverlay="true" :itemHeight="68" @touchmove.stop.prevent="moveHandle">
:columns="[pickerEnums]" :singleIndex="singleIndex" :visibleItemCount="visibleNum" @cancel="onCancel" <u-picker
@confirm="onConfirm" @close="onCancel" /> v-if="(visibleType === 'transportMode.name' || visibleType ==='transportProduct.name'|| visibleType ==='uc_department.name' )"
ref="uPicker" keyName="label" immediateChange confirmText="确定" :show="visible" :title="PanelTitle"
:closeOnClickOverlay="true" :itemHeight="68" :columns="[pickerEnums]" :singleIndex="singleIndex"
:visibleItemCount="visibleNum" @cancel="onCancel" @confirm="onConfirm" @close="onCancel" />
<u-popup v-else :show="visible" @close="onCancel" closeable> <u-popup v-else :show="visible" @close="onCancel" closeable>
<u-search placeholder="请输入关键字" :value="keyWord" @change="changeKeyWord" :showAction="false"></u-search> <u-search placeholder="请输入关键字" :value="keyWord" @change="changeKeyWord" :showAction="false"></u-search>
<!-- <scroll-view scroll-y class="select-list"> <!-- <scroll-view scroll-y class="select-list">
...@@ -11,7 +14,8 @@ ...@@ -11,7 +14,8 @@
{{ item.label }} {{ item.label }}
</view> </view>
</scroll-view> --> </scroll-view> -->
<divTable @scrollBottom='scrollBottom' @getTextColor='getRedText' @getEdit='editTable' <!-- @getTextColor='getRedText' -->
<divTable @scrollBottom='scrollBottom' @getEdit='editTable'
@getDelete='deleteTable' @rowData='getRow' :data2='pickerEnums' :head='dataProcess()' @getDelete='deleteTable' @rowData='getRow' :data2='pickerEnums' :head='dataProcess()'
:tableHeight='"calc(60vh-30px)"'> :tableHeight='"calc(60vh-30px)"'>
</divTable> </divTable>
...@@ -21,8 +25,10 @@ ...@@ -21,8 +25,10 @@
</template> </template>
<script> <script>
export default { export default {
options: { styleIsolation: 'shared' }, options: {
styleIsolation: 'shared'
},
data() { data() {
return { return {
singleIndex: 0 //默认选中项 singleIndex: 0 //默认选中项
...@@ -63,10 +69,13 @@ export default { ...@@ -63,10 +69,13 @@ export default {
}, },
//确定 //确定
onConfirm(value) { onConfirm(value) {
if ((this.visibleType === 'transportMode.name' || this.visibleType ==='transportProduct.name' )){ if ((this.visibleType === 'transportMode.name' ||
this.visibleType === 'transportProduct.name' ||
this.visibleType === 'uc_department.name'
)) {
this.$emit('onConfirm', value.value[0].value) this.$emit('onConfirm', value.value[0].value)
}else{ } else {
this.$emit('onConfirm', value) this.$emit('onConfirm', value)
} }
...@@ -84,43 +93,58 @@ export default { ...@@ -84,43 +93,58 @@ export default {
onCancel() { onCancel() {
this.$emit('onVisible') this.$emit('onVisible')
}, },
scrollBottom(){
console.log("scrollBottom")
},
changeKeyWord(keyWord) { changeKeyWord(keyWord) {
this.$emit('changeKeyWord', keyWord) this.$emit('changeKeyWord', keyWord)
}, },
dataProcess() { dataProcess() {
let type = this.visibleType let type = this.visibleType
if (type.includes('destination.name')) { if (type.includes('destinationAddress.fullName')) {
return [ return [{
{ name: '系统代码', key: 'code' }, name: '系统代码',
{ name: '名称', key: 'name' } key: 'code'
},
{
name: '名称',
key: 'fullName'
}
] ]
} else if (type.includes('original.name')) { } else if (type.includes('originalAddress.fullName')) {
return [ return [{
{ name: '系统代码', key: 'code' }, name: '系统代码',
{ name: '名称', key: 'name' } key: 'code'
]
} else if (type.includes('project.name')) {
return [
{ name: '系统代码', key: 'code' },
{ name: '名称', key: 'name' },
{ name: '外部代码', key: 'referCode' },
{
name: '所属组织', key: 'organization.secondParty.name'
}, },
{ {
name: '所属组织代码', key: 'organization.secondParty.code' name: '名称',
key: 'fullName'
}
]
} else if (type.includes('customer.name')) {
return [{
name: '系统代码',
key: 'code'
}, },
{
name: '名称',
key: 'name'
}
] ]
} else if (type.includes('thing.code')) { } else if (type.includes('thing.code')) {
return [ return [
{ name: '系统代码', key: 'code' },
{ name: '名称', key: 'name' },
{ name: '外部代码', key: 'referCode' },
{ {
name: '价格', key: 'price' name: '名称',
key: 'name'
}, },
{
name: '货物名称',
key: 'category__name'
},
] ]
} }
...@@ -128,11 +152,11 @@ export default { ...@@ -128,11 +152,11 @@ export default {
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.selectPicker { .selectPicker {
/deep/.u-transition { /deep/.u-transition {
...@@ -146,5 +170,5 @@ export default { ...@@ -146,5 +170,5 @@ export default {
/deep/.u-search { /deep/.u-search {
margin-top: 30rpx !important; margin-top: 30rpx !important;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -6,9 +6,9 @@ import Vue from "vue"; ...@@ -6,9 +6,9 @@ import Vue from "vue";
// 引入uView并配置 // 引入uView并配置
import uView from "uview-ui"; import uView from "uview-ui";
Vue.use(uView); Vue.use(uView);
import VConsole from "vconsole"; // import VConsole from "vconsole";
// 只有在开发环境下才加载vconsole // 只有在开发环境下才加载vconsole
new VConsole(); // new VConsole();
// 修改uView内置配置方案: 需要在Vue.use(uView)之后执行,目前只建议修改config、props属性, 除非您清楚知道自己的修改所带来的影响。 // 修改uView内置配置方案: 需要在Vue.use(uView)之后执行,目前只建议修改config、props属性, 除非您清楚知道自己的修改所带来的影响。
uni.$u.setConfig({ uni.$u.setConfig({
// 修改$u.config对象的属性 // 修改$u.config对象的属性
......
...@@ -53,12 +53,20 @@ ...@@ -53,12 +53,20 @@
"disableScroll": true "disableScroll": true
} }
}, },
{
"path": "pages/dailyReport/dailyReportHistory",
"style": {
"navigationBarTitleText": "查看日报",
"enablePullDownRefresh": false,
"disableScroll": false
}
},
{ {
"path": "pages/dailyReportCreate/dailyReportCreate", "path": "pages/dailyReportCreate/dailyReportCreate",
"style": { "style": {
"navigationBarTitleText": "填写日报", "navigationBarTitleText": "填写日报",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": false
} }
} }
], ],
...@@ -68,7 +76,7 @@ ...@@ -68,7 +76,7 @@
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarTitleText": "运匠运输管理平台", "navigationBarTitleText": "兆驰运输管理平台",
"navigationBarBackgroundColor": "#2E75E6", "navigationBarBackgroundColor": "#2E75E6",
"backgroundColor": "#fff", "backgroundColor": "#fff",
"app-plus": { "app-plus": {
......
...@@ -31,8 +31,14 @@ ...@@ -31,8 +31,14 @@
<view class="card-header"> <view class="card-header">
<view class="left"> <view class="left">
<text class="name">{{ report.reporter }}</text> <text class="name">{{ report.reporter }}</text>
<text class="status" :class="report.status==='submitted' ? 'submitted' : 'unSubmitted'"> <text v-if="report.status==='submitted'" class="status"
{{ report.status==='submitted' ? '已提交' : '未提交' }} :class="report.isOverTime==='准时' ? 'submitted' : 'unSubmitted'">
{{ report.isOverTime}}
</text>
<text v-if="report.status!=='submitted'" class="status"
:class="report.status==='submitted' ? 'submitted' : 'unSubmitted'">
{{ report.status==='submitted' ? '': '未提交' }}
</text> </text>
</view> </view>
<text class="time">{{ report.date || '-' }}</text> <text class="time">{{ report.date || '-' }}</text>
...@@ -40,19 +46,20 @@ ...@@ -40,19 +46,20 @@
<view class="card-content" v-if="report.status==='submitted'"> <view class="card-content" v-if="report.status==='submitted'">
<view class="work-item"> <view class="work-item">
<view class="work-header"> <view class="work-header">
<text class="work-title">今日重点工作</text> <text class="work-title">本周重点工作</text>
</view> </view>
<view class="work-content">{{ report.todayWork }}</view> <view class="work-content">{{ report.weekWork }}</view>
</view> </view>
<view class="work-item"> <view class="work-item">
<view class="work-header"> <view class="work-header">
<text class="work-title">本周重点工作</text> <text class="work-title">今日重点工作</text>
</view> </view>
<view class="work-content">{{ report.weekWork }}</view> <view class="work-content">{{ report.todayWork }}</view>
</view> </view>
</view> </view>
</view> </view>
<view style="height: 10vh;"></view>
<view class="search-more" @click="selectHistory()"><text class="search-more-text"> 查看更多</text></view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -85,19 +92,23 @@ ...@@ -85,19 +92,23 @@
this.onReload() this.onReload()
}, },
methods: { methods: {
selectHistory() {
uni.navigateTo({
url: '/pages/dailyReport/dailyReportHistory'
});
},
selectReport(status) { selectReport(status) {
this.searchStatus = status this.searchStatus = status
this.dailyReportList = [] this.dailyReportList = []
this.initData() this.initData()
}, },
initData() { initData() {
this.staffCode = uni.getStorageSync('staffCode'); this.staffCode = uni.getStorageSync('staffCode');
this.staffKind = uni.getStorageSync('uc_staff_kind'); this.staffKind = uni.getStorageSync('uc_staff_kind');
this.commonName = uni.getStorageSync('commonName'); this.commonName = uni.getStorageSync('commonName');
console.log("this.staffCode"+this.staffCode) console.log("this.staffCode" + this.staffCode)
console.log("this.staffKind"+this.staffKind) console.log("this.staffKind" + this.staffKind)
console.log("this.commonName"+this.commonName) console.log("this.commonName" + this.commonName)
console.log('获取到的commonName:', this.commonName); console.log('获取到的commonName:', this.commonName);
...@@ -145,11 +156,39 @@ ...@@ -145,11 +156,39 @@
</script> </script>
<style lang="scss"> <style lang="scss">
html, body { html,
height: 100%; /* 确保 html 和 body 高度为 100% */ body {
margin: 0; /* 去掉默认的 margin */ height: 100%;
overflow: hidden; /* 禁用滚动条 */ /* 确保 html 和 body 高度为 100% */
margin: 0;
/* 去掉默认的 margin */
overflow: hidden;
/* 禁用滚动条 */
}
.search-more {
height: 10vh;
display: flex;
justify-content: center;
align-items: center;
// &:hover {
// background: #e6f7ff;
// /* 鼠标悬停时的背景色 */
// transform: scale(1.05);
// /* 鼠标悬停时的放大效果 */
// }
}
.search-more-text{
color: #5500ff;
&:hover {
/* 鼠标悬停时的背景色 */
transform: scale(1.05);
/* 鼠标悬停时的放大效果 */
}
} }
.daily-report { .daily-report {
padding: 15px; padding: 15px;
background: #f5f7fa; background: #f5f7fa;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="form-container"> <view class="form-container">
<!-- 报告人 --> <!-- 报告人 -->
<view class="form-item"> <view class="form-item" v-if="staffKind==='staff'">
<text class="label"><text class="label-line"></text>汇报人</text> <text class="label"><text class="label-line"></text>汇报人</text>
<picker mode="selector" :range="reporterValues" @change="onReporterChange" class="picker"> <picker mode="selector" :range="reporterValues" @change="onReporterChange" class="picker">
<view class="picker-text">{{ selectedReporterValue || '请选择汇报人' }}</view> <view class="picker-text">{{ selectedReporterValue || '请选择汇报人' }}</view>
...@@ -17,21 +17,23 @@ ...@@ -17,21 +17,23 @@
<!-- 日期 --> <!-- 日期 -->
<view class="form-item"> <view class="form-item">
<text class="label"><text class="label-line"></text>日期</text> <text class="label"><text class="label-line"></text>日期</text>
<picker mode="date" :value="formData.date" @change="dateChange" class="picker"> <picker mode="selector" :value="formData.date" @change="dateChange" class="picker" :range="dateRange">
<view class="picker-text">{{ formData.date || '请选择日期' }}</view> <view class="picker-text">{{ formData.date || '请选择日期' }}</view>
</picker> </picker>
</view> </view>
<!-- 今日重点工作 --> <!-- 本周重点工作 -->
<view class="form-item"> <view class="form-item">
<text class="label"><text class="label-line"></text>本日重点工作</text> <text class="label"><text class="label-line"></text>本周重点工作</text>
<textarea v-model="formData.todayWork" placeholder="请输入本日重点工作内容" class="textarea" /> <u--textarea autoHeight v-model="formData.weekWork" placeholder="请输入本周重点工作内容" count
:maxlength="2000"></u--textarea>
</view> </view>
<!-- 本周重点工作 --> <!-- 今日重点工作 -->
<view class="form-item"> <view class="form-item">
<text class="label"><text class="label-line"></text>本周重点工作</text> <text class="label"><text class="label-line"></text>本日重点工作</text>
<textarea v-model="formData.weekWork" placeholder="请输入本周重点工作内容" class="textarea" /> <u--textarea autoHeight v-model="formData.todayWork" placeholder="请输入本日重点工作内容" count
:maxlength="2000"></u--textarea>
</view> </view>
<!-- 是否请假 --> <!-- 是否请假 -->
...@@ -45,15 +47,23 @@ ...@@ -45,15 +47,23 @@
<!-- 请假原因 --> <!-- 请假原因 -->
<view class="form-item"> <view class="form-item">
<text class="label"><text class="label-line"></text>请假原因</text> <text class="label"><text class="label-line"></text>请假原因</text>
<textarea v-model="formData.leaveReason" placeholder="请输入请假原因" class="textarea" <u--textarea autoHeight v-model="formData.leaveReason" placeholder="请输入请假原因"
:disabled="formData.isLeave !== '是'" :disabled="formData.isLeave !== '是'"
:style="formData.isLeave !== '是' ? 'background-color: #f5f5f5;' : ''" /> :style="formData.isLeave !== '是' ? 'background-color: #f5f5f5;' : ''" count
:maxlength="2000"></u--textarea>
</view>
<view class="form-item">
<!-- <text class="label"><text class="label-line"></text>附件上传</text> -->
<view class="uploader-img">
<bs-uploader ref="myUploadImg" uploadTitle="上传图片" />
</view>
</view> </view>
<!-- 按钮组 --> <!-- 按钮组 -->
<view class="button-group"> <view class="button-group">
<button class="back-btn" @click="goBack">返回</button> <button class="back-btn" @click="goBack">返回</button>
<button class="submit-btn" @click="submitReport">提交日报</button> <button class="submit-btn" :disabled="isSubmit" @click="submitReport">提交日报</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -62,25 +72,26 @@ ...@@ -62,25 +72,26 @@
<script> <script>
import { import {
dailyReportSave, dailyReportSave,
selectReporter selectReporter,
queryByStaffCode
} from '../../api/apiList' } from '../../api/apiList'
export default { export default {
data() { data() {
// 获取当前日期和时间并格式化 // 获取当前日期和时间并格式化
const today = new Date() // const today = new Date()
const year = today.getFullYear() // const year = today.getFullYear()
const month = String(today.getMonth() + 1).padStart(2, '0') // const month = String(today.getMonth() + 1).padStart(2, '0')
const day = String(today.getDate()).padStart(2, '0') // const day = String(today.getDate()).padStart(2, '0')
const hours = String(today.getHours()).padStart(2, '0') // const hours = String(today.getHours()).padStart(2, '0')
const minutes = String(today.getMinutes()).padStart(2, '0') // const minutes = String(today.getMinutes()).padStart(2, '0')
const seconds = String(today.getSeconds()).padStart(2, '0') // const seconds = String(today.getSeconds()).padStart(2, '0')
const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` // const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
return { return {
formData: { formData: {
reporterTo: '', reporterTo: '',
reporter: '', reporter: '',
date: formattedDate, // 使用带时间的日期格式 date: this.getTodayDate(), // 默认值为今天,
todayWork: '', todayWork: '',
weekWork: '', weekWork: '',
isLeave: '否', isLeave: '否',
...@@ -88,24 +99,82 @@ ...@@ -88,24 +99,82 @@
}, },
staffCode: "", staffCode: "",
staffKind: "", staffKind: "",
reporterToName: "",
reporterToId: "",
leaveOptions: ['是', '否'], leaveOptions: ['是', '否'],
reporterMap: {}, // key:value 形式的 map 数据 reporterMap: {}, // key:value 形式的 map 数据
reporterValues: [], // 用于 picker 的显示值 reporterValues: [], // 用于 picker 的显示值
selectedReporterValue: '' // 选中的报告人显示值 selectedReporterValue: '', // 选中的报告人显示值
dateRange: [], // 日期范围
isSubmit: false
} }
}, },
created() { created() {
this.setDateRange(); // 设置日期范围
this.queryDailyReport();
this.staffKind = uni.getStorageSync('uc_staff_kind');
if (this.staffKind === 'staff') {
this.reporterToId = uni.getStorageSync('reporterToId');
this.reporterToName = uni.getStorageSync('reporterToName');
this.selectedReporterValue = this.reporterToName; // 显示的值
// 获取对应的 key
this.formData.reporterTo = this.reporterToId
}
this.initReporter(); // 在组件创建时初始化报告人 this.initReporter(); // 在组件创建时初始化报告人
}, },
mounted() { mounted() {
// 如果 created 中没有获取到,在 mounted 中再次尝试 // 如果 created 中没有获取到,在 mounted 中再次尝试
if (!this.formData.reporter) { if (!this.formData.reporter) {
this.getCommonName(); this.getCommonName();
} }
}, },
methods: { methods: {
queryDailyReport() {
this.staffCode = uni.getStorageSync(`staffCode`);
const data = {
"aux": {
staffCode: this.staffCode
}
}
queryByStaffCode(data).then(res => {
const data = res.data.data; // 假设返回的数据在这个路径
if (data) {
this.formData.weekWork = data.weekWork
// this.formData.todayWork = data.todayWork
}
}).catch(err => {
console.error('获取报告人失败:', err);
});
},
getTodayDate() {
const today = new Date();
return this.formatDate(today);
},
getYesterdayDate() {
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
return this.formatDate(yesterday);
},
formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`; // 格式化为 YYYY-MM-DD
},
setDateRange() {
this.dateRange = [this.getYesterdayDate(), this.getTodayDate()]; // 设置为昨天和今天
console.log(JSON.stringify(this.dateRange))
},
dateChange(e) {
// const selectedDate = e.detail.value;
// const currentTime = this.formData.date.split(' ')[1] || '00:00:00';
// this.formData.date = `${selectedDate} ${currentTime}`;
this.formData.date = this.dateRange[e.detail.value]; // 更新选择的日期
},
initReporter() { initReporter() {
this.staffKind = uni.getStorageSync('uc_staff_kind');
const data = { const data = {
"aux": { "aux": {
staffKind: this.staffKind staffKind: this.staffKind
...@@ -141,11 +210,11 @@ ...@@ -141,11 +210,11 @@
// 获取对应的 key // 获取对应的 key
this.formData.reporterTo = Object.keys(this.reporterMap)[selectedIndex]; // 存储的值为 key this.formData.reporterTo = Object.keys(this.reporterMap)[selectedIndex]; // 存储的值为 key
}, },
dateChange(e) { // dateChange(e) {
const selectedDate = e.detail.value; // const selectedDate = e.detail.value;
const currentTime = this.formData.date.split(' ')[1] || '00:00:00'; // const currentTime = this.formData.date.split(' ')[1] || '00:00:00';
this.formData.date = `${selectedDate} ${currentTime}`; // this.formData.date = `${selectedDate} ${currentTime}`;
}, // },
leaveChange(e) { leaveChange(e) {
this.formData.isLeave = this.leaveOptions[e.detail.value] this.formData.isLeave = this.leaveOptions[e.detail.value]
if (this.formData.isLeave === '否') { if (this.formData.isLeave === '否') {
...@@ -168,9 +237,40 @@ ...@@ -168,9 +237,40 @@
}) })
return return
} }
console.log("this.formData.date:" + this.formData.date)
if (this.formData.date === undefined || this.formData.date === '' || this.formData.date === null) {
uni.showToast({
title: '请选择日期',
icon: 'none'
})
return
}
this.staffCode = uni.getStorageSync(`staffCode`); this.staffCode = uni.getStorageSync(`staffCode`);
const yesterdayDate = this.getYesterdayDate();
var isOverTime
if (yesterdayDate === this.formData.date) {
// 获取当前日期和时间并格式化
const today = new Date()
const hours = String(today.getHours()).padStart(2, '0')
if (hours >= 9) {
isOverTime = "超时";
}
} else {
isOverTime = "准时";
}
const imgInstance = this.$refs.myUploadImg
uni.showModal({
title: "提示",
content: "是否提交日报?",
showCancel: true,
cancelText: '取消',
confirmText: '确定',
success: res => {
this.isSubmit = true
imgInstance.uploadImage(images => {
console.log("上传图片" + images)
const data = { const data = {
"aux": { "aux": {
reporter: this.formData.reporter, reporter: this.formData.reporter,
...@@ -180,7 +280,9 @@ ...@@ -180,7 +280,9 @@
weekWork: this.formData.weekWork, weekWork: this.formData.weekWork,
isLeave: this.formData.isLeave, isLeave: this.formData.isLeave,
leaveReason: this.formData.leaveReason, leaveReason: this.formData.leaveReason,
staffCode: this.staffCode staffCode: this.staffCode,
isOverTime: isOverTime,
files: images
} }
} }
console.log('提交的日报数据:', data) console.log('提交的日报数据:', data)
...@@ -191,22 +293,29 @@ ...@@ -191,22 +293,29 @@
title: '保存成功', title: '保存成功',
icon: 'success', icon: 'success',
duration: 2000, duration: 2000,
mask:true,
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
uni.$emit('executeChoiceItem', 'dailyReportList'); // uni.$emit(
// 'executeChoiceItem',
// 'dailyReport');
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/index' url: "/pages/index/index?currentShow='dailyReport'"
}); });
}, 1500) // 等待提示显示 1.5 秒后返回 }, 1000) // 等待提示显示 1.5 秒后返回
} }
}) })
} }
}) })
this.isSubmit=false
})
}
})
}, },
goBack() { goBack() {
uni.$emit('executeChoiceItem', 'dailyReport'); uni.$emit('executeChoiceItem', 'dailyReport');
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/index' url: "/pages/index/index?currentShow='dailyReport'"
}); });
} }
} }
......
...@@ -9,15 +9,23 @@ ...@@ -9,15 +9,23 @@
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view v-if="currentShow === 'orderQuery'">
<orderQueryContent></orderQueryContent>
</view>
<view v-if="currentShow === 'orderCreate'">
<scroll-view scroll-y="true" style="height: calc(100vh - 50px);">
<orderInsertContent></orderInsertContent>
</scroll-view>
</view>
<view v-if="currentShow === 'bossCard' && uc_staff_kind!==''"> <view v-if=" currentShow==='bossCard' && uc_staff_kind!==''">
<bossCard></bossCard> <bossCard></bossCard>
</view> </view>
<!-- <view v-if="currentShow === 'dailyReportCreate' && uc_staff_kind!=='boss'"> <!-- <view v-if=" currentShow==='dailyReportCreate' && uc_staff_kind!=='boss'">
<dailyReportCreate></dailyReportCreate> <dailyReportCreate></dailyReportCreate>
</view> --> </view> -->
<view v-if="currentShow === 'dailyReport'"> <view v-if=" currentShow==='dailyReport'">
<dailyReportList></dailyReportList> <dailyReportList></dailyReportList>
</view> </view>
</view> </view>
...@@ -50,23 +58,24 @@ ...@@ -50,23 +58,24 @@
topUserList: [], topUserList: [],
} }
}, },
onLoad() { onLoad(o) {
this.uc_staff_kind = uni.getStorageSync(`uc_staff_kind`); this.uc_staff_kind = uni.getStorageSync(`uc_staff_kind`);
this.updateTopUserList() this.updateTopUserList(o.currentShow)
},
onShow() {
uni.$on('executeChoiceItem', (component) => {
console.log('收到切换组件事件:', component); // 调试日志
this.choiceItem(component);
});
},
onUnload() {
uni.$off('executeChoiceItem');
}, },
//onShow() {
// uni.$on('executeChoiceItem', (component)=> {
// console.log('收到切换组件事件:', component); // 调试日志
// this.choiceItem(component);
// });
// },
// onUnload() {
// uni.$off('executeChoiceItem');
// },
methods: { methods: {
updateTopUserList() { updateTopUserList(o) {
if (this.uc_staff_kind === 'boss') { if (this.uc_staff_kind === 'President' || this.uc_staff_kind === 'VicePresident' ||
this.uc_staff_kind === 'PresidentHelp' || this.uc_staff_kind === 'Leader') {
this.currentShow = 'bossCard' this.currentShow = 'bossCard'
this.topUserList = [{ this.topUserList = [{
name: '运营监控', name: '运营监控',
...@@ -74,15 +83,20 @@ ...@@ -74,15 +83,20 @@
url: '/pages/index/index' url: '/pages/index/index'
}, },
]; ];
} else if (this.uc_staff_kind === 'simulatedBoss') { } else if (this.uc_staff_kind === 'simulatedBoss') {
if (o) {
this.currentShow = 'dailyReport' this.currentShow = 'dailyReport'
} else {
this.currentShow = 'bossCard'
}
this.topUserList = [{ this.topUserList = [{
name: '运营监控', name: '运营监控',
key: 'bossCard', key: 'bossCard',
url: '/pages/index/index' url: '/pages/index/index'
}, { }, {
name: '查看日报', name: '个人日报',
key: 'dailyReport', key: 'dailyReport',
url: '/pages/index/index' url: '/pages/index/index'
}, },
...@@ -91,10 +105,20 @@ ...@@ -91,10 +105,20 @@
} else { } else {
this.currentShow = 'dailyReport' this.currentShow = 'dailyReport'
this.topUserList = [{ this.topUserList = [{
name: '查看日报', name: '个人日报',
key: 'dailyReport', key: 'dailyReport',
url: '/pages/index/index' url: '/pages/index/index'
}, ] },
{
name: '订单查询',
key: 'orderQuery',
url: '/pages/index/index'
}, {
name: '订单创建',
key: 'orderCreate',
url: '/pages/index/index'
},
]
} }
}, },
...@@ -208,11 +232,13 @@ ...@@ -208,11 +232,13 @@
userId: item.userId userId: item.userId
} }
}).then(res => { }).then(res => {
console.log('7777777', item, item.userId) console.log('7777777', item, item
.userId)
if (res.data.data.isCarrier) { if (res.data.data.isCarrier) {
this.isCarrier = true; this.isCarrier = true;
this.currentShow = "wayBillQuery"; this.currentShow = "wayBillQuery";
uni.setStorageSync("companyId", res.data uni.setStorageSync("companyId", res
.data
.data.company) .data.company)
} }
}) })
......
<template> <template>
<view class="content_box flex_col" :style="{ backgroundImage: `url(${loginBg})` }"> <view class="content_box flex_col" :style="{ backgroundImage: `url(${loginBg})` }">
<view class="primary-description">
<!-- <view class="container-title flex_cen">TMS运输管理系统</view>
<view class="container-subTitle flex_cen">兆驰供应链</view>
-->
</view>
<!-- 用户信息录入 --> <!-- 用户信息录入 -->
<view class="user-info flex_center"> <view class="user-info flex_center">
<u-form :model="formData" ref="myForm" errorType='tost'> <u-form :model="formData" ref="myForm" errorType='tost'>
<template> <template>
<u-form-item prop="userName"> <u-form-item prop="userName">
<u-input type="text" v-model="formData.userName" placeholder="请输入账号" /> <u-input type="text" v-model="formData.userName" placeholder="请输入账号" />
...@@ -26,7 +20,7 @@ ...@@ -26,7 +20,7 @@
<u-checkbox-group placement="column" @change="onChanges"> <u-checkbox-group placement="column" @change="onChanges">
<u-checkbox :checked="isChecked" iconSize="30rpx" shape="square" size="20spx" /> <u-checkbox :checked="isChecked" iconSize="30rpx" shape="square" size="20spx" />
</u-checkbox-group> </u-checkbox-group>
<text style="color: #d5d5d6;font-size: 18px;">记住密码</text> <text style="color: black;font-size: 18px;">记住密码</text>
</view> </view>
</view> </view>
...@@ -90,11 +84,11 @@ ...@@ -90,11 +84,11 @@
if (isMobile) { if (isMobile) {
console.log("当前设备为手机或平板"); console.log("当前设备为手机或平板");
// 在这里执行手机端的逻辑 // 在这里执行手机端的逻辑
this.loginBg = 'static/img/bg/souye-bg.jpg' this.loginBg = 'static/img/bg/top.png'
} else { } else {
console.log("当前设备为电脑"); console.log("当前设备为电脑");
// 在这里执行电脑端的逻辑 // 在这里执行电脑端的逻辑
this.loginBg = 'static/img/bg/loginBg.png' this.loginBg = 'static/img/bg/top.png'
} }
this.projectMini = getApp().globalData.projectMini this.projectMini = getApp().globalData.projectMini
...@@ -258,6 +252,8 @@ ...@@ -258,6 +252,8 @@
let data2 = res.data.data let data2 = res.data.data
uni.setStorageSync(`staffCode`, data2.staffCode); uni.setStorageSync(`staffCode`, data2.staffCode);
uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind); uni.setStorageSync(`uc_staff_kind`, data2.uc_staff_kind);
uni.setStorageSync(`reporterToName`, data2.reporterToName);
uni.setStorageSync(`reporterToId`, data2.reporterToId);
uni.redirectTo({ uni.redirectTo({
url: "/pages/index/index", url: "/pages/index/index",
}) })
...@@ -298,9 +294,9 @@ ...@@ -298,9 +294,9 @@
height: 100vh; height: 100vh;
color: #FFFFFF; color: #FFFFFF;
letter-spacing: 6rpx; letter-spacing: 6rpx;
background-size: 100% 100%; background-size: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
padding: 0 32rpx; padding: 140px 16px;
justify-content: space-between; justify-content: space-between;
...@@ -336,13 +332,13 @@ ...@@ -336,13 +332,13 @@
margin-top: 212rpx; margin-top: 212rpx;
/* #endif */ /* #endif */
/* #ifdef H5 || APP-PLUS*/ /* #ifdef H5 || APP-PLUS*/
margin-top: 160rpx; margin-top: 30px;
/* #endif */ /* #endif */
color: #FFFFFF; color: black;
font-size: 32rpx; font-size: 32rpx;
font-weight: bolder; font-weight: bolder;
border-radius: 48rpx; // border-radius: 48rpx;
background: linear-gradient(90deg, #2E75E6 0%, #5E58EE 100%); background: linear-gradient(90deg, #FCC800 0%, #FCC800 100%);
border: none !important; border: none !important;
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -4,11 +4,6 @@ ...@@ -4,11 +4,6 @@
2. 打包生产模式: 小程序切换url; H5切换ENV_MODEL 2. 打包生产模式: 小程序切换url; H5切换ENV_MODEL
*/ */
let BASEURL = { let BASEURL = {
// url: "https://miniapp.logwirecloud.com", //TMS
// url: 'http://122.9.90.247:8092' //YMS
// url: 'http://192.168.1.199:7080' //唐浩然
// url: 'http://192.168.0.230:8080' // xiaohan
// url: "https://botms-demo.logwirecloud.com",
// url: "http://localhost:8083", //开发 // url: "http://localhost:8083", //开发
// url: "http://122.112.220.204:8089", //开发 // url: "http://122.112.220.204:8089", //开发
url: "https://stms.bjzc-scs.com", //生产 url: "https://stms.bjzc-scs.com", //生产
......
...@@ -89,10 +89,20 @@ function deepCopy(obj) { ...@@ -89,10 +89,20 @@ function deepCopy(obj) {
return obj; return obj;
} }
} }
const dateTransformYMDhms = (date)=>{
const Y = date.getFullYear()
const M = date.getMonth() + 1
const D = date.getDate()
const h = date.getHours()
const m = date.getMinutes()
const s = date.getSeconds()
return {Y,M,D,h,m,s}
}
module.exports = { module.exports = {
formatTime, formatTime,
getImgBase64, getImgBase64,
formatGMT, formatGMT,
deepCopy deepCopy,
dateTransformYMDhms
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment