update 原料上传
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								public/importTemplates/productImport.xlsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/importTemplates/productImport.xlsx
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -39,8 +39,8 @@
 | 
			
		||||
    <script>
 | 
			
		||||
    // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
 | 
			
		||||
    // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
 | 
			
		||||
    window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
 | 
			
		||||
    // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
 | 
			
		||||
    // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
 | 
			
		||||
    window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
 | 
			
		||||
    // window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/pms-am'; // xv
 | 
			
		||||
    </script>
 | 
			
		||||
  <% } %>
 | 
			
		||||
 
 | 
			
		||||
@@ -56,10 +56,13 @@ export default function () {
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      button: {
 | 
			
		||||
        type: 'plain',
 | 
			
		||||
        type: 'primary',
 | 
			
		||||
        name: '新增',
 | 
			
		||||
        permission: 'pms:equipment:save'
 | 
			
		||||
      }
 | 
			
		||||
      },
 | 
			
		||||
      bind: {
 | 
			
		||||
        plain: true,
 | 
			
		||||
      },
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,43 +9,24 @@
 | 
			
		||||
    <!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> -->
 | 
			
		||||
    <BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
 | 
			
		||||
 | 
			
		||||
    <BaseListTable
 | 
			
		||||
      v-loading="tableLoading"
 | 
			
		||||
      :table-config="tableConfig.table"
 | 
			
		||||
      :column-config="tableConfig.column"
 | 
			
		||||
      :table-data="dataList"
 | 
			
		||||
      @operate-event="handleOperate"
 | 
			
		||||
      @load-sub="handleLoadSub"
 | 
			
		||||
      :refresh-layout-key="refreshLayoutKey"
 | 
			
		||||
    />
 | 
			
		||||
    <BaseListTable v-loading="tableLoading" :table-config="tableConfig.table" :column-config="tableConfig.column"
 | 
			
		||||
      :table-data="dataList" @operate-event="handleOperate" @load-sub="handleLoadSub"
 | 
			
		||||
      :refresh-layout-key="refreshLayoutKey" />
 | 
			
		||||
 | 
			
		||||
    <el-pagination
 | 
			
		||||
      class="mt-5 flex justify-end"
 | 
			
		||||
      @size-change="handleSizeChange"
 | 
			
		||||
      @current-change="handlePageChange"
 | 
			
		||||
      :current-page.sync="page"
 | 
			
		||||
      :page-sizes="[1, 5, 10, 20, 50, 100]"
 | 
			
		||||
      :page-size="size"
 | 
			
		||||
      :total="totalPage"
 | 
			
		||||
      layout="total, sizes, prev, pager, next, jumper"
 | 
			
		||||
    ></el-pagination>
 | 
			
		||||
    <el-pagination class="mt-5 flex justify-end" @size-change="handleSizeChange" @current-change="handlePageChange"
 | 
			
		||||
      :current-page.sync="page" :page-sizes="[1, 5, 10, 20, 50, 100]" :page-size="size" :total="totalPage"
 | 
			
		||||
      layout="total, sizes, prev, pager, next, jumper"></el-pagination>
 | 
			
		||||
    <!-- :current-page.sync="currentPage"
 | 
			
		||||
			:page-size.sync="pageSize" -->
 | 
			
		||||
 | 
			
		||||
    <DialogWithMenu
 | 
			
		||||
      ref="edit-dialog"
 | 
			
		||||
      v-if="dialogType === DIALOG_WITH_MENU"
 | 
			
		||||
      :dialog-visible.sync="dialogVisible"
 | 
			
		||||
      :configs="dialogConfigs"
 | 
			
		||||
      @refreshDataList="handleRefreshDatalist"
 | 
			
		||||
    />
 | 
			
		||||
    <DialogWithMenu ref="edit-dialog" v-if="dialogType === DIALOG_WITH_MENU" :dialog-visible.sync="dialogVisible"
 | 
			
		||||
      :configs="dialogConfigs" @refreshDataList="handleRefreshDatalist" />
 | 
			
		||||
 | 
			
		||||
    <DialogJustForm
 | 
			
		||||
      ref="add-sub-dialog"
 | 
			
		||||
      :dialog-visible.sync="subdialogVisible"
 | 
			
		||||
      :configs="subdialogConfigs"
 | 
			
		||||
      @refreshDataList="handleRefreshDatalist"
 | 
			
		||||
    />
 | 
			
		||||
    <DialogJustForm ref="add-sub-dialog" :dialog-visible.sync="subdialogVisible" :configs="subdialogConfigs"
 | 
			
		||||
      @refreshDataList="handleRefreshDatalist" />
 | 
			
		||||
 | 
			
		||||
    <DialogUpload ref="upload-dialog" v-if="uploadDialogVisible" title="导入原料" filename="bomTemplate.xlsx"
 | 
			
		||||
      @refresh-list="getList" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@@ -54,6 +35,7 @@ import BaseListTable from "./BaseListTable.vue";
 | 
			
		||||
