|
@@ -0,0 +1,128 @@
|
|
|
+<!-- 委外 -->
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="my-title">委外</div>
|
|
|
+ <!-- 表单 -->
|
|
|
+ <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="类别" prop="commissionType">
|
|
|
+ <el-select
|
|
|
+ v-model="dataForm.commissionType"
|
|
|
+ remote
|
|
|
+ placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionsType"
|
|
|
+ :key="item.code"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.code">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="要求说明" prop="specificationExplian">
|
|
|
+ <el-input v-model="dataForm.specificationExplian" placeholder="要求说明"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="委外数量" prop="cnt">
|
|
|
+ <el-input-number v-model="dataForm.cnt" :step="1" :min="0"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="单位" prop="unitName">
|
|
|
+ <el-input v-model="dataForm.unitName" placeholder="单位单位"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="my-row">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="备注" prop="notes">
|
|
|
+ <el-input type="textarea" v-model="dataForm.notes"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="onChose">取消</el-button>
|
|
|
+ <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {commission} from '@/api/production'
|
|
|
+import MaterialComponent from '@/views/modules/common/material-component'
|
|
|
+import {getDictList} from '@/api/dict'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'scheduling-commission',
|
|
|
+ components: {
|
|
|
+ MaterialComponent
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ id: 0,
|
|
|
+ dataForm: {},
|
|
|
+ optionsType: [], // 类别
|
|
|
+ dataRule: {
|
|
|
+ cnt: [{ required: true, message: '请输入数量', trigger: 'change' }],
|
|
|
+ unitName: [{ required: true, message: '请输入单位', trigger: 'blur' }],
|
|
|
+ commissionType: [{ required: true, message: '请选择类别', trigger: 'change' }],
|
|
|
+ specificationExplian: [{ required: true, message: '请输入要求说明', trigger: 'blur' }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getType()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onChose () {
|
|
|
+ this.$emit('onChose')
|
|
|
+ },
|
|
|
+ async init (row) {
|
|
|
+ this.dataForm.id = row.id
|
|
|
+ },
|
|
|
+ validateField (type) {
|
|
|
+ this.$refs.dataForm.validateField(type)
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
+ dataFormSubmit () {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ commission(this.dataForm).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.onChose()
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取类别
|
|
|
+ getType () {
|
|
|
+ getDictList({type: 'commission_type'}).then(({data}) => {
|
|
|
+ if (data) {
|
|
|
+ this.optionsType = data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|