Browse Source

货代10.9

caojunjie 1 year ago
parent
commit
17fdc4318c

+ 128 - 0
src/components/iosbasic-data/searchquery.vue

@@ -0,0 +1,128 @@
+<template>
+    <div>
+        <div style="display:flex">
+            <!--<slot v-if="slot" name="slot"></slot>-->
+            <div style="width: 100%;">
+                <el-select v-model="selectValue" size="small" placeholder="请选择"
+                           :filterable="filterable" :clearable="clearable" :remote="remote" :remote-method="remoteMethod"
+                           :multiple="multiple" :collapse-tags="collapseTags"
+                           @change="corpChange" >
+                    <el-option
+                        v-for="item in datalist"
+                        :key="item.id"
+                        :label="item.cnName"
+                        :value="item.id">
+                    </el-option>
+                </el-select>
+            </div>
+            <!--<el-button icon="el-icon-search" size="mini" v-if="label != 'shortName'" :disabled="disabled"-->
+            <!--           @click="openDialog()"></el-button>-->
+            <!--<el-tooltip v-if="refresh" effect="dark" content="获取最新资料" placement="top-start">-->
+            <!--    <el-button icon="el-icon-refresh" size="mini" v-if="label != 'shortName'" @click="refreshData"-->
+            <!--               style="margin-left:0px;"></el-button>-->
+            <!--</el-tooltip>-->
+        </div>
+      <!--  <el-dialog :title="title" :visible.sync="corpVisible" width="80%" top="5vh" append-to-body @closed="closed"-->
+      <!--             class="el-dialogDeep" :close-on-click-modal="false" v-dialog-drag>-->
+      <!--<span>-->
+      <!--  <el-row>-->
+      <!--    <el-col :span="4">-->
+      <!--      <el-scrollbar>-->
+      <!--        <basic-container>-->
+      <!--          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" :style="treeStyle" />-->
+      <!--        </basic-container>-->
+      <!--      </el-scrollbar>-->
+      <!--    </el-col>-->
+      <!--    <el-col :span="20">-->
+      <!--      <avue-crud :option="tableOption" :data="data" ref="crud" v-model="form" :page.sync="page"-->
+      <!--                 :search.sync="search" @search-change="searchChange" @search-reset="searchReset"-->
+      <!--                 @selection-change="selectionChange" @on-load="onLoad" @tree-load="treeLoad" @saveColumn="saveColumn"-->
+      <!--                 @resetColumn="resetColumn" @refresh-change="refreshChange" :table-loading="loading">-->
+      <!--      </avue-crud>-->
+      <!--    </el-col>-->
+      <!--  </el-row>-->
+      <!--</span>-->
+      <!--      <span slot="footer" class="dialog-footer">-->
+      <!--  <el-button @click="corpVisible = false">取 消</el-button>-->
+      <!--  <el-button type="primary" @click="importCorp" :disabled="!multiple && selectionList.length != 1">确 定</el-button>-->
+      <!--</span>-->
+      <!--  </el-dialog>-->
+    </div>
+</template>
+
+<script>
+    export default {
+        data(){
+            return {
+                selectValue:null,
+            }
+        },
+        props:{
+            // 选择框的数据
+            datalist:{
+                type:Array,
+                default:[]
+            },
+            // 选择框数据选择的参数
+            forParameter:{
+                type:Object,
+                default:{
+                    key:'value',
+                    label:'label',
+                    value:'value',
+                }
+            },
+            // 是否多选
+            multiple:{
+                type:Boolean,
+                default:false
+            },
+            // 多选时是否将选中值按文字的形式展示
+            collapseTags:{
+                type:Boolean,
+                default:false
+            },
+            // 是否可以搜索
+            filterable:{
+                type:Boolean,
+                default:false
+            },
+            // 是否为远程搜索
+            remote:{
+                type:Boolean,
+                default:false
+            },
+            // 是否可以清空选择项
+            clearable:{
+                type:Boolean,
+                default:false
+            },
+        },
+        methods:{
+            // 下拉change
+            corpChange(row) {
+                console.log(row,100)
+            },
+            /* 远程模糊查询操作用户 */
+            remoteMethod(query) {
+                console.log(query,103)
+                if (query !== '') {
+                    this.loading = true;
+                    setTimeout(() => {
+                        this.loading = false;
+                        // this.options = this.list.filter(item => {
+                        //     return item.label.toLowerCase()
+                        //         .indexOf(query.toLowerCase()) > -1;
+                        // });
+                    }, 200);
+                } else {
+                    this.options = [];
+                }
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 4 - 0
src/enums/column-name.js

@@ -1290,6 +1290,10 @@ const columnName = [{
     name: '货运代理-基础资料-货物'
   },
   {
+    code: 291,
+    name: '货运代理-基础资料-集装箱'
+  },
+  {
     code: 293,
     name: '货运代理-基础资料-船名'
   },

+ 33 - 2
src/views/iosBasicData/bcntrtypes/index.vue

@@ -1,4 +1,5 @@
 <template>
+    <!--集装箱-->
   <basic-container>
     <avue-crud :option="option"
                :table-loading="loading"
@@ -17,6 +18,8 @@
                @current-change="currentChange"
                @size-change="sizeChange"
                @refresh-change="refreshChange"
+               @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 291)"
+               @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 291)"
                @on-load="onLoad">
       <template slot="menuLeft">
         <el-button type="danger"
@@ -46,7 +49,8 @@
           total: 0
         },
         selectionList: [],
-        option: {
+        option:{},
+        optionBack: {
           height:'auto',
           calcHeight: 30,
           tip: false,
@@ -342,6 +346,9 @@
         return ids.join(",");
       }
     },
+      async created() {
+          this.option = await this.getColumnData(this.getColumnName(291), this.optionBack);
+      },
     methods: {
       rowSave(row, done, loading) {
         bcntrtypesSubmit(row).then(() => {
@@ -451,7 +458,31 @@
           this.loading = false;
           this.selectionClear();
         });
-      }
+      },
+        //自定义列保存
+        async saveColumnTwo(ref, option, optionBack, code) {
+            /**
+             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+             */
+            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //自定义列重置
+        async resetColumnTwo(ref, option, optionBack, code) {
+            this[option] = this[optionBack];
+            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        }
+
     }
   };
 </script>

