wanshenmean
2024-09-23 798a97899b961baf7099bc3421d3ad926b1298da
添加组盘,明细数据VUE组件
已修改15个文件
已添加4个文件
798 ■■■■ 文件已修改
Code Management/WMS/WIDESEA_WMSClient/package.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/buttons.js 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/ViewGrid/ViewGridDetail.vue 283 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/ViewGrid/methods.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/ViewGrid/methodsDetail.jsx 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/VolTable.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/material/Dt_MaterielInfo.vue 152 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/DtBoxing.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/fileList.bin 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_MenuService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_MenuService.cs 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoService.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_MenuController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/bin/Debug/net6.0/appsettings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/package.json
@@ -56,5 +56,6 @@
    "vite-plugin-require-transform": "^1.0.21",
    "vitest": "^0.29.1",
    "vue-tsc": "^1.2.0"
  }
  },
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
Code Management/WMS/WIDESEA_WMSClient/src/api/buttons.js
@@ -5,8 +5,8 @@
    icon: 'el-icon-search',
    class: '',
    type: 'primary',
    onClick: function() {
      this.search();
    onClick: function () {
      this.search()
    }
  },
  {
@@ -14,36 +14,36 @@
    icon: 'el-icon-plus',
    value: 'Add',
    class: '',
     plain:true,
   // type: 'success',
    color:"#67C23A",
    plain: true,
    type: 'success',
    // color: '#67C23A',
    // plain:true,
    onClick: function() {
      this.add();
    onClick: function () {
      this.add()
    }
  },
  {
    name: '编辑',
    icon: 'el-icon-edit',
    value: 'Update',
     plain:true,
    plain: true,
    class: '',
    color:"#79bbff",
    color: '#79bbff',
    type: 'primary',
    onClick: function() {
      this.edit();
    onClick: function () {
      this.edit()
    }
  },
  {
    name: '删除',
    icon: 'el-icon-delete',
    class: '',
    plain:true,
    plain: true,
    value: 'Delete',
    type: 'danger',
    color:"#F56C6C",
    onClick: function() {
      this.del();
    color: '#F56C6C',
    onClick: function () {
      this.del()
    }
  },
  {
@@ -53,8 +53,8 @@
    value: 'Audit',
    plain: true,
    type: 'primary',
    onClick: function() {
      this.audit();
    onClick: function () {
      this.audit()
    }
  },
  {
@@ -65,11 +65,11 @@
    // plain: true,
    // type: 'danger',
    // color:"rgb(254, 240, 240)",
    plain:true,
    plain: true,
    // type: 'success',
     color:"#67C23A",
    onClick: function() {
      this.antiAudit();
    color: '#67C23A',
    onClick: function () {
      this.antiAudit()
    }
  },
  {
@@ -79,8 +79,8 @@
    type: 'success',
    plain: true,
    value: 'Import',
    onClick: function() {
      this.import();
    onClick: function () {
      this.import()
    }
  },
  {
@@ -89,8 +89,8 @@
    type: 'primary',
    plain: true,
    value: 'Export',
    onClick: function() {
      this.export();
    onClick: function () {
      this.export()
    }
  },
  {
@@ -98,12 +98,12 @@
    icon: 'el-icon-printer',
    type: 'primary',
    plain: true,
    color:"#529b2e",
    color: '#529b2e',
    value: 'Print',
    onClick: function() {
      this.printClick();
    onClick: function () {
      this.printClick()
    }
  }
];
]
export default buttons;
export default buttons
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/ViewGrid/ViewGridDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,283 @@
<template>
    <div class="layout-container">
        <div class="view-container">
            <div class="grid-search">
                <div class="fiexd-search-box" v-show="true">
                    <vol-form ref="searchForm" style="padding: 0 15px" :label-width="100" :formRules="searchFormOptions"
                        :formFields="searchFormFields">
                    </vol-form>
                    <div v-if="fiexdSearchForm" class="fs-line"></div>
                </div>
                <div class="view-header">
                    <div class="desc-text">
                        <i class="el-icon-s-grid" />
                        <span>{{ title }}</span>
                    </div>
                    <div class="notice">
                        <a class="text" title="{{title}}"></a>
                    </div>
                    <div class="btn-group">
                        <template :key="bIndex" v-for="(btn, bIndex) in Mybuttons.slice(0, 6)">
                            <el-button :type="btn.type" size="small" :dark="btn.dark" :plain="btn.plain"
                                @click="changeDropdown(btn.name)">
                                <i :class="btn.icon"></i>
                                {{ btn.name }}
                            </el-button>
                        </template>
                        <el-dropdown size="small" @click="changeDropdown"
                            v-if="Mybuttons.length > 5">
                            <el-button type="primary" plain size="small">
                                æ›´å¤š<i class="el-icon-arrow-down el-icon--right"></i>
                            </el-button>
                            <template #dropdown>
                                <el-dropdown-menu>
                                    <el-dropdown-item @click="changeDropdown(item.name)" :name="item.name"
                                        v-show="!item.hidden" v-for="(item, dIndex) in Mybuttons.slice(6)" :key="dIndex">
                                        <i :class="item.icon"></i>
                                        {{ item.name }}
                                    </el-dropdown-item>
                                </el-dropdown-menu>
                            </template>
                        </el-dropdown>
                    </div>
                </div>
            </div>
            <div class="grid-container">
                <el-table ref="table" stripe :data="tableData" :height="heigth" style="width: 100%" border
                    @selection-change="selectionChange">
                    <el-table-column type="selection" width="55" />
                    <el-table-column prop="order_id" label="主键" v-if="false"></el-table-column>
                    <el-table-column type="expand">
                        <template #default="props">
                            <h4>明细数据</h4>
                            <div m="4">
                                <el-table stripe :data="props.row.boxingInfoDetails" max-height="400"
                                    style="width: 100%" border>
                                    <el-table-column label="序号" type="index" fixed="left" width="55"></el-table-column>
                                    <el-table-column :key="index" v-for="(item, index) in detailColumns"
                                        :label="item.title" :prop="item.field" :width="item.width"
                                        show-overflow-tooltip></el-table-column>
                                </el-table>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column v-for="(item, index) in columns" :key="index" :label="item.title"
                        :prop="item.field" sortable="true" show-overflow-tooltip>
                        <template #default="scope" v-if="item.type == 'tag'">
                            <el-tag size="small">
                                {{ getDictionary(scope.row, item) }}
                            </el-tag>
                        </template>
                    </el-table-column>
                </el-table>
                <template v-if="true">
                    <div class="block pagination" key="pagination-01" style="display: flex">
                        <div style="flex: 1"></div>
                        <el-pagination key="pagination-02" @size-change="handleSizeChange"
                            @current-change="handleCurrentChange" :current-page="currentPage1.page"
                            :page-sizes="currentPage1.sizes" :page-size="currentPage1.size"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="currentPage1.total"></el-pagination>
                    </div>
                </template>
            </div>
        </div>
    </div>
</template>
<script>
import VolForm from "../VolForm.vue";
import VolBox from "../VolBox.vue";
import VolTable from "../VolTable.vue";
import buttons from "@/api/buttons";
import methodss from './methodsDetail.jsx';
export default {
    components: {
        'vol-form': VolForm,
        'vol-table': VolTable,
        'vol-box': VolBox
    },
    name: 'CustomTableComponent',
    data() {
        return {
            tableData: [],
            Mybuttons: [],
            currentPage1: {
                sort: "",
                order: "desc",
                Foots: "",
                total: 0,
                // 2020.08.29增加自定义分页条大小
                sizes: [30, 60, 100, 120],
                size: 30, // é»˜è®¤åˆ†é¡µå¤§å°
                Wheres: [],
                page: 1,
                rows: 30,
            },
            selectRows: [],
        };
    },
    props: {
        url: String,
        title: String,
        columns: {
            type: Array,
            default: []
        },
        detailColumns: Array,
        searchFormOptions: Object,
        searchFormFields: Array,
        dropdownItems: Array,
        heigth: String,
        table: String,
    },
    methods: {
        ...methodss.methods,
        ...methodss.data,
        changeDropdown(btnName, v1) {
            let button = this.dropdownItems.filter((x) => {
                return x.name == btnName
            })
            if (button && button.length > 0) {
                button[0].onClick.apply(this)
            }
        },
        handleSizeChange(val) {
            this.currentPage1.pageSize = val;
        },
        handleCurrentChange(val) {
            this.currentPage1.currentPage = val;
        },
        getPageData() {
            // èŽ·å–åˆ†é¡µæ•°æ®
            var query = this.getSearchParameters();
            let param = {
                page: this.currentPage1.page,
                rows: this.currentPage1.rows,
                sort: this.currentPage1.sort,
                order: this.currentPage1.order,
                wheres: "", // æŸ¥è¯¢æ¡ä»¶ï¼Œæ ¼å¼ä¸º[{ name: "字段", value: "xx" }]
            };
            param = Object.assign(param, query);
            param.wheres = JSON.stringify(param.wheres);
            this.http.post(this.url, param, "查询中").then((x) => {
                this.tableData = x.rows;
                this.currentPage1.total = x.total;
            });
        },
        search() {
            this.getPageData();
        },
        getSearchParameters() {
            //获取查询参数
            let query = { wheres: [] };
            for (const key in this.searchFormFields) {
                let value = this.searchFormFields[key];
                if (this.emptyValue(value)) continue;
                if (typeof value == "number") {
                    value = value + "";
                }
                let displayType = this.getSearchItem(key);
                //联级只保留选中节点的最后一个值
                if (displayType == "cascader") {
                    //查询下面所有的子节点,如:选中的是父节点,应该查询下面所有的节点数据--待完
                    value = value.length ? value[value.length - 1] + "" : "";
                }
                //2021.05.02增加区间查询
                if (
                    typeof value == "string" ||
                    ["date", "datetime", "range"].indexOf(displayType) == -1
                ) {
                    query.wheres.push({
                        name: key,
                        value:
                            typeof value == "string" ? (value + "").trim() : value.join(","),
                        displayType: displayType,
                    });
                    continue;
                }
                for (let index = 0; index < value.length; index++) {
                    if (!this.emptyValue(value[index])) {
                        query.wheres.push({
                            name: key,
                            value: (value[index] + "").trim(),
                            displayType: (() => {
                                if (["date", "datetime", "range"].indexOf(displayType) != -1) {
                                    return index ? "lessorequal" : "thanorequal";
                                }
                                return displayType;
                            })(),
                        });
                    }
                }
            }
            return query;
        },
        getSearchItem(field) {
            //获取查询的参数
            let data;
            for (let index = 0; index < this.searchFormOptions.length; index++) {
                if (data) return data.type;
                const item = this.searchFormOptions[index];
                data = item.find((x) => {
                    return x.field == field;
                });
            }
            return (data || {}).type;
        },
        emptyValue(value) {
            if (typeof value == "string" && value.trim() === "") {
                return true;
            }
            if (value instanceof Array && !value.length) {
                return true;
            }
            return value === null || value === undefined || value === "";
        },
        filterPermission(tableName, permission) {
            //2021.03.19判断是否有某个表的按钮权限
            //:["Search","Add","Delete","Update","Import","Export","Upload","Audit"]
            const _result = (this.$store.state.permission || []).find((x) => {
                return x.url == '/' + tableName
            })
            return _result
        },
        getButtons() {
            console.log(buttons);
            buttons.forEach(element => {
                this.dropdownItems.push(element);
            });
        }
    },
    created() {
        this.getPageData();
        let permission = this.filterPermission(this.table);
        console.log(permission);
        this.getButtons();
        this.Mybuttons = this.dropdownItems.filter(item => permission.permission.includes(item.value));
    }
};
</script>
<style>
@import "./ViewGrid.less";
.pagination {
    text-align: right;
    padding: 2px 28px;
    border: 1px solid #eee;
    border-top: 0px;
}
</style>
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/ViewGrid/methods.jsx
@@ -1700,7 +1700,8 @@
      }
    }
  },
  setFormReadonly(readonly) {//快速设置表单与明细表是否只读
  setFormReadonly(readonly) {
    //快速设置表单与明细表是否只读
    this.editFormOptions.forEach((x) => {
      x.forEach((ops) => {
        ops.readonly = !!readonly
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/ViewGrid/methodsDetail.jsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
let methods = {
  add() {
    this.$Message.success('点击了添加按钮')
  },
  edit() {
    let rows = this.getSelected()
    if (rows.length == 0) {
      return this.$Message.error('请选择要编辑的行!')
    }
    this.$Message.success('点击了编辑按钮')
  },
  del() {
    let rows = this.getSelected()
    if (rows.length == 0) {
      return this.$Message.error('请选择要删除的行!')
    }
    this.$Message.success('点击了删除按钮')
  },
  getSelected() {
    return this.selectRows
  },
  selectionChange(selection) {
    // console.log(selection);
    // é€‰æ‹©è¡Œäº‹ä»¶,只有单选才触发
    this.selectRows = selection
    if (this.single) {
      if (selection.length == 1) {
        this.$emit('rowChange', selection[0])
      }
      if (selection.length > 1) {
        let _row = selection[selection.length - 1]
        this.$refs.table.toggleRowSelection(selection[0])
        this.selectRows = [_row]
      }
    }
    // å°†selectionchange暴露出去
    this.$emit('selectionChange', selection)
  }
}
export default {
  methods
}
Code Management/WMS/WIDESEA_WMSClient/src/components/basic/VolTable.vue
@@ -59,7 +59,7 @@
              </div>
              <span v-else-if="columnChildren.type == 'date'">{{
                formatterDate(scopeChildren.row, columnChildren)
                }}</span>
              }}</span>
              <template v-else>
                {{ scopeChildren.row[columnChildren.field] }}
              </template>
@@ -71,7 +71,8 @@
          <!-- å¯ç”¨åŒå‡»ç¼–辑功能,带编辑功能的不会渲染下拉框文本背景颜色 -->
          <!-- @click="rowBeginEdit(scope.$index,cindex)" -->
          <!-- 2021.09.21增加编辑时对readonly属性判断 -->
          <template v-else-if="column.edit && !column.readonly && ['file', 'img', 'excel'].indexOf(column.edit.type) != -1">
          <template
            v-else-if="column.edit && !column.readonly && ['file', 'img', 'excel'].indexOf(column.edit.type) != -1">
            <div style="display:flex;align-items: center;" @click.stop>
              <i v-if="!column.showUpload || column.showUpload(scope.row, column)"
                style="padding: 3px;margin-right: 10px;color:#8f9293;cursor: pointer;"
@@ -99,37 +100,37 @@
                <!-- 2020.07.24增加日期onChange事件 -->
                <el-date-picker clearable size="default" style="width: 100%"
                  v-if="['date', 'datetime'].indexOf(column.edit.type) != -1" v-model="scope.row[column.field]" @change="(val) => {
                      column.onChange &&
                        column.onChange(scope.row, column, val);
                    }
                    column.onChange &&
                      column.onChange(scope.row, column, val);
                  }
                    " :type="column.edit.type" :placeholder="column.placeholder || column.title"
                  :disabledDate="(val) => getDateOptions(val, column)" :value-format="getDateFormat(column)"
                  :disabled="initColumnDisabled(scope.row, column)">
                </el-date-picker>
                <el-time-picker clearable size="default" style="width: 100%" v-else-if="column.edit.type == 'time'"
                  v-model="scope.row[column.field]" @change="(val) => {
                      column.onChange &&
                        column.onChange(scope.row, column, val);
                    }
                    column.onChange &&
                      column.onChange(scope.row, column, val);
                  }
                    " :placeholder="column.placeholder || column.title" :value-format="column.format || 'HH:mm:ss'"
                  :disabled="initColumnDisabled(scope.row, column)">
                </el-time-picker>
                <el-switch v-else-if="column.edit.type == 'switch'" v-model="scope.row[column.field]"
                  active-color="#0f84ff" inactive-color="rgb(194 194 194)" active-text="是" inactive-text="否"
                  inline-prompt @change="(val) => {
                      switchChange(val, scope.row, column);
                    }
                    switchChange(val, scope.row, column);
                  }
                    " :active-value="typeof scope.row[column.field] == 'boolean'
                      ? true
                      : typeof scope.row[column.field] == 'string'
                        ? '1'
                        : 1
                    " :inactive-value="typeof scope.row[column.field] == 'boolean'
                      " :inactive-value="typeof scope.row[column.field] == 'boolean'
                      ? false
                      : typeof scope.row[column.field] == 'string'
                        ? '0'
                        : 0
                    " :disabled="initColumnDisabled(scope.row, column)">
                      " :disabled="initColumnDisabled(scope.row, column)">
                </el-switch>
                <template v-else-if="
                  ['select', 'selectList'].indexOf(column.edit.type) != -1
@@ -146,8 +147,8 @@
                  </el-select-v2>
                  <el-select size="default" style="width: 100%" v-else v-model="scope.row[column.field]" :filterable="column.filter || column.bind.data.length > 10
                      ? true
                      : false
                    ? true
                    : false
                    " :multiple="column.edit.type == 'select' ? false : true"
                    :placeholder="column.placeholder || column.title" :allow-create="column.autocomplete" @change="
                      column.onChange && column.onChange(scope.row, column)
@@ -161,8 +162,9 @@
                  v-else-if="column.edit.type == 'treeSelect' || column.edit.type == 'cascader'"
                  v-model="scope.row[column.field]" :data="column.bind.data"
                  :multiple="column.multiple === undefined ? true : column.multiple" :render-after-expand="false"
                  :show-checkbox="true" :check-strictly="column.checkStrictly === undefined ? true : column.checkStrictly"
                  check-on-click-node node-key="key" @change="column.onChange && column.onChange(scope.row, column)"
                  :show-checkbox="true"
                  :check-strictly="column.checkStrictly === undefined ? true : column.checkStrictly" check-on-click-node
                  node-key="key" @change="column.onChange && column.onChange(scope.row, column)"
                  :props="{ label: 'label' }">
                  <template #default="{ data, node }">
                    {{ data.label }}</template>
@@ -217,7 +219,7 @@
              )" :key="fIndex" @click="dowloadFile(file)">{{ file.name }}</a>
            <span v-else-if="column.type == 'date'">{{
              formatterDate(scope.row, column)
              }}</span>
            }}</span>
            <div v-else-if="column.formatter" @click="formatterClick(scope.row, column, $event)"
              v-html="column.formatter(scope.row, column)"></div>
            <!-- 2021.11.18修复table数据源设置为normal后点击行$event缺失的问题 -->
