Browse Source

字段修改

chrislee 7 months ago
parent
commit
37abb5b58b

+ 8 - 0
src/api/org.js

@@ -0,0 +1,8 @@
+import request from '@/utils/httpRequest'
+
+export function getOrgName () {
+  return request({
+    url: request.adornUrl('/user-service/org/getCompanyName'),
+    method: 'get'
+  })
+}

+ 0 - 1
src/api/warehouse.js

@@ -236,4 +236,3 @@ export function infoByNameAndCode (params) {
     params
   })
 }
-

+ 19 - 2
src/views/common/home.vue

@@ -1,12 +1,29 @@
 <template>
   <div class="mod-home">
-    <h3>木之云数字化平台,欢迎您!</h3>
+    <h3 v-if="orgName">{{orgName}}, 欢迎您!</h3>
+    <h3 v-else>木之云数字化平台,欢迎您!</h3>
   </div>
 </template>
 
 <script>
-  export default {
+import {getOrgName} from '@/api/org'
+export default {
+  data () {
+    return {
+      orgName: ''
+    }
+  },
+  created () {
+    this.init()
+  },
+  methods: {
+    async init () {
+      await getOrgName().then(({data}) => {
+        this.orgName = data.data
+      })
+    }
   }
+}
 </script>
 
 <style>

+ 2 - 2
src/views/modules/production/scheduling-commission.vue

@@ -89,7 +89,7 @@ export default {
     return {
       id: 0,
       dataForm: {
-        list:[]
+        list: []
       },
       optionsType: [], // 类别
       dataRule: {
@@ -109,7 +109,7 @@ export default {
     },
     async init (row) {
       this.dataForm.id = row.id
-      if(row instanceof Array){
+      if (row instanceof Array) {
         this.dataForm.list = row
       } else {
         this.dataForm.list = [row]

+ 3 - 3
src/views/modules/production/scheduling-purchase.vue

@@ -66,13 +66,13 @@ export default {
     return {
       id: 0,
       dataForm: {
-        list:[]
+        list: []
       },
       dataRule: {
         cnt: [{ required: true, message: '请输入数量', trigger: 'change' }],
         unitName: [{ required: true, message: '请输入单位', trigger: 'blur' }]
       },
-      subTitle:''
+      subTitle: ''
     }
   },
   methods: {
@@ -81,7 +81,7 @@ export default {
     },
     async init (row) {
       this.dataForm.id = row.id
-      if(row instanceof Array){
+      if (row instanceof Array) {
         this.subTitle = '批量采购'
         this.dataForm.list = row
       } else {

+ 2 - 2
src/views/modules/sale/add-material.vue

@@ -43,8 +43,8 @@
         <el-form-item label="批次号" prop="batchNumber">
           <el-input v-model="dataForm.batchNumber" :disabled="display" placeholder="批次号"></el-input>
         </el-form-item>
-        <el-form-item label="用途" prop="use">
-          <el-input v-model="dataForm.use" :disabled="display" placeholder="用途"></el-input>
+        <el-form-item label="用途" prop="purpose">
+          <el-input v-model="dataForm.purpose" :disabled="display" placeholder="用途"></el-input>
         </el-form-item>
         <el-form-item label="备注" prop="notes">
           <el-input type="textarea" v-model="dataForm.notes" :disabled="display" placeholder="备注"></el-input>

+ 2 - 2
src/views/modules/sale/outsource.vue

@@ -590,7 +590,7 @@ export default {
     },
     // 批量委外
     batchHandle () {
-      if (this.selectedRows.length == 0) {
+      if (this.selectedRows.length === 0) {
         this.$message.error('请先勾选数据')
         return
       }
@@ -602,7 +602,7 @@ export default {
     },
     // 批量入库
     batchIncomeHandle () {
-      if (this.selectedRows.length == 0) {
+      if (this.selectedRows.length === 0) {
         this.$message.error('请先勾选数据')
         return
       }

+ 1 - 1
src/views/modules/sale/purchase-add-or-update.vue

@@ -107,7 +107,7 @@
               label="批次号">
             </el-table-column>
              <el-table-column
-              prop="use"
+              prop="purpose"
               header-align="center"
               align="center"
               min-width="140"

+ 1 - 1
src/views/modules/sale/purchase-detail.vue

@@ -102,7 +102,7 @@
             label="批次号">
           </el-table-column>
            <el-table-column
-            prop="use"
+            prop="purpose"
             header-align="center"
             align="center"
             min-width="140"

+ 1 - 1
src/views/modules/sale/purchase.vue

@@ -143,7 +143,7 @@
           label="批次号">
         </el-table-column>
         <el-table-column
-          prop="use"
+          prop="purpose"
           header-align="center"
           align="center"
           min-width="160"

+ 1 - 1
src/views/modules/warehouse/category-add-or-update.vue

@@ -100,7 +100,7 @@ export default {
           if (data.code === '200') {
             this.dataForm = data.data
             console.log(this.dataForm)
-            if (this.dataForm.parentId == '0') {
+            if (this.dataForm.parentId === '0') {
               this.dataForm.parentId = ''
             }
           } else {

+ 49 - 49
src/views/modules/warehouse/category-move.vue

@@ -39,99 +39,99 @@
 
 <script>
 export default {
-  name: "category-move",
+  name: 'category-move',
   components: {},
-  data() {
+  data () {
     return {
       visible: false,
       id: 0,
       dataForm: {
-        id: "",
+        id: ''
       },
       dataList: [],
       dataRule: {
-        materialTypeId: { required: true, trigger: "blur", message: "请选择" },
-      },
-    };
+        materialTypeId: { required: true, trigger: 'blur', message: '请选择' }
+      }
+    }
   },
   methods: {
-    onChose() {
-      this.$emit("onChose");
+    onChose () {
+      this.$emit('onChose')
     },
-    async init(id) {
-      this.visible = true;
-      this.id = id || 0;
-      this.dataForm = {};
-      this.dataForm.id = id || 0;
+    async init (id) {
+      this.visible = true
+      this.id = id || 0
+      this.dataForm = {}
+      this.dataForm.id = id || 0
 
-      await this.getDataList();
+      await this.getDataList()
 
       if (this.id) {
         this.$http({
           url: this.$http.adornUrl(`/biz-service/wh-category/info/${this.id}`),
-          method: "get",
-          params: this.$http.adornParams(),
+          method: 'get',
+          params: this.$http.adornParams()
         }).then(({ data }) => {
-          if (data.code === "200") {
-            this.dataForm = data.data;
-            if (this.dataForm.parentId == "0") {
-              this.dataForm.parentId = "";
+          if (data.code === '200') {
+            this.dataForm = data.data
+            if (this.dataForm.parentId === '0') {
+              this.dataForm.parentId = ''
             }
           } else {
-            this.$message.error(data.msg);
+            this.$message.error(data.msg)
           }
-        });
+        })
       }
     },
     // 表单提交
-    dataFormSubmit() {
-      this.$refs["dataForm"].validate((valid) => {
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           this.$http({
             url: this.$http.adornUrl(`/biz-service/wh-category/move`),
-            method: "post",
+            method: 'post',
             data: {
               businessId: this.dataForm.id,
-              materialTypeId: this.dataForm.materialTypeId,
-            },
+              materialTypeId: this.dataForm.materialTypeId
+            }
           }).then(({ data }) => {
-            if (data && data.code === "200") {
+            if (data && data.code === '200') {
               this.$message({
-                message: "操作成功",
-                type: "success",
+                message: '操作成功',
+                type: 'success',
                 duration: 1500,
                 onClose: () => {
-                  this.onChose();
-                  this.$emit("refreshDataList");
-                },
-              });
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
             } else {
-              this.$message.error(data.msg);
+              this.$message.error(data.msg)
             }
-          });
+          })
         }
-      });
+      })
     },
     // 获取数据列表
-    getDataList(name) {
+    getDataList (name) {
       this.$http({
-        url: this.$http.adornUrl("/biz-service/wh-category/list"),
-        method: "get",
+        url: this.$http.adornUrl('/biz-service/wh-category/list'),
+        method: 'get',
         params: this.$http.adornParams({
           current: this.pageIndex,
           size: 100,
-          materialName: name,
-        }),
+          materialName: name
+        })
       }).then(({ data }) => {
-        if (data && data.code === "200") {
-          this.dataList = data.data.records;
+        if (data && data.code === '200') {
+          this.dataList = data.data.records
         } else {
-          this.dataList = [];
+          this.dataList = []
         }
-      });
-    },
-  },
-};
+      })
+    }
+  }
+}
 </script>
 
 <style scoped></style>