Browse Source

货物10.13

caojunjie 1 year ago
parent
commit
d1295770c9

+ 9 - 35
src/views/iosBasicData/bcntrtypes/index.vue

@@ -14,9 +14,11 @@
         </avue-text-ellipsis>
       </template>
       <template slot="cnName" slot-scope="scope">
-        <avue-text-ellipsis :text="scope.row.cnName" :height="30" use-tooltip placement="top">
-          <small slot="more">...</small>
-        </avue-text-ellipsis>
+        <div style="color: #1e9fff;cursor: pointer;" @click.stop="rowViewfun(scope.row,scope.index)">
+            <avue-text-ellipsis :text="scope.row.cnName" :height="30" use-tooltip placement="top">
+                <small slot="more">...</small>
+            </avue-text-ellipsis>
+        </div>
       </template>
       <template slot="enName" slot-scope="scope">
         <avue-text-ellipsis :text="scope.row.enName" :height="30" use-tooltip placement="top">
@@ -163,7 +165,8 @@ export default {
       page: {
         pageSize: 10,
         currentPage: 1,
-        total: 0
+        total: 0,
+        ageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
       selectionList: [],
       option: {
@@ -189,6 +192,7 @@ export default {
         viewBtn: true,
         selection: true,
         dialogClickModal: false,
+          menuWidth:260,
         column: [
           // {
           //   label: "箱型 ISO 代码",
@@ -342,7 +346,7 @@ export default {
             }],
           },
           {
-            label: "扩展数据",
+            label: "EDI CODE",
             prop: "extendedDataArr",
             formslot: true,
             // rules: [{
@@ -352,12 +356,6 @@ export default {
             // }]
           },
           {
-            label: "版本",
-            prop: "version",
-            hide: true,
-            display: false,
-          },
-          {
             label: "状态",
             prop: "status",
             type: 'select',
@@ -376,29 +374,11 @@ export default {
             display: false,
           },
           {
-            label: "主键",
-            prop: "id",
-            hide: true,
-            display: false,
-          },
-          {
-            label: "创建人 Id",
-            prop: "createUser",
-            hide: true,
-            display: false,
-          },
-          {
             label: "创建人",
             prop: "createUserName",
             display: false,
           },
           {
-            label: "创建部门 Id",
-            prop: "createDept",
-            hide: true,
-            display: false,
-          },
-          {
             label: "创建部门",
             prop: "createDeptName",
             display: false,
@@ -410,12 +390,6 @@ export default {
             display: false,
           },
           {
-            label: "修改人 Id",
-            prop: "updateUser",
-            hide: true,
-            display: false,
-          },
-          {
             label: "修改人",
             prop: "updateUserName",
             display: false,

+ 54 - 38
src/views/iosBasicData/bcommodity/index.vue

@@ -14,9 +14,11 @@
         </avue-text-ellipsis>
       </template>
       <template slot="cnName" slot-scope="scope">
-        <avue-text-ellipsis :text="scope.row.cnName" :height="30" use-tooltip placement="top">
-          <small slot="more">...</small>
-        </avue-text-ellipsis>
+          <div style="color: #1e9fff;cursor: pointer;" @click.stop="rowViewfun(scope.row,scope.index)">
+              <avue-text-ellipsis :text="scope.row.cnName" :height="30" use-tooltip placement="top">
+                  <small slot="more">...</small>
+              </avue-text-ellipsis>
+          </div>
       </template>
       <template slot="enName" slot-scope="scope">
         <avue-text-ellipsis :text="scope.row.enName" :height="30" use-tooltip placement="top">
@@ -37,9 +39,19 @@
         </el-button>
         <el-button type="success" size="small" @click="handleExport" icon="el-icon-printer">导出</el-button>
       </template>
+      <template slot-scope="scope" slot="menu">
+          <el-button v-if="scope.row.status == 1" type="text" icon="el-icon-turn-off" style="color: #85e967" size="small"
+                     @click.stop="statusfun(scope.row.id,0)">
+              启用
+          </el-button>
+          <el-button v-if="scope.row.status == 0" type="text" icon="el-icon-turn-off" style="color: #e83c3a" size="small"
+                     @click.stop="statusfun(scope.row.id,1)">
+              停用
+          </el-button>
+      </template>
 
       <template slot="unitNoForm">
-        <search-query ref="SearchQuery" :datalist="unitNoData" title="计量单位" :filterable="true" :clearable="true"
+        <search-query ref="SearchQuery" :disabled="searchDisabled" :datalist="unitNoData" title="计量单位" :filterable="true" :clearable="true"
           :remote="true" :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }" @remoteMethod="getBunitsListfun"
           @corpChange="corpChange">
           <bunits @selectionChange="selectionBunits"></bunits>
@@ -78,6 +90,8 @@ import { getToken } from "@/util/auth";
 export default {
   data() {
     return {
+        // 判断组件是否禁用
+        searchDisabled:false,
       // 计算单位请求到的数据
       unitNoData: [],
       form: {},
@@ -86,7 +100,8 @@ export default {
       page: {
         pageSize: 10,
         currentPage: 1,
-        total: 0
+        total: 0,
+        ageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
       selectionList: [],
       excelBox: false,
@@ -141,6 +156,7 @@ export default {
         viewBtn: true,
         selection: true,
         dialogClickModal: false,
+          menuWidth:260,
         column: [
           {
             label: "HS CODE",
@@ -191,13 +207,7 @@ export default {
           {
             label: "NCM CODE",
             prop: "ncmCode",
-            width: 100,
-          },
-          {
-            label: "版本",
-            prop: "version",
-            hide: true,
-            display: false,
+            width: "100",
           },
           {
             label: "状态",
@@ -218,29 +228,11 @@ export default {
             display: false,
           },
           {
-            label: "主键",
-            prop: "id",
-            hide: true,
-            display: false,
-          },
-          {
-            label: "创建人 Id",
-            prop: "createUser",
-            hide: true,
-            display: false,
-          },
-          {
             label: "创建人",
             prop: "createUserName",
             display: false,
           },
           {
-            label: "创建部门 Id",
-            prop: "createDept",
-            hide: true,
-            display: false,
-          },
-          {
             label: "创建部门",
             prop: "createDeptName",
             display: false,
@@ -248,13 +240,7 @@ export default {
           {
             label: "创建时间",
             prop: "createTime",
-            width: 160,
-            display: false,
-          },
-          {
-            label: "修改人 Id",
-            prop: "updateUser",
-            hide: true,
+            width: "160",
             display: false,
           },
           {
@@ -265,6 +251,7 @@ export default {
           {
             label: "修改时间",
             prop: "updateTime",
+              width: "160",
             display: false,
           },
           {
@@ -309,6 +296,31 @@ export default {
     this.getBunitsListfun()
   },
   methods: {
+      // 禁用启用按钮
+      statusfun(id,status){
+          this.$confirm("确定将选择数据更改状态?", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+          }).then(()=>{
+              bcommodityDetail(id).then(res=>{
+                  let obj = res.data.data;
+                  obj.status = status
+                  bcommoditySubmit(obj).then(()=>{
+                      this.onLoad(this.page);
+                      this.$message({
+                          type: "success",
+                          message: "操作成功!"
+                      });
+                  })
+              })
+          })
+      },
+      // 查看
+      rowViewfun(row, index) {
+          this.searchDisabled = true
+          this.$refs.crud.rowView(row, index)
+      },
     // 导出
     handleExport() {
       var condition = ''
@@ -458,12 +470,16 @@ export default {
         });
     },
     beforeOpen(done, type) {
+          if (["edit", "add"].includes(type)) {
+              this.searchDisabled = false
+          } else {
+              this.searchDisabled = true
+          }
       if (["edit", "view"].includes(type)) {
         bcommodityDetail(this.form.id).then(res => {
           this.form = res.data.data;
           // 获取插槽数据
           this.$nextTick(() => {
-            console.log(this.$refs.SearchQuery.selectValue)
             this.$refs.SearchQuery.selectValue = this.form.unitNo
           })
         });