@@ -230,15 +232,15 @@
              {{ scope.row[column.field] }}
            </div>
            <div @click="() => {
                column.click && formatterClick(scope.row, column);
              }
              column.click && formatterClick(scope.row, column);
            }
              " v-else-if="column.bind">
              <el-tag v-if="useTag" class="cell-tag" :class="[isEmptyTag(scope.row, column)]"
                :type="getColor(scope.row, column)" :effect="column.effect">{{ formatter(scope.row, column, true)
                }}</el-tag>
              <template v-else>{{
                formatter(scope.row, column, true)
                }}</template>
              }}</template>
            </div>
            <span v-else>{{ formatter(scope.row, column, true) }}</span>
Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js
@@ -200,6 +200,14 @@
    meta: {
      keepAlive: false
    }
  },
  {
    path: '/DtBoxing',
    name: 'DtBoxing',
    component: () => import('@/views/widesea_wms/stock/DtBoxing.vue'),
    meta: {
      keepAlive: false
    }
  }
]
export default tables
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/material/Dt_MaterielInfo.vue
@@ -5,97 +5,91 @@
 *业务请在@/extension/widesea_wms/material/Dt_MaterielInfo.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/widesea_wms/material/Dt_MaterielInfo.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'materielID',
                footer: "Foots",
                cnName: '物料信息',
                name: 'material/Dt_MaterielInfo',
                url: "/Dt_MaterielInfo/",
                sortName: "MaterielID"
            });
            const editFormFields = ref({
               "materielCode":"",
               "materielName":"",
               "packspes":"",
            });
            const editFormOptions = ref([
import extend from "@/extension/widesea_wms/material/Dt_MaterielInfo.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'materielID',
            footer: "Foots",
            cnName: '物料信息',
            name: 'material/Dt_MaterielInfo',
            url: "/Dt_MaterielInfo/",
            sortName: "MaterielID"
        });
        const editFormFields = ref({
            "materielCode": "",
            "materielName": "",
            "packspes": "",
        });
        const editFormOptions = ref([
            [
                { "title": "物料编码", "field": "materielCode", type: "text" },
                { "title": "物料名称", "field": "materielName", type: "text" },
                { "title": "包装规格", "field": "packspes", type: "text" },
            ]
            ]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([
        ]);
        const searchFormFields = ref({});
        const searchFormOptions = ref([
            [
                { "title": "物料ID", "field": "materielID", type: "text" },
                { "title": "物料编码", "field": "materielCode", type: "text" },
                { "title": "物料名称", "field": "materielName", type: "text" },
                { "title": "包装规格", "field": "packspes", type: "text" },
            ]
            ]);
            const columns = ref([{field:'materielID',title:'物料ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'materielCode',title:'物料编号',type:'string',width:110,align:'left',sort:true},
                       {field:'materielName',title:'物料名称',type:'string',width:120,align:'left'},
                       {field:'packspes',title:'规格',type:'string',width:110,align:'left'},
                       {field:'attribute',title:'属性',type:'string',width:110,align:'left'},
                       {field:'unit',title:'单位',type:'string',width:110,align:'left'},
                       {field:'wareAreaCode',title:'所属库区',type:'string',width:110,align:'left'},
                       {field:'minpackQty',title:'最小包装',type:'decimal',width:110,align:'left'},
                       {field:'netweight',title:'净重',type:'decimal',width:110,align:'left'},
                       {field:'grossweight',title:'毛重',type:'decimal',width:110,align:'left'},
                       {field:'status',title:'当前状态',type:'int',width:110,align:'left'},
                       {field:'validity',title:'有效期',type:'int',width:110,align:'left'},
                       {field:'safety',title:'安全库存',type:'decimal',width:110,align:'left'},
                       {field:'mfacturer',title:'生产商',type:'string',width:120,align:'left'},
                       {field:'supplier',title:'供应商',type:'string',width:120,align:'left'},
                       {field:'remark',title:'备注',type:'string',width:120,align:'left'},
                       {field:'materielDesc',title:'物料描述',type:'string',width:110,align:'left',hidden:true},
                       {field:'createID',title:'创建ID',type:'int',sort:true,width:100,hidden:true,align:'left'},
                       {field:'creater',title:'创建人',type:'string',sort:true,width:110,align:'left'},
                       {field:'createDate',title:'创建时间',type:'datetime',sort:true,width:150,align:'left',sort:true},
                       {field:'modifyID',title:'修改人ID',type:'int',sort:true,width:100,hidden:true,align:'left'},
                       {field:'modifier',title:'修改人',type:'string',sort:true,width:100,hidden:true,align:'left'},
                       {field:'modifyDate',title:'修改时间',type:'datetime',sort:true,width:150,hidden:true,align:'left',sort:true},
                       {field:'spare1',title:'Spare1',type:'string',sort:true,width:110,hidden:true,align:'left'},
                       {field:'spare2',title:'Spare2',type:'string',sort:true,width:110,hidden:true,align:'left'},
                       {field:'spare3',title:'Spare3',type:'string',sort:true,width:110,hidden:true,align:'left'},
                       {field:'spare4',title:'Spare4',type:'string',sort:true,width:110,hidden:true,align:'left'},
                       {field:'spare5',title:'Spare5',type:'string',sort:true,width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
        ]);
        const columns = ref([{ field: 'materielID', title: '物料ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'materielCode', title: '物料编号', type: 'string', width: 110, align: 'left', sort: true },
        { field: 'materielName', title: '物料名称', type: 'string', width: 120, align: 'left' },
        { field: 'packspes', title: '规格', type: 'string', width: 110, align: 'left' },
        { field: 'attribute', title: '属性', type: 'string', width: 110, align: 'left' },
        { field: 'unit', title: '单位', type: 'string', width: 110, align: 'left' },
        { field: 'wareAreaCode', title: '所属库区', type: 'string', width: 110, align: 'left' },
        { field: 'minpackQty', title: '最小包装', type: 'decimal', width: 110, align: 'left' },
        { field: 'netweight', title: '净重', type: 'decimal', width: 110, align: 'left' },
        { field: 'grossweight', title: '毛重', type: 'decimal', width: 110, align: 'left' },
        { field: 'status', title: '当前状态', type: 'int', width: 110, align: 'left' },
        { field: 'validity', title: '有效期', type: 'int', width: 110, align: 'left' },
        { field: 'safety', title: '安全库存', type: 'decimal', width: 110, align: 'left' },
        { field: 'mfacturer', title: '生产商', type: 'string', width: 120, align: 'left' },
        { field: 'supplier', title: '供应商', type: 'string', width: 120, align: 'left' },
        { field: 'remark', title: '备注', type: 'string', width: 120, align: 'left' },
        { field: 'materielDesc', title: '物料描述', type: 'string', width: 110, align: 'left', hidden: true },
        { field: 'createID', title: '创建ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' },
        { field: 'creater', title: '创建人', type: 'string', sort: true, width: 110, align: 'left' },
        { field: 'createDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
        { field: 'modifyID', title: '修改人ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' },
        { field: 'modifier', title: '修改人', type: 'string', sort: true, width: 100, hidden: true, align: 'left' },
        { field: 'modifyDate', title: '修改时间', type: 'datetime', sort: true, width: 150, hidden: true, align: 'left', sort: true },
        { field: 'spare1', title: 'Spare1', type: 'string', sort: true, width: 110, hidden: true, align: 'left' },
        { field: 'spare2', title: 'Spare2', type: 'string', sort: true, width: 110, hidden: true, align: 'left' },
        { field: 'spare3', title: 'Spare3', type: 'string', sort: true, width: 110, hidden: true, align: 'left' },
        { field: 'spare4', title: 'Spare4', type: 'string', sort: true, width: 110, hidden: true, align: 'left' },
        { field: 'spare5', title: 'Spare5', type: 'string', sort: true, width: 110, hidden: true, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/DtBoxing.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
<template>
    <ViewGridDetail :columns="columns" :detailColumns="detailColumns" :title="title" :url="url" :heigth="heigth"
        :paginationHide="paginationHide" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :dropdownItems="dropdownItems" :table="table">
    </ViewGridDetail>
</template>
<script>
import ViewGridDetail from "../../../components/basic/ViewGrid/ViewGridDetail.vue";
import VolForm from "../../../components/basic/VolForm.vue";
export default {
    components: { VolForm, ViewGridDetail },
    data() {
        return {
            title: "组盘数据",
            url: "/api/BoxingInfo/GetPageData",
            dropdownItems: [],
            table: 'DtBoxing',
            columns: [
                { field: 'id', title: '库存ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
                { field: 'palletCode', title: '托盘条码', type: 'string', width: 110, align: 'left', sort: true },
                { field: 'locationCode', title: '库位', type: 'string', width: 110, align: 'left' },
                { field: 'isFull', title: '是否满盘', type: 'bool', width: 110, align: 'left' },
                // { field: 'state', title: '库存状态', type: 'int', width: 110, align: 'left', bind: { key: "StockState", data: [] } },
                { field: 'remark', title: '备注', type: 'string', width: 120, hidden: true, align: 'left' },
                { field: 'createDate', title: '创建时间', type: 'int', sort: true, width: 100, hidden: true, align: 'left' },
            ],
            detailColumns: [
                { title: "物料编号", field: "materielCode", type: "text" },
                { title: "物料名称", field: "materielName", type: "text" },
                { title: "库存状态", field: "status", type: "text" },
                { title: "组盘数量", field: "stockQuantity", type: "text" },
                { title: "创建时间", field: "createDate", type: "text" },
            ],
            searchFormFields: {},
            searchFormOptions: [
                [
                    { "title": "托盘条码", "field": "palletCode", type: "text" },
                    { "title": "物料编号", "field": "materielCode", type: "text" },
                    { "title": "库存状态", "field": "status", type: "select", dataKey: "StockState", data: [] },
                    { "title": "组盘类型", "field": "groupType", type: "select", dataKey: "GroupType", data: [] },
                ]
            ],
            tableData: [],
            heigth: 740,
            currentPage1: {
                sort: "",
                order: "desc",
                Foots: "",
                total: 0,
                // 2020.08.29增加自定义分页条大小
                sizes: [30, 60, 100, 120],
                size: 30, // é»˜è®¤åˆ†é¡µå¤§å°
                Wheres: [],
                page: 1,
                rows: 30,
            }
        };
    },
    methods: {
        onInit() {
            this.dropdownItems.unshift({
                name: '按钮', //按钮名称
                icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档)
                type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button
                value: '321', //按钮值
                onClick: function () {
                    this.$Message.success('点击了按钮');
                }
            });
        },
    },
    created() {
        this.onInit();
    }
};
</script>
<style></style>
Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/fileList.bin
Binary files differ
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs
@@ -395,7 +395,7 @@
        /// <returns></returns>
        public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields)
        {
            return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Take(top).ToList();
            return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Take(top).IncludesAllFirstLayer().ToList();
        }
        /// <summary>
@@ -407,7 +407,7 @@
        /// <returns></returns>
        public virtual List<TEntity> QueryData(string where, int top, string orderByFields)
        {
            return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).Take(top).ToList();
            return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).Take(top).IncludesAllFirstLayer().ToList();
        }
        /// <summary>
@@ -435,7 +435,7 @@
        public virtual List<TEntity> QueryData(string where, int pageIndex, int pageSize, string orderByFields)
        {
            return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields)
                .WhereIF(!string.IsNullOrEmpty(where), where).ToPageList(pageIndex, pageSize);
                .WhereIF(!string.IsNullOrEmpty(where), where).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize);
        }
        /// <summary>
@@ -452,6 +452,7 @@
            var list = _db.Queryable<TEntity>()
                .OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields)
                .WhereIF(whereExpression != null, whereExpression)
                .IncludesAllFirstLayer()
                .ToPageList(pageIndex, pageSize, ref totalCount);
            return new PageGridData<TEntity> { Rows = list, Total = totalCount };
@@ -481,6 +482,7 @@
            List<TEntity> list = _db.Queryable<TEntity>()
                .OrderBy(orderByModels)
                .WhereIF(whereExpression != null, whereExpression)
                .IncludesAllFirstLayer()
                .ToPageList(pageIndex, pageSize, ref totalCount);
            return new PageGridData<TEntity>(totalCount, list);
@@ -508,7 +510,7 @@
            }
            int totalCount = 0;
            List<TEntity> list = _db.Queryable<TEntity>()
                .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).ToPageList(pageIndex, pageSize, ref totalCount);
                .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize, ref totalCount);
            return new PageGridData<TEntity>(totalCount, list);
        }
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs
@@ -82,7 +82,8 @@
            //}
            //GetPageDataOnExecuted?.Invoke(pageGridData);
            pageGridData = BaseDal.QueryPage(wheres, options.Page, options.Rows, orderbyDic);
            pageGridData = BaseDal.QueryPage
                (wheres, options.Page, options.Rows, orderbyDic);
            return pageGridData;
        }
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs
@@ -58,16 +58,16 @@
                        .InterceptedBy(cacheType.ToArray());
            foreach (var assembly in assemblyList)
            {
                foreach (var type in assembly.GetTypes())
                {
                    if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type))
                    {
                        Console.WriteLine($"注册类型: {type.FullName}");
                    }
                }
            }
            //foreach (var assembly in assemblyList)
            //{
            //    foreach (var type in assembly.GetTypes())
            //    {
            //        if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type))
            //        {
            //            Console.WriteLine($"注册类型: {type.FullName}");
            //        }
            //    }
            //}
            builder.RegisterType<UnitOfWorkManage>().As<IUnitOfWorkManage>()
               .AsImplementedInterfaces()
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_MenuService.cs
@@ -14,6 +14,8 @@
    {
        object GetCurrentMenuActionList();
        object GetCurrentMenuPhoneActionList();
        List<MenuDTO> GetUserMenuList(int roleId);
        List<ActionDTO> GetActions(int menuId, List<ActionDTO> menuActions, List<Permissions> permissions, int roleId);
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_MenuService.cs
@@ -47,6 +47,23 @@
            return obj;
        }
        public object GetCurrentMenuPhoneActionList()
        {
            object obj = GetMenuActionPhoneList(App.User.RoleId);
            if (obj is IEnumerable<object> list)
            {
                if (list.Any())
                {
                    return obj;
                }
                else
                {
                    return WebResponseContent.Instance.Error("未获取到菜单信息");
                }
            }
            return obj;
        }
        /// <summary>
        /// æ ¹æ®è§’色ID获取菜单与权限
        /// </summary>
