浏览代码

工装及出入库

qinhb 9 月之前
父节点
当前提交
1a5383e7d6

+ 1 - 1
.env.development

@@ -10,7 +10,7 @@ VITE_APP_BASE_API = '/dev-api'
 # 上传文件接口地址
 VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 # 开发接口地址
- VITE_APP_API_URL = 'http://127.0.0.1:7104'
+ VITE_APP_API_URL = 'http://127.0.0.1:7204'
 
 
 # 是否启用 Mock 服务

+ 11 - 0
src/api/storage/index.ts

@@ -59,3 +59,14 @@ export function auditPlan(
     data: queryParams,
   });
 }
+
+export function wmsOrderAdd(
+    queryParams: object
+): AxiosPromise<any> {
+  return request({
+    url: "/api/v1/wmsOrder/add",
+    method: "post",
+    data: queryParams,
+  });
+}
+

+ 168 - 0
src/views/base/frock/columns.ts

@@ -0,0 +1,168 @@
+import { useDictionaryStore } from "@/store";
+const { dicts } = useDictionaryStore();
+export const columns = [
+  { label: "物料编码", prop: "materialCode", width: 130,overHidden: true,search: true ,rules: [{
+      required: true,
+      editDisabled:false,
+      message: "请填写物料编码",
+      trigger: "blur"
+    }],},
+  { label: "物料名称", prop: "materialName", width: 140,overHidden: true,search: true ,rules: [{
+      required: true,
+      message: "请填写物料名称",
+      trigger: "blur"
+    }],},
+  {
+    label: "物料属性",
+    prop: "attributeDictValue",
+    search: true,
+    filterable: true,
+    type: 'select',
+    width: 100,overHidden: true,
+    dicData:dicts.material_properties,
+    props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择物料属性",
+      trigger: "blur"
+    }],
+  },
+  { label: "物料规格", prop: "spec", width: 100,overHidden: true,rules: [{
+      required: true,
+      message: "请填写物料规格",
+      trigger: "blur"
+    }], },
+  {
+    label: "单位",
+    prop: "unitDictValue",
+    filterable: true,
+    type: "select",
+    dicData:dicts.danwei_type,
+    props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择单位",
+      trigger: "blur"
+    }],
+  },
+  {
+    label: "物料级别",
+    prop: "levelDictValue",
+    search: true,
+    filterable: true,
+    type: "select",
+    width: 100,overHidden: true,
+    dicData:dicts.material_level,
+    props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择物料级别",
+      trigger: "blur"
+    }],
+  },
+  { label: "维修厂家", prop: "manufacturer",width: 100,overHidden: true ,rules: [{
+      required: true,
+      message: "请填写维修厂家",
+      trigger: "blur"
+    }],},
+  {
+    label: "质检方案",
+    prop: "inspectDictValue",
+    search: true,
+    filterable: true,
+    type: "select",
+    width: 100,overHidden: true,
+    dicData:dicts.quality_testing_plan,
+    props: { label: "dictLabel", value: "dictValue" },
+  },
+  {
+    label: "适用平台",
+    prop: "applicablePlatformsDictValue",
+    search: true,
+    filterable: true,
+    type: "select",
+    width: 100,overHidden: true,
+    dicData:dicts.applicable_platforms,
+    props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+     required: true, message: "请选择适用平台",
+     trigger: "blur"
+    }],
+  },
+  {
+    label: "质量等级",
+    prop: "qualityLevelDictValue",
+    search: true,
+    width: 100,overHidden: true,
+    filterable: true,
+    type: "select",
+    dicData:dicts.quality_grade,
+    props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择质量等级",
+      trigger: "blur"
+    }],
+  },
+  {
+    label: "选用类型",
+    prop: "selectionDictValue",
+    search: true,
+    filterable: true,
+    width: 100,overHidden: true,
+    type: "select",
+    dicData:dicts.selection_type,
+    props: { label: "dictLabel", value: "dictValue" },
+  },
+  {
+    label: "产品阶段",
+    prop: "stageDictValue",
+    search: true,
+    filterable: true,
+    width: 100,overHidden: true,
+    type: "select",
+    dicData:dicts.stage,
+    props: { label: "dictLabel", value: "dictValue" },
+  },
+  { label: "客户型号", prop: "customerModel",width: 100,overHidden: true,  },
+  { label: "保质期(天)", prop: "qualityGuaranteePeriod",width: 100,overHidden: true,type:"number" ,min:0 },
+  {
+    label: "封装方法",
+    prop: "packageDictValue",
+    search: true,
+    width: 100,overHidden: true,
+    filterable: true,
+    type: "select",
+    dicData:dicts.packaging_method,
+    props: { label: "dictLabel", value: "dictValue" },
+  },
+
+  {
+    label: "是否工装",
+    prop: "frock",
+    search: true,
+    width: 90,overHidden: true,
+    filterable: true,
+    type: "radio", //类型为单选框
+    dicData: [
+      {
+        label: "是",
+        value: "1",
+      },
+      {
+        label: "否",
+        value: "0",
+      },
+
+    ],
+    value: "1",
+    rules: [{
+      required: true,
+      message: "是否工装",
+      trigger: "blur"
+    }],
+  },
+  { label: "筛选规范", prop: "selectionSpec",width: 150,overHidden: true,  type: "textarea",span:18},
+
+  { label: "备注", prop: "remark", width: 150,overHidden: true,type: "textarea", span:18 },
+];

