产品管理: 在新增生产订单表单中添加业务员和备注字段,并在表格中显示相应列
已修改2个文件
55 ■■■■■ 文件已修改
src/views/productionManagement/productionOrder/New.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/New.vue
@@ -50,10 +50,34 @@
        </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>
@@ -74,9 +98,11 @@
</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: {
@@ -94,6 +120,9 @@
const emit = defineEmits(['update:visible', 'completed']);
// 响应式数据(替代选项式的 data)
const userStore = useUserStore();
const userList = ref([]);
const formState = ref({
  productId: undefined,
  productModelId: undefined,
@@ -102,6 +131,8 @@
  productModelName: "",
  unit: "",
  quantity: 0,
  remark: "",
  entryPerson: userStore.nickName || "",
});
const isShow = computed({
@@ -118,18 +149,26 @@
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) {
src/views/productionManagement/productionOrder/index.vue
@@ -135,6 +135,16 @@
      width: '200px',
    },
    {
      label: "业务员",
      prop: "entryPerson",
      width: "100px",
    },
    {
      label: "备注",
      prop: "remark",
      width: "160px",
    },
    {
      label: "产品名称",
      prop: "productCategory",
      width: '120px',