qinhb 1 gadu atpakaļ
vecāks
revīzija
bbc48797f5

+ 1 - 1
.env.development

@@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api'
 # VITE_APP_API_URL = http://vapi.youlai.tech
 # 开发接口地址
 # VITE_APP_API_URL = 'http://192.168.101.4:8078'
-VITE_APP_API_URL = 'http://192.168.101.64:8078'
+VITE_APP_API_URL = 'http://192.168.101.188:8078'
 # VITE_APP_API_URL = 'http://192.168.101.30:8078'  //lup
 #VITE_APP_API_URL = 'http://192.168.101.64:8078'  #hetao
 

+ 9 - 1
src/common/configs/dictDataUtil.ts

@@ -33,8 +33,16 @@ const DictDataUtil = {
     post_type: "post_type",
     //仓库类型
     warehouse_type: "warehouse_type",
+    //仓库出库任务类型
+    warehouse_out_task_type: "warehouse_out_task_type",
+    //仓库任务状态
+    warehouse_task_state: "warehouse_task_state",
     //货位类型
-    storage_location_type: "storage_location_type"
+    storage_location_type: "storage_location_type",
+    //载具类型
+    vehicle_type: "vehicle_type",
+    //载具状态
+    vehicle_state: "vehicle_state"
   },
   EXPAND_FIELD_TABLE: {
     //字段类型

+ 0 - 47
src/common/configs/dictDataUtil.ts~

@@ -1,47 +0,0 @@
-// 所有的字典类型typeCode都要在这里面写。
-
-const DictDataUtil = {
-  request_url:
-    import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dictData/queryByType/",
-  dept_tree_url: import.meta.env.VITE_APP_BASE_API + "/api/v1/sys/dept/orgTree",
-  TYPE_CODE: {
-    //订单类型
-    plan_order_type: "plan_order_type",
-    //订单优先级
-    plan_order_priority: "plan_order_priority",
-    //订单状态
-    plan_order_state: "plan_order_state",
-    //设备类型
-    device_type: "device_type",
-    //设备状态
-    device_status: "device_status",
-    //设备运行状态
-    device_run_status: "device_run_status",
-    //设备维护频率
-    device_maintenance_cycle: "device_maintenance_cycle",
-    // 工艺路线类型
-    routing_type: "routing_type",
-    //封装方法
-    packaging_method: "packaging_method",
-    //岗位组
-    post_group: "post_group",
-    //岗位类别
-    post_type: "post_type",
-    //仓库类型
-    warehouse_type: "warehouse_type",
-    //货位类型
-    storage_location_type: "storage_location_type"
-  },
-  EXPAND_FIELD_TABLE: {
-    //字段类型
-    expand_field_type: "expand_field_type",
-    //映射表列表
-    expand_table_list: "expand_field_table",
-    //订单计划表
-    plan_order_info: "plan_order_info",
-    //映射字段列表
-    expand_field_list: "expand_field_list",
-  },
-};
-
-export default DictDataUtil;

+ 175 - 0
src/views/base/materials/components/choice-item-page.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-click="rowClick"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import {defineProps, ref} from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook } from "@/store";
+import { useDictionaryStoreHook } from "@/store";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const { dicts } = useDictionaryStoreHook();
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const props = defineProps({
+  materialCode: {
+    type: String,
+    default: () => {
+      return '';
+    }
+  }
+})
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/base/material",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const emit = defineEmits(["materialInfo"])
+const rowClick = (row)=>{
+  emit("materialInfo", row)
+}
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: false,
+  column: [
+    { label: "物料编码",width: 120, prop: "materialCode", search: true },
+    { label: "物料名称",width: 120, prop: "materialName", search: true },
+    {
+      label: "物料属性",
+      prop: "attributeDictValue",
+      search: true,
+      width: 120,
+      type: 'select',
+      dicData:dicts.material_properties,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    { label: "物料规格",width: 120, prop: "spec", search: true},
+    {
+      label: "单位",
+      prop: "unitDictValue",
+      type: "select",
+      dicData:dicts.danwei_type,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "物料级别",
+      prop: "levelDictValue",
+      width: 100,
+      type: "select",
+      dicData:dicts.material_level,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    { label: "生产厂家",width: 120, prop: "manufacturer"},
+    {
+      label: "质检方案",
+      prop: "inspectDictValue",
+      width: 120,
+      type: "select",
+      dicData:dicts.quality_testing_plan,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "适用平台",
+      prop: "applicablePlatformsDictValue",
+      width: 120,
+      type: "select",
+      dicData:dicts.applicable_platforms,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "质量等级",
+      prop: "qualityLevelDictValue",
+      width: 120,
+      type: "select",
+      dicData:dicts.quality_grade,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "选用类型",
+      prop: "selectionDictValue",
+      width: 100,
+      type: "select",
+      dicData:dicts.selection_type,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "产品阶段",
+      prop: "stageDictValue",
+      search: true,
+      width: 100,
+      filterable: true,
+      type: "select",
+      dicData:dicts.stage,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    { label: "客户型号",width: 100, prop: "customerModel",  },
+    { label: "保质期(天)",width: 100, prop: "qualityGuaranteePeriod", },
+    {
+      label: "封装方法",
+      prop: "packageDictValue",
+      width: 100,
+      type: "select",
+      dicData:dicts.packaging_method,
+      props: { label: "dictLabel", value: "dictLabel" },
+    },
+    {
+      label: "是否工装",
+      prop: "frock",
+      width: 100,
+      type: "radio", //类型为单选框
+      dicData: [
+        {
+          label: "是",
+          value: 1,
+        },
+        {
+          label: "否",
+          value: 0,
+        },
+
+      ],
+      value: 1,
+      rules: [{
+        required: true,
+        message: "是否工装",
+        trigger: "blur"
+      }],
+    },
+    { label: "筛选规范",width: 100, prop: "selectionSpec", type: "textarea",span:18},
+    { label: "备注",width: 100, prop: "remark", type: "textarea", span:18 },
+  ],
+});
+
+onMounted(() => {
+  search.value.prodtCode = props.materialCode
+  search.value.enabled = "0"
+  dataList();
+});
+</script>

+ 33 - 3
src/views/plan/order/index.vue

@@ -5,6 +5,7 @@
       :option="option"
       v-model:page="page"
       v-model:search="search"
+        v-model="form"
       :table-loading="loading"
       :permission="permission"
       @search-change="handleQuery"
@@ -50,7 +51,14 @@
         </el-button>
       </template>
     </avue-crud>
-
+    <el-dialog
+        v-model="dialog1.visible"
+        :title="dialog1.title"
+        width="950px"
+        @close="dialog1.visible = false"
+    >
+      <choice-item-page @materialInfo="materialInfo"/>
+    </el-dialog>
     <el-dialog
       v-model="dialog.visible"
       :title="dialog.title"
@@ -114,6 +122,7 @@ import {
   getExpandAlias,
 } from "@/api/order";
 import {ref} from "vue";
+import ChoiceItemPage from "@/views/base/materials/components/choice-item-page.vue";
 
 // 弹窗对象
 const dialog = reactive({
@@ -134,6 +143,16 @@ const importData = reactive({
   file: undefined,
   fileList: [],
 });
+const materialInfo = (value) => {
+  form.value.materialCode = value.materialCode
+  form.value.materialName = value.materialName
+  form.value.materialModel = value.spec
+  dialog1.visible = false
+}
+const dialog1 = reactive({
+  title: "物料选择",
+  visible: false,
+});
 const permission = reactive({
   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
@@ -201,19 +220,30 @@ option.value = {
           trigger: "trigger",
         },
       ],
-      focus: ({ value, column }) => {
-        //todo
+      click: ({ value, column }) => {
+        if(column.boxType){
+          dialog1.visible = true
+        }
       },
     },
     {
       label: "产品名称",
       prop: "materialName",
       search: true,
+      rules: [
+        {
+          required: true,
+          message: "产品名称不能为空",
+          trigger: "trigger",
+        },
+      ],
+      disabled: true,
       width: "100",
     },
     {
       label: "产品规格",
       width: "100",
+      disabled: true,
       prop: "materialModel",
     },
     {

+ 175 - 0
src/views/storage/alarm/index.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+        @selection-change="selectionChange"
+    >
+      <template #menu-left="{ size }">
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+          >删除</el-button
+        >
+      </template>
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wms/alarm",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: true,
+  column: [
+    {
+      label: "仓库编码",
+      prop: "houseNo",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.warehouse_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      rules: [
+        {
+          required: true,
+          message: "仓库编码不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "物料编码",
+      prop: "code",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "物料编码不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "物料名称",
+      prop: "name",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "物料名称不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "最小库存",
+      prop: "min",
+      type: "number",
+      min: 0,
+      max: 999999,
+      rules: [
+        {
+          required: true,
+          message: "最小安全库存不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "最大库存",
+      prop: "max",
+      type: "number",
+      min: 0,
+      max: 999999,
+      rules: [
+        {
+          required: true,
+          message: "最大安全库存不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "单位",
+      prop: "unit",
+    },
+    {
+      label: "状态",
+      prop: "state",
+      type: "select",
+      dicData: [{label: '启用' , value: 0},{label: '禁用' , value: 1}],
+      html: true,
+      formatter: (val) => {
+        if (val.state === 0) {
+          return '<b class="el-tag el-tag--success el-tag--light">启用</b>';
+        }
+        return '<b class="el-tag el-tag--danger el-tag--light">禁用</b>';
+      },
+      rules: [
+        {
+          required: true,
+          message: "状态不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      width: 180,
+      display: false
+    },
+    {
+      label: "创建人",
+      prop: "creator",
+      display: false
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+</script>

+ 131 - 0
src/views/storage/inTask/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wms/task",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  viewBtn: false,
+  editBtn: false,
+  menu: false,
+  addBtn: false,
+  column: [
+    {
+      label: "入库单号",
+      prop: "taskNo",
+      search: true,
+      width:150,
+      overHidden: true
+    },
+    {
+      label: "计划单号",
+      prop: "planNo",
+      search: true,
+    },
+    {
+      label: "物料编号",
+      prop: "materialNo",
+    },
+    {
+      label: "物料名称",
+      width:150,
+      overHidden: true,
+      prop: "materialName",
+    },
+    {
+      label: "批次号",
+      prop: "batchCode",
+      width:150,
+      overHidden: true
+    },
+    {
+      label: "入库总数量",
+      prop: "num",
+    },
+    {
+      label: "已入库数量",
+      prop: "completedNum",
+    },
+    {
+      label: "待入库数量",
+      prop: "unDoNum",
+    },
+    {
+      label: "单位",
+      prop: "unit",
+    },
+    {
+      label: "入库仓库",
+      prop: "houseType",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.warehouse_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      }
+    },
+    {
+      label: "状态",
+      prop: "state",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.warehouse_task_state,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      }
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  search.value.type = '1'
+  dataList();
+});
+</script>

+ 131 - 0
src/views/storage/outTask/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wms/task",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  viewBtn: false,
+  editBtn: false,
+  menu: false,
+  addBtn: false,
+  column: [
+    {
+      label: "出库单号",
+      prop: "taskNo",
+      search: true,
+      width:150,
+      overHidden: true
+    },
+    {
+      label: "计划单号",
+      prop: "planNo",
+      search: true,
+    },
+    {
+      label: "物料编号",
+      prop: "materialNo",
+    },
+    {
+      label: "物料名称",
+      width:150,
+      overHidden: true,
+      prop: "materialName",
+    },
+    {
+      label: "批次号",
+      prop: "batchCode",
+      width:150,
+      overHidden: true
+    },
+    {
+      label: "出库总数量",
+      prop: "num",
+    },
+    {
+      label: "已出库数量",
+      prop: "completedNum",
+    },
+    {
+      label: "待出库数量",
+      prop: "unDoNum",
+    },
+    {
+      label: "单位",
+      prop: "unit",
+    },
+    {
+      label: "出库类型",
+      prop: "outType",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.warehouse_out_task_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      }
+    },
+    {
+      label: "状态",
+      prop: "state",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.warehouse_task_state,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      }
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  search.value.type = '2'
+  dataList();
+});
+</script>

+ 122 - 0
src/views/storage/returnTask/index.vue

@@ -0,0 +1,122 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wms/task",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  viewBtn: false,
+  editBtn: false,
+  menu: false,
+  addBtn: false,
+  column: [
+    {
+      label: "退料单号",
+      prop: "taskNo",
+      search: true,
+      width:150,
+      overHidden: true
+    },
+    {
+      label: "计划单号",
+      prop: "planNo",
+      search: true,
+    },
+    {
+      label: "物料编号",
+      prop: "materialNo",
+    },
+    {
+      label: "物料名称",
+      width:150,
+      overHidden: true,
+      prop: "materialName",
+    },
+    {
+      label: "批次号",
+      prop: "batchCode",
+      width:150,
+      overHidden: true
+    },
+    {
+      label: "退料总数量",
+      prop: "num",
+    },
+    {
+      label: "已退料数量",
+      prop: "completedNum",
+    },
+    {
+      label: "待退料数量",
+      prop: "unDoNum",
+    },
+    {
+      label: "单位",
+      prop: "unit",
+    },
+    {
+      label: "关联出库单",
+      prop: "relOutOrderNo",
+    },
+    {
+      label: "状态",
+      prop: "state",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.warehouse_task_state,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      }
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  search.value.type = '3'
+  dataList();
+});
+</script>

+ 80 - 45
src/views/storage/stock/index.vue

@@ -27,6 +27,14 @@
         >
       </template>
     </avue-crud>
+    <el-dialog
+        v-model="dialog1.visible"
+        :title="dialog1.title"
+        width="950px"
+        @close="dialog1.visible = false"
+    >
+      <choice-item-page @materialInfo="materialInfo"/>
+    </el-dialog>
     <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
   </div>
 </template>
@@ -46,22 +54,56 @@ const test = () => {
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
-    src: "/api/v1/wms/position",
+    src: "/api/v1/wms/stock",
   });
 const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
 
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
-
+const dialog1 = reactive({
+  title: "物料选择",
+  visible: false,
+});
+const materialInfo = (value) => {
+  form.value.materialCode = value.materialCode
+  form.value.materialName = value.materialName
+  form.value.materialModel = value.spec
+  form.value.unit = value.unitDictValue
+  dialog1.visible = false
+}
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   delBtn: false,
   selection: true,
   column: [
     {
+      label: "入库单号",
+      prop: "taskNo",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "入库单号不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "计划单号",
+      prop: "planNo",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "计划单号不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
       label: "仓库编码",
-      prop: "type",
+      prop: "houseType",
       type: "select",
       search: true,
       editDisabled: true,
@@ -81,78 +123,71 @@ option.value = Object.assign(option.value, {
       ],
     },
     {
-      label: "货区",
-      prop: "area",
+      label: "料箱编号",
+      prop: "vehicleCode",
+      editDisabled: true,
       rules: [
         {
           required: true,
-          message: "货区不能为空",
+          message: "料箱编号不能为空",
           trigger: "trigger",
         },
       ],
     },
     {
-      label: "货位",
+      label: "仓库坐标",
       prop: "coordinate",
-      search: true,
+      editDisabled: true,
       rules: [
         {
           required: true,
-          message: "货位不能为空",
+          message: "仓库位置不能为空",
           trigger: "trigger",
         },
       ],
     },
     {
-      label: "层数",
-      prop: "layer",
-      type: "number",
-      rules: [
-        {
-          required: true,
-          message: "层数不能为空",
-          trigger: "trigger",
-        },
-      ],
+      label: "批次号",
+      prop: "batchCode",
+      search: true
     },
     {
-      label: "货位类型",
-      prop: "materialType",
-      type: "select",
-      dicUrl:
-          dictDataUtil.request_url +
-          dictDataUtil.TYPE_CODE.storage_location_type,
-      props: {
-        label: "dictLabel",
-        value: "dictValue",
+      label: "序列号",
+      prop: "seqNo",
+    },
+    {
+      label: "物料名称",
+      prop: "materialName",
+      click: ({ value, column }) => {
+        if(column.boxType){
+          dialog1.visible = true
+        }
       },
-      rules: [
+      /*rules: [
         {
           required: true,
-          message: "货位类型不能为空",
+          message: "物料名称不能为空",
           trigger: "trigger",
         },
-      ],
+      ],*/
     },
     {
-      label: "状态",
-      prop: "enable",
-      type: "select",
-      dicData: [{label: '启用' , value: 0},{label: '禁用' , value: 1}],
-      html: true,
-      formatter: (val) => {
-        if (val.state === 0) {
-          return '<b class="el-tag el-tag--success el-tag--light">启用</b>';
-        }
-        return '<b class="el-tag el-tag--danger el-tag--light">禁用</b>';
-      },
-      rules: [
+      label: "数量",
+      prop: "num",
+      type: 'number',
+      min: 0,
+      max: 99999
+      /*rules: [
         {
           required: true,
-          message: "状态不能为空",
+          message: "数量不能为空",
           trigger: "trigger",
         },
-      ],
+      ],*/
+    },
+    {
+      label: "单位",
+      prop: "unit",
     },
   ],
 });

+ 185 - 0
src/views/storage/vehicle/index.vue

@@ -0,0 +1,185 @@
+<template>
+  <div class="mainContentBox">
+    <avue-crud
+        ref="crudRef"
+        v-model:search="search"
+        v-model="form"
+        :data="data"
+        :option="option"
+        v-model:page="page"
+        @row-save="createRow"
+        @row-update="updateRow"
+        @row-del="deleteRow"
+        @search-change="searchChange"
+        @search-reset="resetChange"
+        @size-change="dataList"
+        @current-change="dataList"
+        @selection-change="selectionChange"
+    >
+      <template #menu-left="{ size }">
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+          >删除</el-button
+        >
+      </template>
+    </avue-crud>
+    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+  </div>
+</template>
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wms/vehicle",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: true,
+  column: [
+    {
+      label: "载具编码",
+      prop: "code",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "载具编码不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "载具名称",
+      prop: "name",
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "载具名称不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "载具类型",
+      prop: "category",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.vehicle_type,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      rules: [
+        {
+          required: true,
+          message: "载具类型不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "容量",
+      prop: "capacity",
+      type: "number",
+      min:  1,
+      max: 99999,
+      rules: [
+        {
+          required: true,
+          message: "容量不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "使用次数",
+      prop: "maxUseNum",
+      type: "number",
+      min:  1,
+      max: 99999,
+      rules: [
+        {
+          required: true,
+          message: "最大使用次数不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "状态",
+      prop: "state",
+      type: "select",
+      search: true,
+      dicUrl:
+          dictDataUtil.request_url +
+          dictDataUtil.TYPE_CODE.vehicle_state,
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      rules: [
+        {
+          required: true,
+          message: "状态不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "创建时间",
+      prop: "created",
+      display: false
+    },
+    {
+      label: "创建人",
+      prop: "creator",
+      display: false
+    },
+  ],
+});
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  dataList();
+});
+/**
+ * 上传excel相关
+ */
+const uploadRef = ref(null);
+const uploadFinished = () => {
+  // 上传完成后的刷新操作
+  page.currentPage = 1;
+  dataList();
+};
+const importExcelData = () => {
+  if (uploadRef.value) {
+    uploadRef.value.show("/api/v1/device/import");
+  }
+};
+</script>