소스 검색

feat: 修改

linwenxin 1 년 전
부모
커밋
b9c63f2273

+ 21 - 3
src/views/auxiliaryFittings/purchasingManagement/components/inStorage.vue

@@ -40,8 +40,26 @@ export default {
   data() {
     return {
       formData: {
+        companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        "companyWechatId": "",
+        "confirmBy": "",
+        "confirmTime": "",
+        "createBy": "",
+        "createTime": "",
+        "flag": "",
+        "goodsType": "",
+        "purchaseId": "",
+        "purchaseTime": "",
+        "remark": "",
+        "totalAmount": 0,
+        "updateBy": "",
+        "updateTime": "",
+        "venderId": "",
+        "venderName": "",
+        "websitId": "",
+        "websitName": "",
         items: [],
-        imageUrl:[]
+        imageUrl: []
       },
     }
   },
@@ -62,10 +80,10 @@ export default {
     operation(h, { row, index, column }) {
       return (
         <div class='operation-btns'>
-          {row.flag=="SAVE" ? <el-button type="text" onClick={() => {
+          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
             this.getDetail(row.purchaseId, 1)
           }}>编辑</el-button> : null}
-          {row.flag=="SAVE" ? <el-button type="text" onClick={() => {
+          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
             this.getDetail(row.purchaseId, 3)
           }}>审核</el-button> : null}
           <el-button type="text" onClick={() => {

+ 23 - 3
src/views/auxiliaryFittings/purchasingManagement/components/retStorage.vue

@@ -40,8 +40,28 @@ export default {
   data() {
     return {
       formData: {
+        companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        "companyWechatId": "",
+        "confirmBy": "",
+        "confirmTime": "",
+        "createBy": "",
+        "createTime": "",
+        "flag": "",
+        "goodsType": "",
+        "purchaseId": "",
+        "purchaseRetId": "",
+        "remark": "",
+        "retTime": "",
+        "retTotalAmount": 0,
+        "retTotalQty": 0,
+        "updateBy": "",
+        "updateTime": "",
+        "venderId": "",
+        "venderName": "",
+        "websitId": "",
+        "websitName": "",
         items: [],
-        imageUrl:[]
+        imageUrl: []
       },
     }
   },
@@ -62,10 +82,10 @@ export default {
     operation(h, { row, index, column }) {
       return (
         <div class='operation-btns'>
-          {row.flag=="SAVE" ? <el-button type="text" onClick={() => {
+          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
             this.getDetail(row.purchaseRetId, 1)
           }}>编辑</el-button> : null}
-          {row.flag=="SAVE" ? <el-button type="text" onClick={() => {
+          {row.flag == "SAVE" ? <el-button type="text" onClick={() => {
             this.getDetail(row.purchaseRetId, 3)
           }}>审核</el-button> : null}
           <el-button type="text" onClick={() => {

+ 48 - 32
src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js

@@ -1,4 +1,6 @@
 import ImageUpload from '@/components/file-upload'
+import { getWebsit } from "@/api/customerManagement.js"
+import { listPageV2 } from "@/api/auxiliaryFittings/supplier";
 export default {
   data() {
     return {
@@ -104,7 +106,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '辅材名称',
-                prop: 'avatar',
+                prop: 'goodsName',
               },
               render: (h, { row, column, index }) => {
                 return (
@@ -124,7 +126,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '配件名称',
-                prop: 'avatar',
+                prop: 'goodsName',
               },
               render: (h, { row, column, index }) => {
                 return (
@@ -144,7 +146,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '单位',
-                prop: 'purchaseId',
+                prop: 'goodsStockUnit',
               }
             }]
           }
@@ -212,7 +214,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '商品代码',
-                prop: '',
+                prop: 'goodsCode',
               }
             }]
           }
@@ -234,7 +236,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '配件编码',
-                prop: '',
+                prop: 'goodsId',
               }
             }]
           }
@@ -245,7 +247,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '适用品牌',
-                prop: '',
+                prop: 'brand',
               }
             }]
           }
@@ -256,7 +258,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '适用产品大类',
-                prop: '',
+                prop: 'productCategory',
               }
             }]
           }
@@ -267,7 +269,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '采购数量',
-                prop: '',
+                prop: 'recQty',
               }
             }]
           }
@@ -278,7 +280,7 @@ export default {
             return [{
               columnAttributes: {
                 label: '采购价格',
-                prop: '',
+                prop: 'cost',
               }
             }]
           }
