Commit 1dc967e8 by 李伟康

```

feat(coupons): 更新预约对话框中的交通有效性选择逻辑

- 为 `el-select` 组件添加 `:disabled` 属性,根据订单状态控制是否可编辑
- 新增计算属性 `trafficEffectivenessDisabled`,在订单处于已支付、已施工、已失效等状态时禁用选择
- 调整 `trafficEffectivenessOpt` 配置项中 `confId` 类型为数字
- 优化 `inviteDatePush` 方法,支持从 `paramsObj` 中读取 `trafficEffectiveness` 并赋值
- 初始化 `trafficEffectiveness` 默认值为空字符串
```
1 parent c5a3ad27
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
v-model="infoForm.trafficEffectiveness" v-model="infoForm.trafficEffectiveness"
placeholder="请选择" placeholder="请选择"
class="select-width" class="select-width"
:disabled="trafficEffectivenessDisabled"
> >
<el-option <el-option
v-for="(item, key) in trafficEffectivenessOpt" v-for="(item, key) in trafficEffectivenessOpt"
:key="key" :key="key"
:label="item.confValue" :label="item.confValue"
:value="item.confId" :value="item.confId"
:disabled="item.disabled"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -117,6 +117,11 @@ export default { ...@@ -117,6 +117,11 @@ export default {
set (val) { set (val) {
this.$emit('dialogClose', { flag: val }) this.$emit('dialogClose', { flag: val })
} }
},
trafficEffectivenessDisabled () {
let { orderStatus } = this.paramsObj
//已支付4、已施工、已失效11、已撤销9、已评价6、已关闭10、战败2 不支持编辑
return [4, 11, 9, 6, 10, 2].includes(orderStatus)
} }
}, },
mounted () { mounted () {
...@@ -182,15 +187,17 @@ export default { ...@@ -182,15 +187,17 @@ export default {
{ confId: '16:00', confValue: '16:00', disabled: false } { confId: '16:00', confValue: '16:00', disabled: false }
], ],
trafficEffectivenessOpt: [ trafficEffectivenessOpt: [
{ confId: "1", confValue: "有效客户" }, { confId: 1, confValue: "有效客户" },
{ confId: "2", confValue: "无效客户" }, { confId: 2, confValue: "无效客户" },
], ],
} }
}, },
methods: { methods: {
inviteDatePush () { inviteDatePush () {
if (this.paramsObj.inviteDate) { let { trafficEffectiveness, inviteDate } = this.paramsObj
const dateTimeStr = dayjs(this.paramsObj.inviteDate).format('YYYY-MM-DD HH:mm:ss') if (trafficEffectiveness) this.infoForm.trafficEffectiveness = trafficEffectiveness
if (inviteDate) {
const dateTimeStr = dayjs(inviteDate).format('YYYY-MM-DD HH:mm:ss')
// 截取年月日(空格前) // 截取年月日(空格前)
this.infoForm.dateTime = dateTimeStr.split(' ')[0] this.infoForm.dateTime = dateTimeStr.split(' ')[0]
......
...@@ -337,7 +337,7 @@ export default { ...@@ -337,7 +337,7 @@ export default {
toShopDate: '', toShopDate: '',
merchantId: '', merchantId: '',
inviteMode: '', inviteMode: '',
trafficEffectiveness: '0' trafficEffectiveness: ''
} }
this.$refs.recordListTable.refreshTable() this.$refs.recordListTable.refreshTable()
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!