+ 182 - 0
src/views/base/frock/components/choice-item-page.vue

@@ -0,0 +1,182 @@
+<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 { useDictionaryStore } from "@/store";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const { dicts } = useDictionaryStore();
+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: 150,overHidden: true, prop: "materialCode", search: true },
+    { label: "物料名称",width: 150,overHidden: true, prop: "materialName", search: true },
+    {
+      label: "物料属性",
+      prop: "attributeDictValue",
+      search: true,
+      width: 120,
+      overHidden: true,
+      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,
+      overHidden: true,
+      type: "select",
+      dicData:dicts.material_level,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    { label: "维修厂家",width: 120, overHidden: true,prop: "manufacturer"},
+    {
+      label: "质检方案",
+      prop: "inspectDictValue",
+      width: 120,
+      overHidden: true,
+      type: "select",
+      dicData:dicts.quality_testing_plan,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "适用平台",
+      prop: "applicablePlatformsDictValue",
+      width: 120,
+      type: "select",
+      overHidden: true,
+      dicData:dicts.applicable_platforms,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "质量等级",
+      prop: "qualityLevelDictValue",
+      width: 120,
+      type: "select",
+      overHidden: true,
+      dicData:dicts.quality_grade,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "选用类型",
+      prop: "selectionDictValue",
+      width: 100,
+      overHidden: true,
+      type: "select",
+      dicData:dicts.selection_type,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "产品阶段",
+      prop: "stageDictValue",
+      search: true,
+      overHidden: true,
+      width: 100,
+      filterable: true,
+      type: "select",
+      dicData:dicts.stage,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    { label: "客户型号",width: 100, overHidden: true,prop: "customerModel",  },
+    { label: "保质期(天)",width: 100, overHidden: true,prop: "qualityGuaranteePeriod", },
+    {
+      label: "封装方法",
+      prop: "packageDictValue",
+      width: 100,overHidden: true,
+      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,overHidden: true, prop: "selectionSpec", type: "textarea",span:18},
+    { label: "备注",width: 100,overHidden: true, prop: "remark", type: "textarea", span:18 },
+  ],
+});
+
+onMounted(() => {
+  search.value.prodtCode = props.materialCode
+  search.value.enabled = "0"
+  dataList();
+});
+</script>

+ 325 - 0
src/views/base/frock/components/drawing-page.vue

