|
|
@@ -36,6 +36,22 @@
|
|
|
</picker>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- 履约佣金 -->
|
|
|
+ <view class="form-section">
|
|
|
+ <view class="section-label">
|
|
|
+ <text class="label-text">履约佣金(元)</text>
|
|
|
+ <text class="required">*</text>
|
|
|
+ </view>
|
|
|
+ <view class="input-box">
|
|
|
+ <input
|
|
|
+ class="content-input"
|
|
|
+ type="digit"
|
|
|
+ v-model="fulfillmentCommissionYuan"
|
|
|
+ placeholder="请输入新的履约佣金..."
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<!-- 上传凭证 -->
|
|
|
<view class="form-section">
|
|
|
<view class="section-label">
|
|
|
@@ -94,13 +110,14 @@ export default {
|
|
|
serviceIndex: -1,
|
|
|
imageList: [],
|
|
|
imageOssIds: [],
|
|
|
- description: ''
|
|
|
+ description: '',
|
|
|
+ fulfillmentCommissionYuan: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
isReady() {
|
|
|
- // 必须要选服务且上传了至少一张图片
|
|
|
- return this.serviceIndex !== -1 && this.imageList.length > 0;
|
|
|
+ // 必须要选服务且上传了至少一张图片,并且填写了佣金
|
|
|
+ return this.serviceIndex !== -1 && this.imageList.length > 0 && this.fulfillmentCommissionYuan !== '';
|
|
|
}
|
|
|
},
|
|
|
async onLoad(options) {
|
|
|
@@ -135,6 +152,13 @@ export default {
|
|
|
},
|
|
|
onServiceChange(e) {
|
|
|
this.serviceIndex = e.detail.value;
|
|
|
+ const selectedService = this.serviceOptions[this.serviceIndex];
|
|
|
+ // 当选择服务时,自动填充其默认的履约佣金,并转化为元显示
|
|
|
+ if (selectedService && selectedService.fulfillmentCommission != null) {
|
|
|
+ this.fulfillmentCommissionYuan = (selectedService.fulfillmentCommission / 100).toFixed(2);
|
|
|
+ } else {
|
|
|
+ this.fulfillmentCommissionYuan = '';
|
|
|
+ }
|
|
|
},
|
|
|
chooseImage() {
|
|
|
uni.chooseImage({
|
|
|
@@ -175,6 +199,8 @@ export default {
|
|
|
if (!this.isReady) {
|
|
|
if (this.serviceIndex === -1) {
|
|
|
uni.showToast({ title: '请先选择服务项', icon: 'none' });
|
|
|
+ } else if (this.fulfillmentCommissionYuan === '') {
|
|
|
+ uni.showToast({ title: '请输入履约佣金', icon: 'none' });
|
|
|
} else if (this.imageList.length === 0) {
|
|
|
uni.showToast({ title: '请上传至少一张凭证', icon: 'none' });
|
|
|
}
|
|
|
@@ -188,12 +214,12 @@ export default {
|
|
|
const nowStr = this.formatNow();
|
|
|
|
|
|
// 构造完整 JSON 入参
|
|
|
+ const cents = Math.round(parseFloat(this.fulfillmentCommissionYuan) * 100) || 0;
|
|
|
const data = {
|
|
|
- "id": 0,
|
|
|
"orderId": this.orderId, // 保留原始类型(通常为 string 或 number)
|
|
|
"service": selectedService.id,
|
|
|
"photos": this.imageOssIds.join(','),
|
|
|
- "fulfillmentCommission": selectedService.fulfillmentCommission || 0,
|
|
|
+ "fulfillmentCommission": cents,
|
|
|
"reason": this.description || '无详细备注',
|
|
|
"createDept": 0,
|
|
|
"createBy": 0,
|
|
|
@@ -370,6 +396,23 @@ page {
|
|
|
opacity: 0.3;
|
|
|
}
|
|
|
|
|
|
+/* 输入框 */
|
|
|
+.input-box {
|
|
|
+ background-color: #F8F9FA;
|
|
|
+ height: 96rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border: 1px solid #EEEEEE;
|
|
|
+}
|
|
|
+
|
|
|
+.content-input {
|
|
|
+ width: 100%;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+}
|
|
|
+
|
|
|
/* 图片上传网格 */
|
|
|
.upload-grid {
|
|
|
display: flex;
|