import BaseSearchForm from "@/components/BaseSearchForm.vue";
 | 
			
		||||
import DialogWithMenu from "@/components/DialogWithMenu.vue";
 | 
			
		||||
import DialogJustForm from "./DialogJustForm.vue";
 | 
			
		||||
import DialogUpload from "@/components/DialogUpload.vue";
 | 
			
		||||
 | 
			
		||||
const DIALOG_WITH_MENU = "DialogWithMenu";
 | 
			
		||||
const DIALOG_JUST_FORM = "DialogJustForm";
 | 
			
		||||
@@ -61,7 +43,7 @@ const dictList = JSON.parse(localStorage.getItem("dictList"));
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "ListViewWithHead",
 | 
			
		||||
  components: { BaseSearchForm, BaseListTable, DialogWithMenu, DialogJustForm },
 | 
			
		||||
  components: { BaseSearchForm, BaseListTable, DialogWithMenu, DialogJustForm, DialogUpload },
 | 
			
		||||
  props: {
 | 
			
		||||
    tableConfig: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
@@ -104,6 +86,7 @@ export default {
 | 
			
		||||
      dataList: [],
 | 
			
		||||
      tableLoading: false,
 | 
			
		||||
      subdialogVisible: false,
 | 
			
		||||
      uploadDialogVisible: false,
 | 
			
		||||
      subdialogConfigs: {
 | 
			
		||||
        form: {
 | 
			
		||||
          rows: [
 | 
			
		||||
@@ -214,9 +197,9 @@ export default {
 | 
			
		||||
      const params = queryParams
 | 
			
		||||
        ? { ...queryParams, page: this.page, limit: this.size }
 | 
			
		||||
        : {
 | 
			
		||||
            page: this.page,
 | 
			
		||||
            limit: this.size,
 | 
			
		||||
          };
 | 
			
		||||
          page: this.page,
 | 
			
		||||
          limit: this.size,
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
      if (!queryParams && this.listQueryExtra.length) {
 | 
			
		||||
        this.listQueryExtra.map((name) => {
 | 
			
		||||
@@ -228,7 +211,7 @@ export default {
 | 
			
		||||
        .get(this.urls.page, {
 | 
			
		||||
          params: {
 | 
			
		||||
            ...params,
 | 
			
		||||
            parentId: "0",
 | 
			
		||||
            // parentId: "0",
 | 
			
		||||
          },
 | 
			
		||||
        })
 | 
			
		||||
        .then(({ data: res }) => {
 | 
			
		||||
@@ -280,7 +263,7 @@ export default {
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
            })
 | 
			
		||||
            .catch((err) => {});
 | 
			
		||||
            .catch((err) => { });
 | 
			
		||||
        }
 | 
			
		||||
        case "edit": {
 | 
			
		||||
          this.openDialog(data); /** data is ==> id */
 | 
			
		||||
@@ -318,7 +301,16 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleRefreshDatalist() {
 | 
			
		||||
      location.reload();
 | 
			
		||||
      // location.reload();
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    openUploadDialog() {
 | 
			
		||||
      this.uploadDialogVisible = true;
 | 
			
		||||
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs["upload-dialog"].init();
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    handleBtnClick({ btnName, payload }) {
 | 
			
		||||
@@ -331,6 +323,9 @@ export default {
 | 
			
		||||
          this.getList(payload);
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
        case "导入":
 | 
			
		||||
          this.openUploadDialog();
 | 
			
		||||
          break;
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -5,18 +5,18 @@ import { timeFilter, dictFilter } from "@/utils/filters";
 | 
			
		||||
 | 
			
		||||
export default function () {
 | 
			
		||||
  const tableProps = [
 | 
			
		||||
    { type: 'index', label: '序号' },
 | 
			
		||||
    { prop: "code", label: "原料编码" },
 | 
			
		||||
    { prop: "description", label: "原料描述", },
 | 
			
		||||
    { prop: "name", label: "原料名称" },
 | 
			
		||||
    { prop: "typeDictValue", label: "类型", filter: dictFilter("material_category") }, // subcomponent: {/** TODO: create a new component for this option */} },
 | 
			
		||||
    { type: "index", label: "序号" },
 | 
			
		||||
    { width: 90, prop: "code", label: "原料编码" },
 | 
			
		||||
    { width: 240, prop: "description", label: "原料描述" },
 | 
			
		||||
    { width: 90, prop: "name", label: "原料名称" },
 | 
			
		||||
    { width: 90, prop: "typeDictValue", label: "类型", filter: dictFilter("material_category") }, // subcomponent: {/** TODO: create a new component for this option */} },
 | 
			
		||||
    { prop: "baseMaterialCode", label: "基础原料编码" },
 | 
			
		||||
    { prop: "baseMaterialDescription", label: "基础原料描述" },
 | 
			
		||||
    // { prop: "type", label: "原料类型" },
 | 
			
		||||
    { prop: "density", label: "堆积密度" },
 | 
			
		||||
    { width: 90, prop: "density", label: "堆积密度" },
 | 
			
		||||
    // { prop: "brandsOwner", label: "品牌" },
 | 
			
		||||
    { prop: "dosLow", label: "加料下限" },
 | 
			
		||||
    { prop: "dosHigh", label: "加料上限" },
 | 
			
		||||
    { width: 90, prop: "dosLow", label: "加料下限" },
 | 
			
		||||
    { width: 90, prop: "dosHigh", label: "加料上限" },
 | 
			
		||||
    // { prop: "description", label: "详情", subcomponent: TableTextComponent },
 | 
			
		||||
    // { prop: "remark", label: "中文描述" },
 | 
			
		||||
    { prop: "createTime", label: "添加时间", filter: timeFilter },
 | 
			
		||||
@@ -30,7 +30,8 @@ export default function () {
 | 
			
		||||
      options: [
 | 
			
		||||
        // { name: "add-sub", permission: "pms:material:save" },
 | 
			
		||||
        { name: "edit", label: "编辑", icon: "edit-outline" },
 | 
			
		||||
        { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:material:save" },],
 | 
			
		||||
        { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:material:save" },
 | 
			
		||||
      ],
 | 
			
		||||
    },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
@@ -58,6 +59,16 @@ export default function () {
 | 
			
		||||
        plain: true,
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      button: {
 | 
			
		||||
        type: "success",
 | 
			
		||||
        name: "导入",
 | 
			
		||||
        permission: "",
 | 
			
		||||
      },
 | 
			
		||||
      bind: {
 | 
			
		||||
        plain: true,
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
@@ -90,7 +101,6 @@ export default function () {
 | 
			
		||||
            elparams: { placeholder: "请输入原料编码" },
 | 
			
		||||
          },
 | 
			
		||||
          { input: true, label: "原料描述", prop: "description", elparams: { placeholder: "原料描述" } },
 | 
			
		||||
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          // {
 | 
			
		||||
@@ -135,8 +145,8 @@ export default function () {
 | 
			
		||||
            label: "基础原料",
 | 
			
		||||
            prop: "baseMaterialId",
 | 
			
		||||
            options: [],
 | 
			
		||||
            optionLabel: 'code',
 | 
			
		||||
            fetchData: () => this.$http.get('/pms/baseMaterial/page', { params: { limit: 999, page: 1, key: '' } }),
 | 
			
		||||
            optionLabel: "code",
 | 
			
		||||
            fetchData: () => this.$http.get("/pms/baseMaterial/page", { params: { limit: 999, page: 1, key: "" } }),
 | 
			
		||||
            elparams: { placeholder: "请选择基础原料" },
 | 
			
		||||
          },
 | 
			
		||||
          { input: true, label: "堆积密度(g/cm³)", prop: "density", elparams: { placeholder: "堆积密度" } },
 | 
			
		||||
@@ -155,7 +165,7 @@ export default function () {
 | 
			
		||||
            prop: "dosLow",
 | 
			
		||||
            rules: [
 | 
			
		||||
              { required: true, message: "必填项不能为空", trigger: "blur" },
 | 
			
		||||
              { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) },
 | 
			
		||||
              { type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
 | 
			
		||||
            ],
 | 
			
		||||
            elparams: { placeholder: "请输入加料下限" },
 | 
			
		||||
          },
 | 
			
		||||
@@ -165,7 +175,7 @@ export default function () {
 | 
			
		||||
            prop: "dosHigh",
 | 
			
		||||
            rules: [
 | 
			
		||||
              { required: true, message: "必填项不能为空", trigger: "blur" },
 | 
			
		||||
              { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) },
 | 
			
		||||
              { type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) },
 | 
			
		||||
            ],
 | 
			
		||||
            elparams: { placeholder: "请输入加料上限" },
 | 
			
		||||
          },
 | 
			
		||||
@@ -206,7 +216,7 @@ export default function () {
 | 
			
		||||
      // extraParams: ['stepId'],
 | 
			
		||||
      extraParams: "materialId",
 | 
			
		||||
      props: [
 | 
			
		||||
        { type: 'index', label: '序号' },
 | 
			
		||||
        { type: "index", label: "序号" },
 | 
			
		||||
        { prop: "name", label: "属性名", isEditField: true },
 | 
			
		||||
        { prop: "value", label: "属性值", isEditField: true },
 | 
			
		||||
        { prop: "createTime", label: "添加时间", filter: timeFilter },
 | 
			
		||||
@@ -231,15 +241,9 @@ export default function () {
 | 
			
		||||
      extraParam: "materialId",
 | 
			
		||||
      forceAttachCode: true,
 | 
			
		||||
      rows: [
 | 
			
		||||
        [
 | 
			
		||||
          { input: true, label: "属性名", prop: "name", elparams: { placeholder: "请输入属性名" } }
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          { input: true, label: "属性值", prop: "value", elparams: { placeholder: "请输入属性值" } }
 | 
			
		||||
        ],
 | 
			
		||||
        [
 | 
			
		||||
          { input: true, label: "备注", prop: "remark", elparams: { placeholder: "请输入备注" } },
 | 
			
		||||
        ]
 | 
			
		||||
        [{ input: true, label: "属性名", prop: "name", elparams: { placeholder: "请输入属性名" } }],
 | 
			
		||||
        [{ input: true, label: "属性值", prop: "value", elparams: { placeholder: "请输入属性值" } }],
 | 
			
		||||
        [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "请输入备注" } }],
 | 
			
		||||
      ],
 | 
			
		||||
      operations: [
 | 
			
		||||
        { name: "add", label: "保存", type: "primary", permission: "pms:materialArrt:save", showOnEdit: false },
 | 
			
		||||
@@ -266,6 +270,8 @@ export default function () {
 | 
			
		||||
      tree: "/pms/material/tree",
 | 
			
		||||
      subase: "/pms/materialArrt",
 | 
			
		||||
      subpage: "/pms/materialArrt/page",
 | 
			
		||||
      importUrl: "/pms/material/importExcel",
 | 
			
		||||
      templateUrl: "/importTemplates/materialImport.xlsx",
 | 
			
		||||
      // more...
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
 
 | 
			
		||||
@@ -57,17 +57,23 @@ export default function () {
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      button: {
 | 
			
		||||
        type: "plain",
 | 
			
		||||
        type: "primary",
 | 
			
		||||
        name: "新增",
 | 
			
		||||
        permission: "pms:product:save",
 | 
			
		||||
      },
 | 
			
		||||
      bind: {
 | 
			
		||||
        plain: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      button: {
 | 
			
		||||
        type: "plain",
 | 
			
		||||
        type: "success",
 | 
			
		||||
        name: "导入",
 | 
			
		||||
        permission: "",
 | 
			
		||||
      },
 | 
			
		||||
      bind: {
 | 
			
		||||
        plain: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
@@ -220,7 +226,7 @@ export default function () {
 | 
			
		||||
      subase: "/pms/productArrt",
 | 
			
		||||
      subpage: "/pms/productArrt/page",
 | 
			
		||||
      importUrl: "/pms/product/import",
 | 
			
		||||
      templateUrl: '/importTemplates/materialImport.xlsx'
 | 
			
		||||
      templateUrl: '/importTemplates/productImport.xlsx'
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user