From ef02f737f198ebe11178a956cb0e5caba2bc9508 Mon Sep 17 00:00:00 2001
From: cy <1664593601@qq.com>
Date: 星期三, 01 十一月 2023 15:59:47 +0800
Subject: [PATCH] feat: 盘点单生成入库、出库单

---
 admin-web/src/views/foundation/material/edit.vue |   65 ++++++++++++++++++++------------
 1 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/admin-web/src/views/foundation/material/edit.vue b/admin-web/src/views/foundation/material/edit.vue
index 1d1ad94..9b014dd 100644
--- a/admin-web/src/views/foundation/material/edit.vue
+++ b/admin-web/src/views/foundation/material/edit.vue
@@ -2,27 +2,31 @@
   <win-md :title="setting.title" @close="close" :width="'800px'">
     <el-form ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm" label-width="100px">
       <el-form-item label="鐗╁搧缂栧彿">
-        <el-input v-model="formData.code88" disabled clearable maxlength="20" show-word-limit style="width: 100%"/>
+        <el-input v-model="formData.goodsCode" disabled clearable maxlength="20" show-word-limit style="width: 100%"/>
       </el-form-item>
-      <el-form-item label="鐗╁搧鍚嶇О" prop="name">
-        <el-input v-model="formData.name" clearable maxlength="20" show-word-limit style="width: 100%"/>
+      <el-form-item label="鐗╁搧鍚嶇О" prop="goodsName">
+        <el-input v-model="formData.goodsName" clearable maxlength="20" show-word-limit style="width: 100%"/>
       </el-form-item>
-      <el-form-item style="margin-left: -100px;" v-for="(m, i) in formData.code">
-        <el-form-item label="瑙勬牸鍨嬪彿" prop="name" style="float: left;">
-          <el-input v-model="m.name" clearable maxlength="20" show-word-limit style="width: 100%"/>
+      <el-form-item label="鍒嗙被" prop="categoryId">
+        <el-select v-model="formData.categoryId" clearable placeholder="璇烽�夋嫨"  style="width: 100%">
+          <el-option v-for="item in categoryList" :key="item.id" :label="item.categoryName" :value="item.id"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item style="margin-left: -100px;" v-for="(m, i) in formData.models">
+        <el-form-item label="瑙勬牸鍨嬪彿" prop="modelName" style="float: left;">
+          <el-input v-model="m.modelName" clearable maxlength="20" show-word-limit style="width: 100%"/>
         </el-form-item>
-        <el-form-item label="鍗曚綅" prop="name" style="float: left;">
-          <el-input v-model="m.code" clearable maxlength="20" show-word-limit style="width: 100%"/>
+        <el-form-item label="鍗曚綅" prop="unit" style="float: left;">
+          <el-input v-model="m.unit" clearable maxlength="20" show-word-limit style="width: 100%"/>
         </el-form-item>
         <my-button name="鏂板鍨嬪彿" type="" @click="addCode"/>
         <my-button name="鍒犻櫎" type="" @click="delCode(i)"/>
       </el-form-item>
-      <el-form-item label="鐘舵��">
-        <el-switch
-          v-model="formData.status"
-          active-color="#0d997c"
-          inactive-color="#C0CCDA">
-        </el-switch>
+      <el-form-item label="鐘舵��" prop="states">
+        <el-radio-group v-model="formData.states">
+          <el-radio :label="1" border>鍚敤</el-radio>
+          <el-radio :label="0" border>绂佺敤</el-radio>
+        </el-radio-group>
       </el-form-item>
     </el-form>
     <div slot="footer" align="center" class="dialog-footer">
@@ -48,19 +52,21 @@
   },
   data() {
     return {
+      categoryList:[],
       checkAll: false,
       checkedList: [],
       formData: {
         radio1: '',
         code: '',
         name: '',
-        status: true,
+        states: '',
         summary: '',
-        code:[
+        categoryId: null,
+        models:[
           {
-            name:'12',
-            code:'13'
-          },
+            modelName:'',
+            unit:''
+          }
         ]
       },
       rules: {
@@ -71,21 +77,30 @@
     }
   },
   created() {
+    this.tree_List()
     if(this.setting.info){
       this.formData = Object.assign({},JSON.parse(this.setting.info))
     }
   },
   methods: {
+    tree_List (){
+      finsystenant.treeList().then(res => {
+        if (res) {
+          console.log(res,'res');
+          this.categoryList = res
+        }
+      })
+    },
     addCode(){
-      this.formData.code.push(
+      this.formData.models.push(
         {
-          name:'',
-          code:''
+          modelName:'',
+          unit:''
         }
       )
     },
     delCode(index){
-      this.formData.code.splice(index, 1)
+      this.formData.models.splice(index, 1)
     },
     getEditInfo(id){
 
@@ -99,7 +114,7 @@
           const params = Object.assign({}, this.formData)
           if(this.setting.id){
             // 缂栬緫鎺ュ彛
-            finsystenant.edit(params).then(res => {
+            finsystenant.editcode(params).then(res => {
               if (res) {
                 this.$message.success('淇濆瓨鎴愬姛锛�')
                 this.close()
@@ -110,7 +125,7 @@
             })
           }else{
             params.orgId = this.setting.orgId
-            finsystenant.add(params).then(res => {
+            finsystenant.addcode(params).then(res => {
               if (res) {
                 this.$message.success('淇濆瓨鎴愬姛锛�')
                 this.close()

--
Gitblit v1.9.1