瀏覽代碼

no message

linwenxin 7 月之前
父節點
當前提交
6ecdd26455

+ 1 - 1
src/api/auxiliaryFittings/supplier.js

@@ -43,4 +43,4 @@ export function getDetail(params) {
     method: 'post',
     params
   })
-}
+}

+ 10 - 10
src/api/material-system/vender.js

@@ -78,7 +78,7 @@ export function editVenderGoodsSheet(data) {
 export function getVenderGoodsSheet(params) {
   return request({
     url: '/vender/goods/detail',
-    method: 'get',
+    method: 'post',
     params
   })
 }
@@ -95,6 +95,15 @@ export function newGetVenderList(data) {
 
 // ------------------------------------------
 
+// 获取供应商资料列表
+export function getVenderList(params) {
+  return request({
+    url: '/vender/master/list',
+    method: 'get',
+    params
+  })
+}
+
 // 获取供应商产品关系维护单列表
 export function getVenderGoodsSheetList(params) {
   return request({
@@ -112,15 +121,6 @@ export function newGetVenderListExport(data, name) {
   })
 }
 
-// 获取供应商资料列表
-export function getVenderList(params) {
-  return request({
-    url: '/vender/master/list',
-    method: 'get',
-    params
-  })
-}
-
 // 获取供应商资料信息
 export function getVender(params) {
   return request({

+ 34 - 31
src/views/auxiliaryFittings/vender/components/VenderGoodsArea.vue

@@ -12,7 +12,13 @@
           style="width: 100%"
           filterable
         >
-          <el-option v-for="(item, index) in venderList" :key="index" :label="item.venderName" :value="item.venderId" />
+          <el-option
+            v-for="(item, index) in venderList"
+            :key="index"
+            :label="item.venderName"
+            :value="item.venderId"
+            :disabled="item.status !== 'ON'"
+          />
         </el-select>
       </el-form-item>
       <el-form-item label="备注" prop="notes">
@@ -41,22 +47,16 @@
           >
             <el-table-column prop="goodsId" label="辅材编号" width="80" />
             <el-table-column prop="goodsName" label="辅材名称" width="180" />
-            <el-table-column prop="productModel" label="商号型号" />
-            <el-table-column prop="specification" label="规格" />
+            <el-table-column prop="goodsSpecification" label="规格" />
             <el-table-column prop="cost" label="进价">
               <template slot-scope="scope">
                 <el-input v-model="scope.row.cost" :disabled="inputParam.openType === 'view'" />
               </template>
             </el-table-column>
-            <el-table-column prop="ndays" label="供货天数">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.ndays" :disabled="inputParam.openType === 'view'" />
-              </template>
-            </el-table-column>
-            <el-table-column prop="flag" label="状态">
+            <el-table-column prop="status" label="状态">
               <template slot-scope="scope">
                 <el-select
-                  v-model="scope.row.flag"
+                  v-model="scope.row.status"
                   placeholder="请选择状态"
                   style="width: 100%"
                   :disabled="inputParam.openType === 'view'"
@@ -124,8 +124,7 @@
         <el-table-column prop="goodsName" label="辅材名称" width="280" />
         <el-table-column prop="goodsCode" label="辅材代码" />
         <el-table-column prop="categoryName" label="小类名称" />
-        <el-table-column prop="productModel" label="商号型号" />
-        <el-table-column prop="specification" label="规格" />
+        <el-table-column prop="goodsSpecification" label="规格" />
       </el-table>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="selGoods">确 定</el-button>
@@ -139,14 +138,9 @@
 </template>
 
 <script>
-import {
-  addVenderGoodsSheet,
-  editVenderGoodsSheet,
-  getVenderGoodsSheet,
-  getVenderList
-} from '@/api/material-system/vender'
-import { getMaterialList } from '@/api/material-system/material'
-
+import { addVenderGoodsSheet, editVenderGoodsSheet, getVenderGoodsSheet } from '@/api/material-system/vender'
+import { listPageV2 } from '@/api/auxiliaryFittings/supplier'
+import { materialNormList } from '@/api/auxiliaryPriceManagement'
 export default {
   name: 'VenderGoodsArea',
   props: {
@@ -173,8 +167,8 @@ export default {
       goodsList: [], // 商品列表
       venderList: [], // 供应商列表
       select_item_flag: [
-        { label: '有效', value: 1 },
-        { label: '无效', value: 0 }
+        { label: '有效', value: 'ON' },
+        { label: '无效', value: 'OFF' }
       ],
       dataFormRules: {
         venderId: [{ required: true, message: '请选择供应商', trigger: 'change' }]
@@ -199,9 +193,8 @@ export default {
     getDetail(id) {
       this.loading = true
       const openType = this.inputParam.openType
-      const sheetId = id || this.inputParam.sheetId
       if (openType !== 'add') {
-        getVenderGoodsSheet({ sheetId }).then(res => {
+        getVenderGoodsSheet({ id: id || this.inputParam.sheetId }).then(res => {
           this.setDataForm(res.data)
           this.loading = false
         })
@@ -223,13 +216,25 @@ export default {
     },
     // 获取辅材列表
     getMaterialList() {
-      getMaterialList({ pageNum: 1, pageSize: -1, status: 1 }).then(res => {
+      materialNormList({
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'a.status', compare: '=', value: 'ON' }]
+      }).then(res => {
         this.goodsList = res.data.records
+        console.log(res.data.records)
       })
     },
     // 获取供应商列表
     getVenderList() {
-      getVenderList({ pageNum: 1, pageSize: 100, flag: 1 }).then(res => {
+      listPageV2({
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          { param: 'a.status', compare: '=', value: 'ON' },
+          { param: 'a.vender_type', compare: 'like', value: '辅材' }
+        ]
+      }).then(res => {
         this.venderList = res.data.records
       })
     },
@@ -237,7 +242,7 @@ export default {
     submitForm() {
       this.$refs.dataForm.validate(valid => {
         if (valid) {
-          this.dataForm.venderName = this.getArraysName(this.venderList, this.dataForm, 'venderId', 'venderName')
+          this.dataForm.venderName = this.venderList?.find(item => item.venderId === this.dataForm.venderId)?.venderName
           if (this.inputParam.openType === 'edit') {
             editVenderGoodsSheet(this.dataForm).then(() => {
               this.cancelForm()
@@ -263,11 +268,9 @@ export default {
           this.dataForm.items.push({
             goodsId: value.goodsId,
             goodsName: value.goodsName,
-            productModel: value.productModel,
-            specification: value.specification,
+            goodsSpecification: value.goodsSpecification,
             cost: 0,
-            ndays: 365,
-            flag: 1
+            status: 'ON'
           })
         }
       })

+ 1 - 1
src/views/auxiliaryFittings/vender/vender-goods-sheet/index.vue

@@ -18,7 +18,7 @@
         :getList="getList"
         :exportList="exportList"
         :columnParsing="columnParsing"
-        :operation="operation"
+        :operation="operation()"
         :optionsEvensGroup="optionsEvensGroup"
         :tableAttributes="tableAttributes"
         :tableEvents="tableEvents"