Commit fe4f38f9 by 张立顺

feat 权益下单配置功能开发

1 parent d95fea61
...@@ -97,3 +97,15 @@ export function getResidentStaffList(data) { ...@@ -97,3 +97,15 @@ export function getResidentStaffList(data) {
data.method = `${path}merchant.staff.list` data.method = `${path}merchant.staff.list`
return request(data, "post") return request(data, "post")
} }
// 查询门店录单设置
export function orderFieldSettingList(data) {
data.method = `${path}order.field.setting.list`
return request(data, "post")
}
// 更新门店录单设置
export function orderFieldSettingUpdate(data) {
data.method = `${path}order.field.setting.update`
return request(data, "post")
}
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
v-model="formData[item.prop]" v-model="formData[item.prop]"
@change="changeType()" @change="changeType()"
> >
<el-radio :label="1">必填</el-radio> <el-radio :label="true">必填</el-radio>
<el-radio :label="0">非必填</el-radio> <el-radio :label="false">非必填</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</template> </template>
...@@ -48,57 +48,110 @@ ...@@ -48,57 +48,110 @@
</template> </template>
<script> <script>
import {
orderFieldSettingList,
orderFieldSettingUpdate
} from "@/api/shopConfig.js"
export default { export default {
name: "EquitySet", name: "EquitySet",
data() { data() {
return { return {
settingInfo: [],
formData: { formData: {
carType: 0, carBrand: false,
vin: 0, carNo: false,
idCardNum: 0 idNumber: false
}, },
rules: { rules: {
carType: [ carBrand: [
{ required: true, message: "请选择车型:", trigger: "change" } { required: true, message: "请选择车型:", trigger: "change" }
], ],
vin: [ carNo: [
{ required: true, message: "请车架号(VIN)码:", trigger: "change" } { required: true, message: "请车架号(VIN)码:", trigger: "change" }
], ],
idCardNum: [ idNumber: [
{ required: true, message: "请证件号码:", trigger: "change" } { required: true, message: "请证件号码:", trigger: "change" }
] ]
}, },
formList: [ formList: [
{ {
name: "选择车型:", name: "选择车型:",
prop: "carType" prop: "carBrand"
}, },
{ {
name: "车架号(VIN)码:", name: "车架号(VIN)码:",
prop: "vin" prop: "carNo"
}, },
{ {
name: "证件号码:", name: "证件号码:",
prop: "idCardNum" prop: "idNumber"
} }
] ]
} }
}, },
computed: {
merchantId() {
const info = JSON.parse(this.$route.query.info)
return info.merchantId
},
merchantName() {
const info = JSON.parse(this.$route.query.info)
return info.merchantName
}
},
props: {}, props: {},
mounted(){ mounted() {
console.log(this.$route, this.merchantId)
this.getEquitySet()
}, },
methods: { methods: {
getEquitySet() {
orderFieldSettingList({
merchantId: this.merchantId,
scene: 0
})
.then((res) => {
console.log(res)
res.map((item) => {
this.formData[item.fieldKey] = item.isRequired
})
this.settingInfo = res
// formData
console.log(this.formData)
})
.catch((err) => {
console.log(err)
})
},
changeType(e) {}, changeType(e) {},
comfirm() { comfirm() {
console.log(this.formData) console.log(this.formData)
const settings = this.settingInfo.map((item) => {
item.isRequired = this.formData[item.fieldKey]
return item
})
const params = {
merchantId: this.merchantId,
scene: 0,
merchantName: this.merchantName,
settings
}
console.log(params, "params")
orderFieldSettingUpdate(params)
.then((res) => {
this.notice.okTips("操作成功")
this.cancel()
console.log(res)
})
.catch((err) => {
console.log(err)
})
}, },
cancel() { cancel() {
this.$router.push({ this.$router.push({
name: "shopConfig", name: "shopConfig",
params: { params: {
activeName: 'equitySetting' activeName: "equitySetting"
} }
}) })
this.close({ tagName: "/setWorkorderDetail" }) this.close({ tagName: "/setWorkorderDetail" })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!