@@ -289,18 +291,18 @@ export default {
             return [{
               columnAttributes: {
                 label: '采购金额',
-                prop: '',
+                prop: 'costValue',
               }
             }]
           }
           return []
         })(),
         ...(() => {
-          if (!!~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.pageType)) {
+          if (this.formData.flag === "SAVE" && !!~['auxiliaryMaterialsStorage', 'returnAuxiliaryMaterials', 'partsReturn'].indexOf(this.pageType)) {
             return [{
               columnAttributes: {
                 label: '库存数量',
-                prop: '',
+                prop: 'stockQty',
               }
             }]
           }
@@ -317,17 +319,21 @@ export default {
                 return (
                   <div class='operation-btns'>
                     <el-button type="text" onClick={() => {
-                      this.formData.items.map((item, index_) => {
-                        if (index_ == index) {
-                          item.isEditRow = true
-                        } else {
-                          item.isEditRow = false
-                        }
-                      })
-                    }}>编辑</el-button>
-                    <el-button type="text" onClick={() => {
                       this.formData.items.splice(index, 1)
                     }}>删除</el-button>
+                    {
+                      !row.isEditRow ?
+                      <el-button type="text" onClick={() => {
+                        this.formData.items.map((item, index_) => {
+                          if (index_ == index) {
+                            item.isEditRow = true
+                          } else {
+                            item.isEditRow = false
+                          }
+                        })
+                      }}>编辑</el-button> :
+                      null
+                    }
                   </div>
                 )
               }
@@ -365,10 +371,14 @@ export default {
                 </el-descriptions>
                 <el-descriptions border title="" column={2} colon={false} labelStyle={{ width: '8%' }} contentStyle={{ width: '42%' }} style="margin-top:-1px">
                   <el-descriptions-item label="网点名称">
-                    {this.formData.websitName}
+                    <el-select style="width:100%" value={this.formData.websitId} onInput={(val) => { this.formData.websitId = val }} placeholder="请选择">
+                      {this.getWebsitList.map(item => <el-option key={item.websitId} label={item.name} value={item.websitId}></el-option>)}
+                    </el-select>
                   </el-descriptions-item>
                   <el-descriptions-item label="供应商名称">
-                    {this.formData.venderName}
+                    <el-select style="width:100%" value={this.formData.venderId} onInput={(val) => { this.formData.venderId = val }} placeholder="请选择">
+                      {this.listPageV2Data.map(item => <el-option key={item.venderId} label={item.venderName} value={item.venderId}></el-option>)}
+                    </el-select>
                   </el-descriptions-item>
                 </el-descriptions>
                 {
@@ -378,10 +388,10 @@ export default {
                         {this.formData.purchaseId}
                       </el-descriptions-item>
                       <el-descriptions-item label="退货数量">
-                        {this.formData.purchaseId}
+                        {this.formData.retTotalQty}
                       </el-descriptions-item>
                       <el-descriptions-item label="退款金额">
-                        {this.formData.purchaseId}
+                        {this.formData.retTotalAmount}
                       </el-descriptions-item>
                     </el-descriptions> : null
                 }
@@ -438,6 +448,7 @@ export default {
               <div>
                 {!!~[0, 1].indexOf(this.formDialogType) ? <div style="margin-bottom:8px">
                   <el-button onClick={() => {
+                    this.formData.items.map((item) => {item.isEditRow = false})
                     this.formData.items.push({
                       "brand": "",
                       "companyWechatId": "",
@@ -445,6 +456,7 @@ export default {
                       "costValue": "",
                       "goodsCategoryId": "",
                       "goodsCategoryName": "",
+                      "goodsCode": "",
                       "goodsId": "",
                       "goodsName": "",
                       "goodsSpecification": "",
@@ -459,7 +471,8 @@ export default {
                       "retQty": "",
                       "stockQty": "",
                       "websitId": "",
-                      "websitName": ""
+                      "websitName": "",
+                      "isEditRow": true
                     })
                     // if (this.pageType == "auxiliaryMaterialsStorage") {
                     // } else if (this.pageType == "returnAuxiliaryMaterials") {
@@ -492,12 +505,15 @@ export default {
     },
     // 打开
     openForm() {
-      {/* Promise.all([
-            
-          ]).then(([res1]) => {
-            
-          }) */}
-      this.formDialog = true
+      Promise.all([
+        getWebsit(),
+        listPageV2({ "pageNum": 1, "pageSize": -1, "params": [] })
+      ]).then(([res1, res2]) => {
+        this.getWebsitList = res1.data.filter(item => item.type == "B")
+        this.listPageV2Data = res2.data.records
+        console.log(res1.data.filter(item => item.type == "B"), res2.data.records)
+        this.formDialog = true
+      })
     },
     // 添加
     addData() {