New file |
| | |
| | | <template> |
| | | <div> |
| | | <a-form :form="form"> |
| | | <a-row :gutter="12"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="工单标题"> |
| | | <a-input |
| | | v-decorator="[ |
| | | 'title', |
| | | { |
| | | initialValue: title, |
| | | rules: [{ required: true, message: '请输入工单标题!' }], |
| | | }, |
| | | ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="审核人"> |
| | | <a-select |
| | | show-search |
| | | v-decorator="[ |
| | | 'nextUserName', |
| | | { |
| | | initialValue: '', |
| | | rules: [{ required: true, message: '请选择审核人' }], |
| | | }, |
| | | ]" |
| | | placeholder="请选择审核人" |
| | | > |
| | | <a-select-option |
| | | v-for="(item, key) in userList" |
| | | :key="'key' + key" |
| | | :value="item.name" |
| | | > |
| | | {{ item.name }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-item label="工单描述"> |
| | | <a-textarea |
| | | v-decorator="[ |
| | | 'description', |
| | | { |
| | | initialValue: '', |
| | | rules: [{ required: false, message: '请输入工单描述' }], |
| | | }, |
| | | ]" |
| | | placeholder="请输入图纸描述" |
| | | :rows="4" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | <div class="modal-footer"> |
| | | <a-button type="primary" @click="handleSubmit"> 提交审核 </a-button> |
| | | <a-button style="margin-left: 8px" type="danger" @click="cancel"> |
| | | 返回 |
| | | </a-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { deleteComponent } from "./apis"; |
| | | import const_work_level from "@/assets/js/const/const_work_level"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | name: "SubmitForm", |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default() { |
| | | return []; |
| | | }, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | form: this.$form.createForm(this, { name: "submitForm" }), |
| | | userList: [], |
| | | levels: const_work_level, |
| | | formData: { |
| | | title: "", // 工单标题 |
| | | nextUser: "", // 下一个处理人 |
| | | level: 3, // 工单等级 |
| | | dealDesc: "", // 提交人描述 |
| | | description: "", // 工单描述 |
| | | approvingBomList: [], // 子物料 |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleSubmit() { |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | let data = { ...this.formData, ...values }; |
| | | data.capprovingList = this.list; |
| | | data.nextUser = getItemByKey(data.nextUserName, this.userList).id; |
| | | deleteComponent(data) |
| | | .then((res) => { |
| | | let rs = res.data; |
| | | if (rs.code == 1 && rs.data) { |
| | | this.$emit("success", this.list); |
| | | this.$message.success(rs.msg); |
| | | } else { |
| | | this.$message.error(rs.msg); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.$message.error("接口请求异常"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | getUserByRoleId() { |
| | | if (this.roles[0].id == 1002) { |
| | | this.userList = this.generalManagerList.map((item) => item); |
| | | } else { |
| | | this.userList = this.projectManagerList.map((item) => item); |
| | | } |
| | | }, |
| | | cancel() { |
| | | this.$emit("cancel", this.list); |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters("account", [ |
| | | "roles", |
| | | "projectManagerList", |
| | | "generalManagerList", |
| | | ]), |
| | | }, |
| | | mounted() { |
| | | console.log(this.roles, this.generalManagerList, this.projectManagerList); |
| | | this.getUserByRoleId(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .modal-footer { |
| | | padding-top: 8px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | |
| | | * 删除散装件 |
| | | * @returns |
| | | */ |
| | | export const deleteComponent = (id) => { |
| | | export const deleteComponent = (data) => { |
| | | return axios({ |
| | | method: "GET", |
| | | url: "component/deleteComponent", |
| | | params: { id } |
| | | method: "POST", |
| | | url: "worksheetMain/componentSubmit", |
| | | data |
| | | }) |
| | | } |
| | | /** |
| | |
| | | title="提交审核" |
| | | :destroyOnClose="true" |
| | | :maskClosable="false" |
| | | :width="800" |
| | | :width="500" |
| | | :footer="null" |
| | | @cancel="resCancel" |
| | | @cancel="cancelSubmit" |
| | | > |
| | | <submit-form |
| | | :title="title" |
| | |
| | | import AdvanceTable from "@/components/table/advance/AdvanceTable"; |
| | | import ImageView from "@/pages/components/ImageView"; |
| | | import EditLink from "./editLink"; |
| | | import SubmitForm from "@/pages/workplace/workForm/SubmitForm"; |
| | | import SubmitForm from "./SubmitForm"; |
| | | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { getList, deleteComponent, zipParse } from "./apis"; |
| | |
| | | import {uploadDraw} from "@/pages/workplace/apis"; |
| | | import const_work_level from "@/assets/js/const/const_work_level"; |
| | | import getItemByKey from "@/assets/js/tools/getItemByKey"; |
| | | import {mapState} from "vuex"; |
| | | import {mapGetters} from "vuex"; |
| | | export default { |
| | | name: "SubmitForm", |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapState('account', ['roles', 'projectManagerList', 'generalManagerList']), |
| | | ...mapGetters('account', ['roles', 'projectManagerList', 'generalManagerList']), |
| | | }, |
| | | mounted() { |
| | | console.log(this.roles); |