Browse Source

no message

linwenxin 7 tháng trước cách đây
mục cha
commit
254af5ce8d

+ 16 - 16
src/api/material-system/center/center-parts-shop-in-stock.js

@@ -1,45 +1,45 @@
-import request, { postBlob, handleImport } from "@/utils/request";
+import request, { postBlob, handleImport } from '@/utils/request'
 
 export function partsNewInList(data) {
   return request({
-    url: `/parts/new-in/list?moduleId=${data.moduleId}`,
-    method: "post",
+    url: `/websit/parts/new-in/list?moduleId=${data.moduleId}`,
+    method: 'post',
     data
-  });
+  })
 }
 
 export function partsNewInExport(data, name) {
   return postBlob({
-    url: "/parts/new-in/list/export",
+    url: '/websit/parts/new-in/list/export',
     data,
     name
-  });
+  })
 }
 
 export function partsNewInImport(data) {
-  return handleImport("parts/new-in/import", data.formdata, data.id || "");
+  return handleImport('parts/new-in/import', data.formdata, data.id || '')
 }
 
 export function partsNewInAdd(data) {
   return request({
-    url: `/parts/new-in/add`,
-    method: "post",
+    url: `/websit/parts/new-in/add`,
+    method: 'post',
     data
-  });
+  })
 }
 
 export function partsNewInUpdate(params) {
   return request({
-    url: `/parts/new-in/update`,
-    method: "post",
+    url: `/websit/parts/new-in/update`,
+    method: 'post',
     params
-  });
+  })
 }
 
 export function partsNewInDel(params) {
   return request({
-    url: `/parts/new-in/del`,
-    method: "post",
+    url: `/websit/parts/new-in/del`,
+    method: 'post',
     params
-  });
+  })
 }

+ 41 - 24
src/views/partsManagement/accessoryCenterIdentity/center-parts-shop-in-stock/index.vue

@@ -27,34 +27,12 @@ import {
   partsNewInUpdate,
   partsNewInDel
 } from '@/api/material-system/center/center-parts-shop-in-stock'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   components: { TemplatePage, CenterPartsShopInStockFrom },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '配件入库',
-              click: this.update,
-              isRole: this.checkBtnRole('edit')
-            }
-          ]
-        ],
-        [[{ name: '新增', click: this.add, isRole: this.checkBtnRole('add') }]],
-        [[{ name: '删除', click: this.del, isRole: this.checkBtnRole('del') }]],
-        [
-          [
-            {
-              name: '',
-              render: this.importButton(partsNewInImport),
-              isRole: this.checkBtnRole('add')
-            }
-          ]
-        ]
-      ],
       // 表格属性
       tableAttributes: {
         selectColumn: true,
@@ -68,6 +46,45 @@ export default {
       showFromBool: false
     }
   },