+ 25 - 5
src/views/iosBasicData/bcommodity/index.vue

@@ -28,6 +28,11 @@
                    @click="handleDelete">删 除
         </el-button>
       </template>
+
+        <template slot="unitNoForm">
+            <search-query :datalist="unitNoData" :filterable="true" :clearable="true"></search-query>
+        </template>
+
     </avue-crud>
   </basic-container>
 </template>
@@ -35,10 +40,14 @@
 <script>
   import {bcommodityList, bcommodityDetail, bcommoditySubmit, bcommodityRemove} from "@/api/iosBasicData/bcommodity";
   import {mapGetters} from "vuex";
+  import SearchQuery from '@/components/iosbasic-data/searchquery.vue'
+  import {getBunitsList} from "@/api/iosBasicData/bunits";
 
   export default {
     data() {
       return {
+          // 计算单位请求到的数据
+          unitNoData:[],
         form: {},
         query: {},
         loading: true,
@@ -92,6 +101,10 @@
             {
               label: "计量单位",
               prop: "unitNo",
+                formslot:true,
+                type:'select',
+                clearable:false,
+                dicData:[],
               rules: [{
                 required: true,
                 message: "请输入计量单位",
@@ -102,11 +115,6 @@
               label: "NCM CODE",
               prop: "ncmCode",
                 width:100,
-              rules: [{
-                required: true,
-                message: "请输入NCM CODE(南美国家,巴西,南方共同市场通用命名)",
-                trigger: "blur"
-              }]
             },
             {
               label: "版本",
@@ -194,6 +202,9 @@
         data: []
       };
     },
+      components:{
+          SearchQuery
+      },
     computed: {
       ...mapGetters(["permission"]),
       permissionList() {
@@ -214,8 +225,17 @@
     },
     async created() {
       this.option = await this.getColumnData(this.getColumnName(290), this.optionBack);
+        // 获取计算单位数据
+        this.getBunitsListfun()
     },
     methods: {
+        // 获取计算单位数据
+        getBunitsListfun(){
+            getBunitsList(1, 10).then(res=>{
+                console.log(res,233)
+                this.unitNoData = res.data.data.records
+            })
+        },
       rowSave(row, done, loading) {
         bcommoditySubmit(row).then(() => {
           this.onLoad(this.page);

+ 1 - 0
src/views/iosBasicData/bpackages/index.vue

@@ -254,6 +254,7 @@
               {
                   label: "创建时间",
                   prop: "createTime",
+                  width:160,
                   display:false,
               },
               {