@@ -0,0 +1,325 @@
+<template>
+  <div class="mainContentBox">
+    <avue-form ref="formRef" v-model="form" :option="option" @submit="rowSave">
+      <template #drawingPath="scope">
+        <!--        <single-upload v-model="form.drawingPath" :generatePdf="true"/>-->
+        <FilesUpload
+          v-model:src-list="srcList"
+          v-model:pdf-list="pdfUrlList"
+          v-model:file-name-list="fileNameList"
+          v-model:file-list="fileList"
+          :limit="10"
+          :generate-pdf="true"
+          @finished="testFiles"
+          :key="uploadKey"
+        />
+      </template>
+    </avue-form>
+    <avue-crud
+      ref="crudRef"
+      v-model:search="search"
+      v-model="form"
+      :data="data"
+      :option="option"
+      v-model:page="page"
+      @row-save="addRow"
+      @row-update="updateRow"
+      @row-del="deleteRow"
+      @search-change="searchChange"
+      @search-reset="resetChange"
+      @size-change="dataList"
+      @current-change="dataList"
+      @selection-change="selectionChange"
+      search-option="false"
+    >
+      <template #menu-left="{ size }">
+        <el-button
+          :disabled="toDeleteIds.length < 1"
+          type="danger"
+          icon="el-icon-delete"
+          :size="size"
+          @click="multipleDelete"
+          >删除</el-button
+        >
+        <el-select
+          v-model="version"
+          placeholder="请选择BOM版本"
+          style="width: 150px; margin-left: 15px"
+          @change="getVersionDrawing"
+        >
+          <el-option
+            v-for="item in options"
+            :key="item"
+            :label="item"
+            :value="item"
+          />
+        </el-select>
+      </template>
+      <template #menu="{ row, index, type }">
+        <PDFView
+          :need-to-show-pdf="true"
+          content-type="button"
+          :is-link="true"
+          :show-pdf-number="1"
+          :pdf-source="filePath + row.pdfPath"
+        />
+      </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 { useDictionaryStore } from "@/store";
+import { addDrawing, getDrawing } from "@/api/drawing";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const fileList = ref([]);
+const uploadKey = ref(false);
+const { dicts } = useDictionaryStore();
+const filePath = import.meta.env.VITE_APP_UPLOAD_URL;
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const testFiles = () => {
+  form.value.pdfPathList = pdfUrlList.value;
+  form.value.drawingPathList = srcList.value;
+  form.value.drawingPath = srcList.value[0];
+  form.value.fileNameList = fileNameList.value;
+};
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/base/drawing",
+  });
+const { dataList } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+// const permission = reactive({
+//   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+//   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+//   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+//   menu: true,
+// });
+const formRef = ref(null);
+const version = ref({
+  value: "0",
+  label: "请选择图纸版本",
+});
+const options = ref([]);
+const fileUrl = ref(""); //单文件
+const pdfUrlList = ref([]);
+const srcList = ref([]);
+const fileNameList = ref([]);
+import dictDataUtil from "@/common/configs/dictDataUtil";
+const getVersionDrawing = () => {
+  if (version.value.value != "0") {
+    search.value.materialCode = props.materialCode;
+    search.value.drawingVersion = version.value;
+    dataList();
+  }
+};
+const addRow = (form2, done) => {
+  createRow(form, done, done);
+  pdfUrlList.value = [];
+  srcList.value = [];
+  fileNameList.value = [];
+};
+function rowSave(form, done) {
+  form.associationCode = props.materialCode;
+  form.associationName = props.materialName;
+  addDrawing(form).then((data) => {
+    if (data.code === "200") {
+      ElMessage({
+        message: data.msg,
+        type: "success",
+      });
+      fileNameList.value = [];
+      srcList.value = [];
+      pdfUrlList.value = [];
+      fileList.value = [];
+      formRef.value.resetForm();
+      uploadKey.value = !uploadKey.value;
+      dataList();
+    } else {
+      ElMessage({
+        message: data.msg,
+        type: "error",
+      });
+    }
+  });
+  done();
+}
+
+onMounted(() => {
+  // console.log("crudRef", crudRef)
+  getDrawing(props.materialCode).then((data) => {
+    if (data.code === "200") {
+      options.value = Array.from(data.data);
+    } else {
+      ElMessage({
+        message: data.msg,
+        type: "error",
+      });
+    }
+  });
+  search.value.materialCode = props.materialCode;
+  dataList();
+});
+
+const ctableRef = ref(null);
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  selection: true,
+  column: [
+    {
+      label: "物料编号",
+      prop: "associationCode",
+      hide: true,
+      display: false,
+    },
+
+    {
+      label: "物料编号",
+      prop: "associationName",
+      hide: true,
+      display: false,
+    },
+
+    {
+      label: "图纸编号",
+      prop: "drawingCode",
+      rules: [
+        {
+          required: true,
+          message: "图纸编号不能为空",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "图纸标题",
+      prop: "drawingTitle",
+      rules: [
+        {
+          required: true,
+          message: "图纸名称不能为空",
+          trigger: "blur",
+        },
+      ],
+    },
+
+    {
+      label: "图纸类型",
+      prop: "drawingDictValue",
+      filterable: true,
+      type: "select",
+      width: 100,
+      overHidden: true,
+      dicUrl: dictDataUtil.request_url + "drawing_type",
+      props: { label: "dictLabel", value: "dictValue" },
+      rules: [
+        {
+          required: true,
+          message: "请选择物料属性",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "文件名称",
+      prop: "fileName",
+      span: 24,
+      width: 120,
+      overHidden: true,
+      display: false,
+    },
+    {
+      label: "文件数组",
+      prop: "drawingPathList",
+      span: 24,
+      hide: true,
+      display: false,
+    },
+    {
+      label: "pdf数组",
+      prop: "pdfPathList",
+      span: 24,
+      hide: true,
+      display: false,
+    },
+
+    {
+      label: "文件名称数组",
+      prop: "fileNameList",
+      span: 24,
+      slot: true,
+      hide: true,
+      display: false,
+    },
+    {
+      label: "版本",
+      prop: "drawingVersion",
+      type: "number",
+      precision: 1,
+      rules: [
+        {
+          required: true,
+          message: "版本号不能为空",
+          trigger: "blur",
+        },
+      ],
+      click() {
+        dialog1.visible = true;
+      },
+    },
+    {
+      label: "图纸上传",
+      prop: "drawingPath",
+      span: 24,
+      slot: true,
+      hide: true,
+
+      rules: [
+        {
+          required: true,
+          message: "图纸上传不能为空",
+          trigger: "blur",
+        },
+      ],
+      /*formatter: (row, column, cellValue, index) => {
+          return `<img src="${row.drawingPath}" alt="${row.drawingPath}" width="50" height="50">`;
+        }
+*/
+    },
+  ],
+  delBtn: false,
+  editBtn: false,
+  viewBtn: false,
+  addBtn: false,
+});
+const props = defineProps({
+  materialCode: {
+    type: String,
+    default: () => {
+      return 0;
+    },
+  },
+  materialName: {
+    type: String,
+    default: () => {
+      return 0;
+    },
+  },
+  dialog: {
+    type: Object,
+    default: () => {
+      return {};
+    },
+  },
+});
+</script>

+ 344 - 0
src/views/base/frock/index.vue

@@ -0,0 +1,344 @@
+<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
+      >
+
+      <template #menu-right="{}">
+        <el-dropdown split-button
+          >导入
+          <template #dropdown>
+            <el-dropdown-menu>
+              <el-dropdown-item
+                @click="downloadTemplate('/api/v1/base/frock/template')"
+              >
+                <i-ep-download />下载模板
+              </el-dropdown-item>
+              <el-dropdown-item @click="importExcelData">
+                <i-ep-top />导入数据
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown>
+        <el-button
+          class="ml-3"
+          @click="exportData('/api/v1/base/frock/export')"
+        >
+          <template #icon> <i-ep-download /> </template>导出
+        </el-button>
+      </template>
+    </avue-crud>
+
+    <el-dialog
+      v-model="dialog.visible"
+      :title="dialog.title"
+      width="900px"
+      @close="dialog.visible = false"
+      :destroy-on-close="true"
+    >
+      <drawing-page
+        :materialCode="drawingDetail.materialCode"
+        :materialName="drawingDetail.materialName"
+        :dialog="dialog"
+      />
+    </el-dialog>
+    <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
+  </div>
+</template>
+<script setup lang="ts">
+import { ref, getCurrentInstance } from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import ButtonPermKeys from "@/common/configs/buttonPermission";
+import {
+  useCommonStoreHook,
+  useDictionaryStore,
+  useDictionaryStoreHook,
+} from "@/store";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const { dicts } = useDictionaryStore();
+
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const dialog = reactive({
+  title: "图纸",
+  visible: false,
+});
+const drawingDetail = ref(null);
+const drawing = (row) => {
+  drawingDetail.value = row;
+  dialog.visible = true;
+};
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/base/frock",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
+  Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
+// const permission = reactive({
+//   delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
+//   addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
+//   editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
+//   menu: true,
+// });
+
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+const router = useRouter?.();
+const binding = (row) => {
+  router.push(`/base/bom/${row.materialCode}`);
+};
+onMounted?.(() => {
+  // 设置表格列或者其他自定义的option
+
+  dataList();
+});
+
+/**
+ * 上传excel相关
+ */
+const uploadRef = ref(null);
+const uploadFinished = () => {
+  // 上传完成后的刷新操作
+  page.currentPage = 1;
+  dataList();
+};
+const importExcelData = () => {
+  if (uploadRef.value) {
+    uploadRef.value.show("/api/v1/base/frock/import");
+  }
+};
+option.value = Object.assign(option.value, {
+  selection: true,
+  column: [
+    {
+      label: "工装编码",
+      prop: "materialCode",
+      width: 130,
+      overHidden: true,
+      search: true,
+      rules: [
+        {
+          required: true,
+          editDisabled: false,
+          message: "请填写工装编码",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "工装名称",
+      prop: "materialName",
+      width: 140,
+      overHidden: true,
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "请填写工装名称",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "工装属性",
+      prop: "attributeDictValue",
+      search: true,
+      filterable: true,
+      type: "select",
+      width: 100,
+      overHidden: true,
+      dicData: dicts.material_properties,
+      props: { label: "dictLabel", value: "dictValue" },
+      rules: [
+        {
+          required: true,
+          message: "请选择工装属性",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "工装规格",
+      prop: "spec",
+      width: 100,
+      overHidden: true,
+      rules: [
+        {
+          required: true,
+          message: "请填写工装规格",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "单位",
+      prop: "unitDictValue",
+      filterable: true,
+      type: "select",
+      dicData: dicts.danwei_type,
+      props: { label: "dictLabel", value: "dictValue" },
+      rules: [
+        {
+          required: true,
+          message: "请选择单位",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "工装级别",
+      prop: "levelDictValue",
+      search: true,
+      filterable: true,
+      type: "select",
+      width: 100,
+      overHidden: true,
+      dicData: dicts.material_level,
+      props: { label: "dictLabel", value: "dictValue" },
+      rules: [
+        {
+          required: true,
+          message: "请选择工装级别",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "维修厂家",
+      prop: "manufacturer",
+      width: 100,
+      overHidden: true,
+      rules: [
+        {
+          required: true,
+          message: "请填写维修厂家",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "质检方案",
+      prop: "inspectDictValue",
+      search: true,
+      filterable: true,
+      type: "select",
+      width: 100,
+      overHidden: true,
+      dicData: dicts.quality_testing_plan,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "适用平台",
+      prop: "applicablePlatformsDictValue",
+      search: true,
+      filterable: true,
+      type: "select",
+      width: 100,
+      overHidden: true,
+      dicData: dicts.applicable_platforms,
+      props: { label: "dictLabel", value: "dictValue" },
+      rules: [
+        {
+          required: true,
+          message: "请选择适用平台",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "质量等级",
+      prop: "qualityLevelDictValue",
+      search: true,
+      width: 100,
+      overHidden: true,
+      filterable: true,
+      type: "select",
+      dicData: dicts.quality_grade,
+      props: { label: "dictLabel", value: "dictValue" },
+      rules: [
+        {
+          required: true,
+          message: "请选择质量等级",
+          trigger: "blur",
+        },
+      ],
+    },
+    {
+      label: "选用类型",
+      prop: "selectionDictValue",
+      search: true,
+      filterable: true,
+      width: 100,
+      overHidden: true,
+      type: "select",
+      dicData: dicts.selection_type,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    { label: "客户型号", prop: "customerModel", width: 100, overHidden: true },
+    {
+      label: "保质期(天)",
+      prop: "qualityGuaranteePeriod",
+      width: 100,
+      overHidden: true,
+      type: "number",
+      min: 0,
+    },
+    {
+      label: "封装方法",
+      prop: "packageDictValue",
+      search: true,
+      width: 100,
+      overHidden: true,
+      filterable: true,
+      type: "select",
+      dicData: dicts.packaging_method,
+      props: { label: "dictLabel", value: "dictValue" },
+    },
+    {
+      label: "筛选规范",
+      prop: "selectionSpec",
+      width: 150,
+      overHidden: true,
+      type: "textarea",
+      span: 18,
+    },
+
+    {
+      label: "备注",
+      prop: "remark",
+      width: 150,
+      overHidden: true,
+      type: "textarea",
+      span: 18,
+    },
+  ],
+});
+</script>

+ 5 - 5
src/views/base/materials/index.vue

@@ -241,14 +241,14 @@ option.value = Object.assign(option.value, {
       ],
     },
     {
-      label: "维修厂家",
+      label: "生产厂家",
       prop: "manufacturer",
       width: 100,
       overHidden: true,
       rules: [
         {
           required: true,
-          message: "请填写维修厂家",
+          message: "请填写生产厂家",
           trigger: "blur",
         },
       ],
@@ -364,12 +364,12 @@ option.value = Object.assign(option.value, {
       rules: [
         {
           required: true,
-          message: "是否工装",
+          message: "是否关重件",
           trigger: "blur",
         },
       ],
     },
-    {
+    /*{
       label: "是否工装",
       prop: "frock",
       search: true,
@@ -395,7 +395,7 @@ option.value = Object.assign(option.value, {
           trigger: "blur",
         },
       ],
-    },
+    },*/
     {
       label: "筛选规范",
       prop: "selectionSpec",

+ 28 - 7
src/views/storage/stock/index.vue

@@ -79,7 +79,7 @@ option.value = Object.assign(option.value, {
   delBtn: false,
   selection: true,
   column: [
-    {
+    /*{
       label: "入库单号",
       prop: "taskNo",
       search: true,
@@ -102,8 +102,8 @@ option.value = Object.assign(option.value, {
           trigger: "trigger",
         },
       ],
-    },
-    {
+    },*/
+    /*{
       label: "仓库编码",
       prop: "houseType",
       type: "select",
@@ -125,6 +125,27 @@ option.value = Object.assign(option.value, {
           trigger: "trigger",
         },
       ],
+    },*/
+    {
+      label: "物料类型",
+      prop: "taskNo",
+      type: "select",
+      search: true,
+      width: 90,
+      overHidden: true,
+      dicUrl:
+          dictDataUtil.request_url +"stock_material_type",
+      props: {
+        label: "dictLabel",
+        value: "dictValue",
+      },
+      rules: [
+        {
+          required: true,
+          message: "物料类型不能为空",
+          trigger: "trigger",
+        },
+      ],
     },
     {
       label: "料箱编号",
@@ -140,7 +161,7 @@ option.value = Object.assign(option.value, {
     },
     {
       label: "仓库坐标",
-      prop: "coordinate",
+      prop: "locationNo",
       editDisabled: true,
       rules: [
         {
@@ -151,18 +172,18 @@ option.value = Object.assign(option.value, {
       ],
     },
     {
-      label: "批次号",
+      label: "二维码",
       width: 120,
       overHidden: true,
       prop: "batchCode",
       search: true
     },
-    {
+    /*{
       label: "流转卡号",
       width: 130,
       overHidden: true,
       prop: "seqNo",
-    },
+    },*/
     {
       label: "物料名称",
       prop: "materialName",

+ 131 - 0
src/views/storage/wmsOrder/components/order-details.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"
+        @selection-change="selectionChange1"
+    >
+    </avue-crud>
+  </div>
+</template>
+<script setup>
+import {defineProps, ref} from "vue";
+import { useCrud } from "@/hooks/userCrud";
+import { useCommonStoreHook } from "@/store";
+import dictDataUtil from "@/common/configs/dictDataUtil";
+import { html2CanvasPrint } from "@/utils/common";
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const toPrintRef = ref(null);
+const test = () => {
+  isShowTable.value = true;
+  tableType.value = tableType.value == 1 ? 2 : 1;
+};
+const info = ref({})
+const props = defineProps({
+  orderInfo: {
+    type: Object,
+    default: () => {
+      return null;
+    }
+  }
+})
+const crudRef = ref(null); //crudRef.value 获取avue-crud对象
+
+watch(
+    () => props.workOrderInfo,
+    () => {
+      form.value.workOrderCode = props.workOrderInfo.workOrderCode
+      info.value = props.workOrderInfo
+      search.value.workOrderCode = props.workOrderInfo.workOrderCode
+      dataList();
+    }
+);
+// 传入一个url,后面不带/
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
+  useCrud({
+    src: "/api/v1/wmsOrder",
+  });
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
+
+// 设置表格列或者其他自定义的option
+option.value = Object.assign(option.value, {
+  delBtn: false,
+  selection: false,
+  search: false,
+  filterBtn: false,
+  columnBtn: false,
+  editBtn: false,
+  addBtn: false,
+  viewBtn: false,
+  menu: false,
+  column: [
+    {
+      label: "物料编号",
+      width: 130,
+      search: true,
+      overHidden: true,
+      prop: "materialNo",
+    },
+    {
+      label: "物料名称",
+      width:130,
+      search: true,
+      overHidden: true,
+      prop: "materialName",
+    },
+    {
+      label: "物料型号",
+      width:130,
+      overHidden: true,
+      prop: "spec",
+    },
+    {
+      label: "单位",
+      overHidden: true,
+      prop: "unit",
+    },
+    {
+      label: "库位",
+      overHidden: true,
+      prop: "locationNo",
+    },
+     {
+       label: "二维码",
+       prop: "batchCode",
+       width:150,
+       overHidden: true,
+       formatter:(val,value,label)=>{
+         if(val.seqNo){
+           return val.seqNo;
+         }else{
+           return val.batchCode
+         }
+       }
+     },
+     {
+       label: "数量",
+       prop: "num",
+     },
+  ],
+});
+
+onMounted(() => {
+  info.value = props.orderInfo
+  form.value.orderId = props.orderInfo.id
+  search.value.orderId = props.orderInfo.id
+  dataList();
+});
+</script>

+ 235 - 15
src/views/storage/wmsOrder/index.vue

@@ -15,27 +15,246 @@
         @size-change="dataList"
         @current-change="dataList"
     >
+      <template #menu-left="{ size }">
+        <el-button
+            type="primary"
+            icon="el-icon-primary"
+            :size="size"
+            @click="addVal"
+        >新增</el-button
+        >
+      </template>
+      <template #menu="{ size, row, index }">
+        <el-button
+            icon="el-icon-setting"
+            text
+            @click="showSeqPage(row)"
+            type="primary"
+            :size="size"
+        >出入库明细</el-button>
+      </template>
     </avue-crud>
+    <el-dialog
+        v-model="dialog4.visible"
+        :title="dialog4.title"
+        width="950px"
+        @close="dialog4.visible = false"
+    >
+      <order-details :orderInfo="infoObj" />
+    </el-dialog>
+    <el-dialog
+        v-model="dialog3.visible"
+        :title="dialog3.title"
+        width="1100px"
+        @close="dialog3.visible = false"
+    >
+      <el-form
+          ref="ruleFormRef"
+          label-width="90px"
+          :rules="rules"
+      >
+        <el-row :gutter="22" style="margin-top:5px;">
+          <el-col :span="11">
+            <el-form-item label="类型" prop="type">
+              <el-select
+                  v-model="form.type"
+                  placeholder="请选择"
+              >
+                <el-option
+                    v-for="option in fieldOptions"
+                    :key="option.value"
+                    :label="option.label"
+                    :value="option.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="11">
+            <el-form-item label="载具编号" prop="vehicleCode">
+              <el-input
+                  v-model="form.vehicleCode"
+                  placeholder="请输入载具编号"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="22" style="margin-top:5px;">
+          <el-col :span="11">
+            <el-form-item label="库位坐标" prop="locationNo">
+              <el-input
+                  v-model="form.locationNo"
+                  placeholder="请输入库位坐标"
+              />
+            </el-form-item>
+          </el-col>
+<!--          <el-col :span="11">
+            <el-form-item label="载具编号">
+              <el-input
+                  v-model="form.vehicleCode"
+                  placeholder="请输入载具编号"
+              />
+            </el-form-item>
+          </el-col>-->
+        </el-row>
+        <el-divider />
+        <el-text class="mx-1" size="large">物料详情</el-text>
+        <el-button type="primary" @click="addItem" icon="el-icon-plus" style="margin-left:15px;width:25px;height:25px;" circle />
+        <el-button type="danger" @click="minusItem" icon="el-icon-minus" style="margin-left:15px;width:25px;height:25px;" circle />
+        <el-row :gutter="22" style="margin-top:5px;" v-for="(item, index) in formDataList" :key="index">
+          <el-col :span="3">
+            <el-input
+                v-model="item.materialNo"
+                placeholder="请选择物料编号"
+                readonly
+                :onclick="choiceItem(item)"
+            />
+          </el-col>
+          <el-col :span="3"><el-input
+              v-model="item.materialName"
+              placeholder="请选择物料名称"
+              readonly
+          />
+          </el-col>
+          <el-col :span="4">
+            <el-input
+                v-model="item.spec"
+                placeholder="物料型号"
+                readonly
+            />
+          </el-col>
+          <el-col :span="2">
+            <el-select
+                v-model="item.materialType"
+                placeholder="请选择物料类别"
+            >
+              <el-option
+                  v-for="option in stock_material_type_list"
+                  :key="option.dictValue"
+                  :label="option.dictLabel"
+                  :value="option.dictValue"
+              />
+            </el-select>
+          </el-col>
+          <el-col :span="2">
+            <el-input
+                v-model="item.unit"
+                placeholder="单位"
+                readonly
+            />
+          </el-col>
+          <el-col :span="6">
+            <el-input
+                v-model="item.batchCode"
+                placeholder="二维码"
+            />
+          </el-col>
+          <el-col :span="2">
+            <el-input
+                v-model="item.num"
+                placeholder="数量"
+                min="0"
+                max="9999"
+                type="number"
+            />
+          </el-col>
+        </el-row>
+
+        <div class="dialog-footer" style="margin-top:20px" align="center">
+          <el-button type="primary" @click="handleSubmit">保 存</el-button>
+        </div>
+      </el-form>
+    </el-dialog>
+    <el-dialog
+        v-model="dialog2.visible"
+        :title="dialog2.title"
+        width="950px"
+        @close="dialog2.visible = false"
+    >
+      <choice-item-page @material-info="materialInfo" />
+    </el-dialog>
   </div>
 </template>
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
-import ButtonPermKeys from "@/common/configs/buttonPermission";
-
+import {queryDictDataByType} from "@/api/system/dict"
+import {wmsOrderAdd} from "@/api/storage"
 import { useCommonStoreHook } from "@/store";
-import dictDataUtil from "@/common/configs/dictDataUtil";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+const ruleFormRef = ref(ElForm);
 const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;
 };
-
+const showSeqPage = (info) => {
+  infoObj.value = info;
+  dialog4.visible = true;
+};
+const dialog3 = reactive({
+  title: "新增",
+  visible: false,
+});
+const dialog4 = reactive({
+  title: "出入库明细",
+  visible: false,
+});
+const rules = reactive({
+  vehicleCode: [{ required: true, message: "请选择载具", trigger: "blur" }],
+  type: [{ required: true, message: "请选择类型", trigger: "blur" }],
+  locationNo: [{ required: true, message: "请输入坐标", trigger: "blur" }],
+});
+const materialInfo = (value) => {
+  clickObj.value.materialNo = value.materialCode;
+  clickObj.value.materialName = value.materialName;
+  clickObj.value.spec = value.spec;
+  clickObj.value.unit = value.unitDictValue
+  dialog2.visible = false;
+};
+const dialog2 = reactive({
+  title: "物料选择",
+  visible: false,
+});
+const addVal = () =>{
+  dialog3.visible = true
+}
+const addItem =()=>{
+  typeIndex.value = 1
+  formDataList.value.push({})
+}
+const typeIndex = ref(0)
+const minusItem =()=>{
+  typeIndex.value = 0
+  formDataList.value.splice(formDataList.value.length - 1,1)
+}
+const clickObj = ref(null)
+const choiceItem =(item)=>{
+  if(typeIndex.value === 1){
+    dialog2.visible = true
+    clickObj.value = item
+  }
+}
+const fieldOptions = ref([{label: "入库",value: "1"},{label: "出库",value: "2"},{label: "退料",value: "3"}])
+const stock_material_type_list = ref()
+const formDataList = ref([]);
 // 传入一个url,后面不带/
 const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
   useCrud({
     src: "/api/v1/wmsOrder",
+    dataListUrl: "/api/v1/wmsOrder/pageDetails"
   });
+const handleSubmit = ()=>{
+  form.value.details = formDataList.value
+  wmsOrderAdd(form.value).then((res)=>{
+    if(res.code ==='200'){
+      ElMessage.success("操作成功");
+      dataList();
+      form.value = null
+      formDataList.value=[]
+      dialog3.visible = false
+    }
+  })
+}
+const infoObj = ref(null)
 const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
@@ -47,10 +266,10 @@ option.value = Object.assign(option.value, {
   selection: false,
   viewBtn: false,
   editBtn: false,
-  menu: false,
+  menu: true,
   addBtn: false,
   column: [
-    {
+    /*{
       label: "任务单号",
       prop: "taskNo",
       search: true,
@@ -61,7 +280,7 @@ option.value = Object.assign(option.value, {
       label: "计划单号",
       prop: "planNo",
       search: true,
-    },
+    },*/
     {
       label: "类型",
       prop: "type",
@@ -71,11 +290,10 @@ option.value = Object.assign(option.value, {
     },
     {
       label: "载具编号",
-      width: 130,
       overHidden: true,
       prop: "vehicleCode",
     },
-    {
+    /*{
       label: "物料编号",
       width: 130,
       search: true,
@@ -99,13 +317,13 @@ option.value = Object.assign(option.value, {
       label: "单位",
       overHidden: true,
       prop: "unit",
-    },
+    },*/
     {
       label: "库位",
       overHidden: true,
       prop: "locationNo",
     },
-    {
+   /* {
       label: "二维码",
       prop: "batchCode",
       width:150,
@@ -121,8 +339,8 @@ option.value = Object.assign(option.value, {
     {
       label: "数量",
       prop: "num",
-    },
-    {
+    },*/
+    /*{
       label: "状态",
       prop: "state",
       type: "select",
@@ -134,11 +352,10 @@ option.value = Object.assign(option.value, {
         label: "dictLabel",
         value: "dictValue",
       }
-    },
+    },*/
     {
       label: "操作时间",
       prop: "created",
-      width: 180,
       display: false
     },
     {
@@ -153,5 +370,8 @@ onMounted(() => {
   // console.log("crudRef", crudRef)
   //search.value.type = '2'
   dataList();
+  queryDictDataByType("stock_material_type").then((res)=>{
+    stock_material_type_list.value = res.data
+  })
 });
 </script>