@@ -54,13 +71,26 @@
        /// <returns></returns>
        public object GetMenuActionList(int roleId)
        {
            if (App.User.IsRoleIdSuperAdmin(roleId))
            {
                return BaseDal.GetSuperAdminMenu();
            }
            return BaseDal.GetMenuByRoleId(roleId);
        }
        /// <summary>
        /// æ ¹æ®è§’色ID获取菜单与权限
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public object GetMenuActionPhoneList(int roleId)
        {
            var allMenu = BaseDal.QueryData(x => (x.Enable == 1 || x.Enable == 2) && x.MenuType == 1 && x.ParentId > 0).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList();
            var menu = allMenu.Select(x => new
            {
                text = x.MenuName,
                url = x.Url,
                icon = x.Icon,
            });
            return menu.ToList();
        }
        public List<MenuDTO> GetUserMenuList(int roleId)
        {
@@ -155,7 +185,7 @@
                    if (menu.MenuId == menu.ParentId)
                    {
                        return webResponse.Error($"父级id不能为自己");
                    }
                    }
                    if (BaseDal.QueryFirst(x => x.ParentId == menu.MenuId && menu.ParentId == x.MenuId) != null)
                    {
                        return webResponse.Error($"不能选择此父级id,选择的父级id与当前菜单形成依赖关系");
@@ -172,7 +202,6 @@
                webResponse.Error(ex.Message);
            }
            return webResponse;
        }
    }
}
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoService.cs
@@ -12,38 +12,28 @@
    public async Task<WebResponseContent> AddBoxingInfoAsync(DtBoxingInfo boxingInfo)
    {
        WebResponseContent content = new WebResponseContent();
        // éªŒè¯æ¨¡åž‹é‡Œé¢æ•°æ®æ˜¯å¦åˆæ³•,如果不合法抛出异常
        var errors = ValidateModel(boxingInfo);
        if (errors.Count > 0)
        var info = await BaseDal.QueryFirstAsync(x => x.PalletCode == boxingInfo.PalletCode);
        if (!info.IsNullOrEmpty())
        {
            foreach (var error in errors)
            {
                Console.WriteLine(error.ErrorMessage);
            }
            string errorMessage = string.Join(",", errors.Select(e => e.ErrorMessage));
            content.Error(errorMessage);
            content.Error("该托盘已存在组盘");
        }
        else
        {
            var  info = await BaseDal.QueryFirstAsync(x=>x.PalletCode ==  boxingInfo.PalletCode);
            if (!info.IsNullOrEmpty())
            // æ·»åŠ ç»„ç›˜ä¿¡æ¯
            var result = await BaseDal.AddDataNavAsync(boxingInfo);
            if (result)
            {
                content.Error("该托盘已存在组盘");
            }
            else
            {
                // æ·»åŠ ç»„ç›˜ä¿¡æ¯
                var result = await BaseDal.AddDataNavAsync(boxingInfo);
                if (result)
                {
                    content.OK("添加成功", boxingInfo);
                }
                content.OK("添加成功", boxingInfo);
            }
        }
        return content;
    }
    public override PageGridData<DtBoxingInfo> GetPageData(PageDataOptions options)
    {
        return base.GetPageData(options);
    }
    // éªŒè¯æ¨¡åž‹
    public static List<ValidationResult> ValidateModel(object model)
    {
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_MenuController.cs
@@ -17,6 +17,12 @@
        return Json(Service.GetCurrentMenuActionList());
    }
    [HttpGet, HttpPost, Route("getTreePhoneMenu")]
    public IActionResult GetTreePhoneMenu()
    {
        return Json(Service.GetCurrentMenuPhoneActionList());
    }
    [HttpPost, Route("getMenu")]
    public IActionResult GetMenu()
    {
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -6,7 +6,7 @@
    }
  },
  "AllowedHosts": "*",
  "urls": "http://*:5000",
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/bin/Debug/net6.0/appsettings.json
@@ -6,7 +6,7 @@
    }
  },
  "AllowedHosts": "*",
  "urls": "http://*:5000",
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",