+  computed: {
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('partsStorage', {
+              click: this.update
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: this.add
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('dels', {
+              click: this.del
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('import', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(partsNewInImport, moduleName)
+                }
+              }
+            })
+          ]
+        ]
+      ]
+    }
+  },
   methods: {
     // 列表请求函数
     getList(...p) {

+ 31 - 30
src/views/partsManagement/accessoryCenterIdentity/components/center-parts-shop-in-stock-from.vue

@@ -12,34 +12,41 @@
         <el-table-column label="配件网点" width="180">
           <template slot-scope="scope">
             <el-select v-model="scope.row.receiveShopId" placeholder="请选择" @change="update2(scope.$index)">
-              <el-option v-for="item in records" :key="item.shopId" :label="item.shopName" :value="item.shopId">
+              <el-option v-for="item in records" :key="item.websitId" :label="item.name" :value="item.websitId">
               </el-option>
             </el-select>
           </template>
         </el-table-column>
         <el-table-column label="配件编码" width="180">
           <template slot-scope="scope">
-            <el-select v-model="scope.row.partsID" placeholder="请选择" @change="update(scope.$index)">
-              <el-option v-for="item in partsList" :key="item.id" :label="item.partsNumber" :value="item.id">
+            <el-select v-model="scope.row.partsNumber" placeholder="请选择" @change="update(scope.$index)">
+              <el-option
+                v-for="item in partsList"
+                :key="item.goodsCode"
+                :label="item.goodsCode"
+                :value="item.goodsCode"
+              >
               </el-option>
             </el-select>
           </template>
         </el-table-column>
         <el-table-column label="配件名称" width="180">
           <template slot-scope="scope">
-            <el-select v-model="scope.row.partsID" placeholder="请选择" @change="update(scope.$index)">
-              <el-option v-for="item in partsList" :key="item.id" :label="item.partsName" :value="item.id"> </el-option>
+            <el-select v-model="scope.row.partsNumber" placeholder="请选择" @change="update(scope.$index)">
+              <el-option
+                v-for="item in partsList"
+                :key="item.goodsCode"
+                :label="item.goodsName"
+                :value="item.goodsCode"
+              >
+              </el-option>
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column label="类别" width="120">
-          <template slot-scope="scope">
-            <el-input disabled v-model="scope.row.partsCategoryName" placeholder="请输入内容"></el-input>
-          </template>
-        </el-table-column>
+
         <el-table-column label="单位" width="120">
           <template slot-scope="scope">
-            <el-input disabled v-model="scope.row.unitName" placeholder="请输入内容"></el-input>
+            <el-input disabled v-model="scope.row.goodsStockUnit" placeholder="请输入内容"></el-input>
           </template>
         </el-table-column>
         <el-table-column label="单价(采购价)" width="120">
@@ -80,9 +87,9 @@
 </template>
 
 <script>
-import { partsInfoList } from '@/api/material-system/center/parts-base-manage'
 import { partsNewInAdd } from '@/api/material-system/center/center-parts-shop-in-stock'
-import { getShopList } from '@/api/material-system/setting'
+import { getWebsit } from '@/api/customerManagement.js'
+import { listPageV2 } from '@/api/auxiliaryFittings/attachmentProfile'
 export default {
   props: {},
   data() {
@@ -93,21 +100,15 @@ export default {
     }
   },
   mounted() {
-    partsInfoList({
-      pageNum: 1,
-      pageSize: -1
+    getWebsit({ type: 'C', status: true, queryPartsWebsit: true }).then(res => {
+      this.records = res.data
     })
-      .then(res => {
-        this.partsList = res.data.records
-      })
-      .catch(err => {
-        console.log(err)
-      })
-    getShopList({
+    listPageV2({
       pageNum: 1,
-      pageSize: -1
+      pageSize: -1,
+      params: [{ param: 'a.status', compare: '=', value: 'ON' }]
     }).then(res => {
-      this.records = res.data.records
+      this.partsList = res.data.records
     })
   },
   methods: {
@@ -118,18 +119,18 @@ export default {
       this.tableData.splice(index, 1)
     },
     update(index) {
-      var data = this.partsList.find(item => item.id === this.tableData[index].partsID)
+      var data = this.partsList.find(item => item.goodsCode === this.tableData[index].partsNumber)
       Object.assign(this.tableData[index], data || {}, {
-        remark: this.tableData[index].remark
+        remark: this.tableData?.[index]?.remark
       })
     },
     update2(index) {
-      var data = this.records.find(item => item.shopId === this.tableData[index].receiveShopId)
+      var data = this.records.find(item => item.websitId === this.tableData[index].receiveShopId)
       if (data) {
         Object.assign(this.tableData[index], {
           remark: this.tableData[index].remark,
           receivePartsWebsiteNumber: data.partsWebsiteNumber,
-          receiveShopName: data.shopName
+          receiveShopName: data.name
         })
       } else {
         this.tableData[index]['receivePartsWebsiteNumber'] = ''
@@ -203,7 +204,7 @@ export default {
     .el-input,
     .el-textarea__inner,
     .el-input__inner {
-      height: 100%;
+      // height: 100% !important;
       border: none !important;
     }
   }