产品管理: 在新增生产订单表单中添加业务员和备注字段,并在表格中显示相应列
| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | label="业务员" |
| | | prop="entryPerson" |
| | | :rules="[{ required: true, message: '请选择业务员', trigger: 'change' }]" |
| | | > |
| | | <el-select |
| | | v-model="formState.entryPerson" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择业务员" |
| | | style="width: 100%;" |
| | | > |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.userId" |
| | | :label="item.nickName" |
| | | :value="item.nickName" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | label="需求数量" |
| | | prop="quantity" |
| | | > |
| | | <el-input-number v-model="formState.quantity" :step="1" :min="1" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formState.remark" type="textarea" :rows="4" maxlength="500" show-word-limit placeholder="请输入" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <!-- 产品选择弹窗 --> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, computed, getCurrentInstance} from "vue"; |
| | | import {ref, computed, getCurrentInstance, onMounted} from "vue"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | import {addProductOrder, listProcessRoute} from "@/api/productionManagement/productionOrder.js"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | |
| | | const props = defineProps({ |
| | | visible: { |
| | |
| | | const emit = defineEmits(['update:visible', 'completed']); |
| | | |
| | | // 响应式数据(替代选项式的 data) |
| | | const userStore = useUserStore(); |
| | | const userList = ref([]); |
| | | |
| | | const formState = ref({ |
| | | productId: undefined, |
| | | productModelId: undefined, |
| | |
| | | productModelName: "", |
| | | unit: "", |
| | | quantity: 0, |
| | | remark: "", |
| | | entryPerson: userStore.nickName || "", |
| | | }); |
| | | |
| | | const isShow = computed({ |
| | |
| | | let { proxy } = getCurrentInstance() |
| | | |
| | | const closeModal = () => { |
| | | // 重置表单数据 |
| | | formState.value = { |
| | | productId: undefined, |
| | | productModelId: undefined, |
| | | routeId: undefined, |
| | | productName: "", |
| | | productModelName: "", |
| | | quantity: '', |
| | | unit: "", |
| | | quantity: 0, |
| | | remark: "", |
| | | entryPerson: userStore.nickName || "", |
| | | }; |
| | | isShow.value = false; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | userListNoPage().then((res) => { |
| | | userList.value = res.data || []; |
| | | }); |
| | | }); |
| | | |
| | | // 产品选择处理 |
| | | const handleProductSelect = async (products) => { |
| | | if (products && products.length > 0) { |
| | |
| | | width: '200px', |
| | | }, |
| | | { |
| | | label: "业务员", |
| | | prop: "entryPerson", |
| | | width: "100px", |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remark", |
| | | width: "160px", |
| | | }, |
| | | { |
| | | label: "产品名称", |
| | | prop: "productCategory", |
| | | width: '120px', |