基础资料界面调整
							parent
							
								
									fe87793aff
								
							
						
					
					
						commit
						d67c302cf1
					
				| 
						 | 
				
			
			@ -210,7 +210,7 @@ export default {
 | 
			
		|||
 | 
			
		||||
    },
 | 
			
		||||
    showcolumn() {
 | 
			
		||||
      const strHidden = sessionStorage.getItem(this.tableKey)
 | 
			
		||||
      /*      const strHidden = sessionStorage.getItem(this.tableKey)
 | 
			
		||||
            this.hiddenColumns = JSON.parse(strHidden);
 | 
			
		||||
            const table = this.crud.props.table
 | 
			
		||||
            this.hiddenColumns.forEach((column, index) => {
 | 
			
		||||
| 
						 | 
				
			
			@ -222,7 +222,39 @@ export default {
 | 
			
		|||
                vm.owner.store.commit('insertColumn', columnConfig, index + 1, null)
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
            this.updateTableColumns();*/
 | 
			
		||||
 | 
			
		||||
      try {
 | 
			
		||||
        // 从sessionStorage安全地获取并解析hiddenColumns
 | 
			
		||||
        const strHidden = sessionStorage.getItem(this.tableKey)
 | 
			
		||||
        if (strHidden) {
 | 
			
		||||
          this.hiddenColumns = JSON.parse(strHidden);
 | 
			
		||||
        } else {
 | 
			
		||||
          // 如果没有找到相应的存储信息,可以初始化为空数组或相应的默认值
 | 
			
		||||
          this.hiddenColumns = [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const table = this.crud.props.table
 | 
			
		||||
        // 优化循环中的条件判断和错误处理
 | 
			
		||||
        this.hiddenColumns.forEach((column, index) => {
 | 
			
		||||
          const vm = table.$children.find(e => e && e.prop === column.property)
 | 
			
		||||
          if (vm) {
 | 
			
		||||
            const columnConfig = vm.columnConfig;
 | 
			
		||||
            // 确保columnConfig存在
 | 
			
		||||
            if (columnConfig) {
 | 
			
		||||
              if (column.visible) {
 | 
			
		||||
                // 仅当列需要显示时,才更新其配置
 | 
			
		||||
                columnConfig.width = column.width;
 | 
			
		||||
                columnConfig.visible = column.visible;
 | 
			
		||||
                vm.owner.store.commit('insertColumn', columnConfig, index + 1, null);
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
        this.updateTableColumns();
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        console.error("处理列配置时发生错误:", error);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    //列拖拽
 | 
			
		||||
    columnDrop() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,7 +79,7 @@ import rrOperation from '@crud/RR.operation'
 | 
			
		|||
import crudOperation from '@crud/CRUD.operation'
 | 
			
		||||
import udOperation from '@crud/UD.operation'
 | 
			
		||||
import pagination from '@crud/Pagination'
 | 
			
		||||
import {getAllBigItem} from '@/api/bigItem'
 | 
			
		||||
import {queryAllBigItem} from '@/api/bigItem'
 | 
			
		||||
import {getItemsList} from '@/api/item'
 | 
			
		||||
 | 
			
		||||
const defaultForm = {
 | 
			
		||||
| 
						 | 
				
			
			@ -145,7 +145,7 @@ export default {
 | 
			
		|||
      return true
 | 
			
		||||
    },
 | 
			
		||||
    getBigItem() {
 | 
			
		||||
      getAllBigItem({}).then(res => {
 | 
			
		||||
      queryAllBigItem({}).then(res => {
 | 
			
		||||
        this.bigItemList = res
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ export default {
 | 
			
		|||
  mixins: [presenter(), header(), form(defaultForm), crud()],
 | 
			
		||||
  cruds() {
 | 
			
		||||
    return CRUD({
 | 
			
		||||
      title: '成品管理',
 | 
			
		||||
      title: '总成',
 | 
			
		||||
      url: 'api/bigItem',
 | 
			
		||||
      idField: 'id',
 | 
			
		||||
      sort: 'id,desc',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,7 +34,7 @@
 | 
			
		|||
          class="upload-demo"
 | 
			
		||||
          slot='right'
 | 
			
		||||
          style="float: right;padding-left: 5px"
 | 
			
		||||
          action="/api/item/import_data"
 | 
			
		||||
          :action="baseApi+'/api/item/import_data'"
 | 
			
		||||
          :file-list="fileList"
 | 
			
		||||
          :on-error="handleErr"
 | 
			
		||||
          :on-success=" (response, file, fileList) => {
 | 
			
		||||
| 
						 | 
				
			
			@ -57,19 +57,10 @@
 | 
			
		|||
            <el-input v-model="form.name" style="width: 180px;"/>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
 | 
			
		||||
          <el-form-item label="整托高度" prop="extendD2">
 | 
			
		||||
            <el-select v-model="form.extendD2" filterable placeholder="请选择" style="width: 180px;"
 | 
			
		||||
                       :default-first-option="true">
 | 
			
		||||
              <el-option
 | 
			
		||||
                v-for="item in dict.item_height"
 | 
			
		||||
                :key="item.id"
 | 
			
		||||
                :label="item.label"
 | 
			
		||||
                :value="item.value"
 | 
			
		||||
              />
 | 
			
		||||
            </el-select>
 | 
			
		||||
          <el-form-item label="单台用量" prop="extendD1">
 | 
			
		||||
            <el-input v-model="form.extendD1" style="width: 180px;" :min="1" type="number"/>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
          <el-form-item label="物料类型" prop="goodType">
 | 
			
		||||
            <el-select v-model="form.goodType" filterable placeholder="请选择" style="width: 180px;"
 | 
			
		||||
                       :default-first-option="true">
 | 
			
		||||
| 
						 | 
				
			
			@ -82,19 +73,8 @@
 | 
			
		|||
            </el-select>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
 | 
			
		||||
          <el-form-item label="翻包类型" prop="extendStr1">
 | 
			
		||||
            <el-select v-model="form.extendStr1" filterable placeholder="请选择" style="width: 180px;"
 | 
			
		||||
                       :default-first-option="true">
 | 
			
		||||
              <el-option
 | 
			
		||||
                v-for="item in dict.item_fb"
 | 
			
		||||
                :key="item.id"
 | 
			
		||||
                :label="item.label"
 | 
			
		||||
                :value="item.value"
 | 
			
		||||
              />
 | 
			
		||||
            </el-select>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
 | 
			
		||||
          <!--          <el-form-item label="单位" prop="unit">
 | 
			
		||||
          <el-form-item label="单位" prop="unit">
 | 
			
		||||
            <el-select v-model="form.unit" filterable placeholder="请选择" style="width: 180px;"
 | 
			
		||||
                       :default-first-option="true">
 | 
			
		||||
              <el-option
 | 
			
		||||
| 
						 | 
				
			
			@ -104,7 +84,7 @@
 | 
			
		|||
                :value="item.value"
 | 
			
		||||
              />
 | 
			
		||||
            </el-select>
 | 
			
		||||
                    </el-form-item>-->
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        </el-form>
 | 
			
		||||
| 
						 | 
				
			
			@ -125,21 +105,14 @@
 | 
			
		|||
        <el-table-column type="selection" width="55"/>
 | 
			
		||||
        <el-table-column prop="code" label="编码" width="150"/>
 | 
			
		||||
        <el-table-column prop="name" label="名称" width="150"/>
 | 
			
		||||
        <el-table-column prop="extendD2" label="整托高度" width="150">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            {{ dict.label.item_height[scope.row.extendD2] }}
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column prop="extendD1" label="单台用量" width="150"/>
 | 
			
		||||
        <el-table-column prop="unit" label="单位" width="150"/>
 | 
			
		||||
        <el-table-column prop="goodType" label="物料类型" width="150">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            {{ dict.label.item_type[scope.row.goodType] }}
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column prop="extendStr1" label="翻包类型" width="150">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            {{ dict.label.item_fb[scope.row.extendStr1] }}
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
 | 
			
		||||
        <el-table-column prop="enabled" label="启用" width="50">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            <el-switch
 | 
			
		||||
| 
						 | 
				
			
			@ -178,6 +151,7 @@ import udOperation from '@crud/UD.operation'
 | 
			
		|||
import pagination from '@crud/Pagination'
 | 
			
		||||
import DonMessage from "@/utils/message";
 | 
			
		||||
import {getToken} from "@/utils/auth";
 | 
			
		||||
import {mapGetters} from "vuex";
 | 
			
		||||
 | 
			
		||||
const defaultForm = {id: null}
 | 
			
		||||
export default {
 | 
			
		||||
| 
						 | 
				
			
			@ -196,6 +170,11 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    ...mapGetters([
 | 
			
		||||
      'baseApi'
 | 
			
		||||
    ])
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      headers: {'Authorization': getToken()},
 | 
			
		||||
| 
						 | 
				
			
			@ -233,18 +212,12 @@ export default {
 | 
			
		|||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleSuccess(response, file, fileList, crud) {
 | 
			
		||||
 | 
			
		||||
      let myError = response.toString();//转字符串
 | 
			
		||||
      DonMessage.success("" + response['message'])
 | 
			
		||||
      this.crud.notify(response.toString(), CRUD.NOTIFICATION_TYPE.SUCCESS)
 | 
			
		||||
      crud.toQuery()
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    handleErr(err, file, fileList) {
 | 
			
		||||
 | 
			
		||||
      let myError = err.toString();//转字符串
 | 
			
		||||
      myError = myError.replace("Error: ", "") // 去掉前面的" Error: "
 | 
			
		||||
      myError = JSON.parse(myError);//转对象
 | 
			
		||||
      DonMessage.error("" + myError['message'])
 | 
			
		||||
      this.crud.notify(err.toString(), CRUD.NOTIFICATION_TYPE.ERROR)
 | 
			
		||||
    },
 | 
			
		||||
    // 钩子:在获取表格数据之前执行,false 则代表不获取数据
 | 
			
		||||
    [CRUD.HOOK.beforeRefresh]() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -246,6 +246,7 @@ import viewFullStockIn from '@/views/base-data/point/fullStockIn.vue';
 | 
			
		|||
import viewFullStockOut from '@/views/base-data/point/fullStockOut.vue';
 | 
			
		||||
import pointUrl from '@/api/point'
 | 
			
		||||
import multiAdjust from "@/views/base-data/point/multiAdjust.vue";
 | 
			
		||||
import {mapGetters} from "vuex";
 | 
			
		||||
 | 
			
		||||
const defaultForm = {
 | 
			
		||||
  id: null,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -222,6 +222,7 @@ import ContainerIn from "@/views/base-data/stock/containerIn.vue";
 | 
			
		|||
import ReturnContainer from "@/views/base-data/stock/returnContainer.vue";
 | 
			
		||||
import CallContainer from "@/views/base-data/stock/callContainer.vue";
 | 
			
		||||
import stockUrl from "@/api/stock";
 | 
			
		||||
import {mapGetters} from "vuex";
 | 
			
		||||
 | 
			
		||||
const defaultForm = {
 | 
			
		||||
  id: null,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue