|
|
@@ -26,9 +26,15 @@
|
|
|
|
|
|
</CellGroup>
|
|
|
</div>
|
|
|
+ <Form ref="formRef" class="g-form__container" @submit="toConfirm">
|
|
|
+ <Dialog :title="dialogTitle" v-model:show="show" show-cancel-button @confirm ="toConfirm" @cancel="show=false">
|
|
|
+ <Field name="DelayDays" v-model="formData.delaydays" type="number" v-if="showDays" label="延期天数" :rules="formRules.delaydays" placeholder="请输入延期天数" />
|
|
|
+ <Field name="Remark" label="备注" v-model="remark" :rules="formRules.remark" placeholder="请输入备注信息" />
|
|
|
+ </Dialog>
|
|
|
+ </Form>
|
|
|
<template #footer>
|
|
|
- <Button type="danger" block round @click="delay">延期申请</Button>
|
|
|
- <Button type="info" block round @click="confirm">立即执行</Button>
|
|
|
+ <Button type="primary" v-if="selectedRow.buyorsell===selectedRow.executeside-1" block round @click="showConfirm(true)">延期申请</Button>
|
|
|
+ <Button type="warning" v-if="selectedRow.buyorsell===selectedRow.executeside-1" block round @click="showConfirm(false)">立即执行</Button>
|
|
|
</template>
|
|
|
</app-view>
|
|
|
</app-modal>
|
|
|
@@ -36,8 +42,8 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, PropType } from 'vue'
|
|
|
-import { CellGroup, Cell, Button } from 'vant'
|
|
|
-import { dialog, fullloading } from '@/utils/vant'
|
|
|
+import { CellGroup, Cell, Button, Dialog, Field, FieldRule, Form, FormInstance } from 'vant'
|
|
|
+import { fullloading } from '@/utils/vant'
|
|
|
import { formatDate, formatDecimal } from '@/filters'
|
|
|
import { usePerformanceDelayApply, usePerformanceManualConfirm } from '@/business/performance'
|
|
|
import { queryWrPerformancePlanStep } from '@/services/api/performance'
|
|
|
@@ -48,7 +54,8 @@ import { useRequest } from '@/hooks/request'
|
|
|
const showModal = shallowRef(true)
|
|
|
// 是否刷新父组件数据
|
|
|
const refresh = shallowRef(false)
|
|
|
-const { formData, formSubmit } = usePerformanceDelayApply()
|
|
|
+const { formData, formSubmit} = usePerformanceDelayApply()
|
|
|
+const formRef = shallowRef<FormInstance>()
|
|
|
|
|
|
const props = defineProps({
|
|
|
selectedRow: {
|
|
|
@@ -60,6 +67,22 @@ const props = defineProps({
|
|
|
const { confirmFormData, confirmSubmit } = usePerformanceManualConfirm(props.selectedRow.buyaccountid)
|
|
|
const datelist = shallowRef<Model.WrPerformancePlanStep[]>([])
|
|
|
const error = shallowRef(false)
|
|
|
+const show = shallowRef(false)
|
|
|
+const showDays = shallowRef(false)
|
|
|
+const remark = shallowRef('')
|
|
|
+const dialogTitle = shallowRef('是否要手动执行步骤?')
|
|
|
+
|
|
|
+// 表单验证规则
|
|
|
+const formRules: { [key in keyof Proto.PerformanceDelayApplyReq | 'remark' ]?: FieldRule[] } = {
|
|
|
+ delaydays: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入延期天数'
|
|
|
+ }],
|
|
|
+ remark: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入备注信息'
|
|
|
+ }],
|
|
|
+}
|
|
|
|
|
|
const { loading } = useRequest(queryWrPerformancePlanStep, {
|
|
|
params: {
|
|
|
@@ -73,14 +96,19 @@ const { loading } = useRequest(queryWrPerformancePlanStep, {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const delay = () => {
|
|
|
- dialog({
|
|
|
- message: '确认要延期申请吗?',
|
|
|
- showCancelButton: true,
|
|
|
- }).then(() => {
|
|
|
- /// 市场ID
|
|
|
- formData.value.PerformancePlanStepID = Number(props.selectedRow.curstepid)
|
|
|
+const showConfirm = (showDelay: boolean) => {
|
|
|
+ dialogTitle.value = showDelay ? '确定要延期申请吗?' : '是否要手动执行步骤?'
|
|
|
+ showDays.value = showDelay
|
|
|
+ show.value = true
|
|
|
+}
|
|
|
|
|
|
+const toConfirm = () => {
|
|
|
+ const { curstepid } = props.selectedRow
|
|
|
+ console.log(props.selectedRow)
|
|
|
+ if (showDays.value === true) { /// 延期
|
|
|
+ /// 市场ID
|
|
|
+ formData.value.PerformancePlanStepID = curstepid
|
|
|
+ formData.value.applyremark = remark.value
|
|
|
/// loding....
|
|
|
fullloading((hideLoading) => {
|
|
|
formSubmit().then(() => {
|
|
|
@@ -90,16 +118,10 @@ const delay = () => {
|
|
|
hideLoading(err, 'fail')
|
|
|
})
|
|
|
})
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const confirm = () => {
|
|
|
- dialog({
|
|
|
- message: '确认要立即执行吗?',
|
|
|
- showCancelButton: true,
|
|
|
- }).then(() => {
|
|
|
+ } else { /// 手动确认
|
|
|
/// PerformancePlanStepID
|
|
|
- confirmFormData.value.PerformancePlanStepID = Number(props.selectedRow.curstepid)
|
|
|
+ confirmFormData.value.PerformancePlanStepID = curstepid
|
|
|
+ confirmFormData.value.StepRemark = remark.value
|
|
|
/// loding....
|
|
|
fullloading((hideLoading) => {
|
|
|
confirmSubmit().then(() => {
|
|
|
@@ -109,7 +131,7 @@ const confirm = () => {
|
|
|
hideLoading(err, 'fail')
|
|
|
})
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// 关闭弹窗
|