123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <template>
- <a-modal
- title="转派"
- :width="800"
- :visible="visible"
- :confirmLoading="confirmLoading"
- @cancel="handleCancel"
- >
- <a-form :form="form">
- <a-form-item>
- <a-input v-decorator="['id']" type="hidden"/>
- </a-form-item>
- <a-form-item
- label="要求时间"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input-number
- :min="0"
- :formatter="value => `${value}小时`"
- :parser="value => value.replace('小时', '')"
- v-decorator="['requireHour', {rules: [{required: true, message: '要求时间不能为空'}]}]"/>
- </a-form-item>
- </a-form>
- <template slot="footer">
- <a-button :loading="confirmLoading" type="primary" @click="save()">提交</a-button>
- </template>
- </a-modal>
- </template>
- <script>
- import pick from 'lodash.pick'
- import { getQueryUser } from '@/api/fill/gather'
- import { pauseFillGatherTask } from '@/api/fill/task'
- import RowList from '@/components/custom/RowList.vue'
- export default {
- components: { RowList },
- name: 'BaseFillGather',
- data () {
- return {
- confirmLoading: false,
- form: this.$form.createForm(this),
- visible: false,
- // 下拉框map
- ipqcMap: {}
- }
- },
- created () {
- this.getUser()
- },
- methods: {
- base (record) {
- console.log(record)
- this.visible = true
- const { form: { setFieldsValue } } = this
- // 日期处理
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'id'
- ])))
- })
- },
- getUser () {
- getQueryUser(this.DictCache.VALUE.QUERY_ROLE_TYPE.IPQC).then(res => {
- this.ipqcMap = res.data
- })
- },
- save () {
- const { form: { validateFieldsAndScroll } } = this
- this.confirmLoading = true
- validateFieldsAndScroll((errors, values) => {
- if (errors) {
- this.confirmLoading = false
- return
- }
- values.pauseType = 2
- console.log(values)
- pauseFillGatherTask(values).then(res => {
- this.handleCancel()
- })
- // 日期处理
- })
- },
- handleCancel () {
- this.visible = false
- this.$emit('ok')
- }
- }
- }
- </script>
- <style lang="less" scoped>
- </style>
|