保存纤度登记的接口,字段类型调整,处理数据格式+联调获取纤度检验列表的接口,字段调试
3个文件已修改
130 ■■■■■ 已修改文件
src/api/productManage/silkRegisterForm.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/appsidebar/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/silkRegisterForm/addPage.vue 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/productManage/silkRegisterForm.js
@@ -2,7 +2,7 @@
// 纤度登记列表 
export function getRegisterList(data) {
  return request({
    url: "/api-jl/v1/fineness/register?page="+ data.page+"&pageSize="+data.pageSize,
    url: "/api-jl/v1/fineness/register?page="+ data.page+"&pageSize="+data.pageSize+"&keyword="+data.keyword,
    method: "get",
    data
  })
src/components/layout/components/appsidebar/index.vue
@@ -21,7 +21,7 @@
            <i class="el-icon-user-solid icon"></i>
            <span>系统设置</span>
          </template>
          <el-menu-item index="/systemSetting/silkStandardSetting">生丝定级标准</el-menu-item>
          <el-menu-item index="/systemSetting/silkStandardSetting">生丝标准设置</el-menu-item>
          <el-menu-item index="/systemSetting/silkPriceStandard">生丝定价标准</el-menu-item>
          <el-menu-item index="/systemSetting/workshopManage">车间管理</el-menu-item>
          <el-menu-item index="/systemSetting/dataDictionary">数据字典</el-menu-item>
src/views/productManage/silkRegisterForm/addPage.vue
@@ -61,6 +61,7 @@
                                    :value="item.ID">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="回数" prop='circle' class="form-item">
                            <el-row>
@@ -125,8 +126,8 @@
                        </el-form-item>
                        <el-form-item label="组别" prop="workshopGroup" class="form-item">
                            <el-select v-model="form.workshopGroup" placeholder="请选择" class="select-width">
                                <el-option v-for="item in workshopGroupList" :key="item.ID" :label="item.name"
                                    :value="item.ID">
                                <el-option v-for="item in workshopGroupList" :key="item.ID" :label="item.workshopNumber"
                                    :value="item.workshopNumber">
                                </el-option>
                            </el-select>
                        </el-form-item>
@@ -246,6 +247,7 @@
  
<script>
import { getRegisterList,saveRegister,getDictList,getWorkshopManageList,getRegisterDetails } from "@/api/productManage/silkRegisterForm.js"
import {getCheckDetails,saveCheck,} from "@/api/productManage/silkInspectForm.js"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
export default {
@@ -261,8 +263,7 @@
            loading: false,
            activeName: "first",
            searchOptions: [],
            search_map: {},
            is_public: true,
            keyword: '',
            marketList:[], //庄口
            nameList:[], //车间
            workshopGroupList:[], //组别
@@ -364,17 +365,17 @@
                tableData: [
                    {
                        productId:1,
                        position: '',
                        fineness: 0,
                        quantity: 0,
                        sum: "",
                        position: null,
                        fineness: null,
                        quantity: null,
                        sum: null,
                    }
                ],
                tableColumn:[
                    { label: "车号", prop: "position", input: true }, // 客户名称
                    { label: "车号", prop: "position", inputNumber: true,isRequird: true, }, // 客户名称
                    { label: "纤度值", prop: "fineness", inputNumber: true, isRequird: true, }, // 销售负责人
                    { label: "数量", prop: "quantity", inputNumber: true , isRequird: true,}, // 重要级别
                    { label: "纤度合计", prop: "sum", inputNumber: true}, // 下次回访日期
                    { label: "纤度合计", prop: "sum", inputNumber: true,isRequird: true,}, // 下次回访日期
                ],
            },
            tableData:[],
@@ -388,25 +389,33 @@
            this.registerId= query.id ? query.id : "";
        }
        this.getSelectDataList()
        this.search_map = {
            is_public: this.is_public
        }
        this.keyword=''
        this.getDetailsData()
        this.getData()
    },
    methods: {
        getDetailsData(){
            if(this.registerId){
                getRegisterDetails({ id: this.registerId }).then((response) => {
                    if (response.code === 200) {
                    let config=JSON.parse(JSON.stringify(response.data?response.data:{}));
                    this.form=config;
                    this.tableList.tableData=config.finenessList?config.finenessList:[]
                    this.tableData=config.finenessList?config.finenessList:[]
                    }
                })
                if(this.activeName=='first'){
                    getRegisterDetails({ id: this.registerId }).then((response) => {
                        if (response.code === 200) {
                        let config=JSON.parse(JSON.stringify(response.data?response.data:{}));
                        this.form=config;
                        this.tableList.tableData=config.finenessList?config.finenessList:[]
                        this.tableData=config.finenessList?config.finenessList:[]
                        }
                    })
                }else{
                    getCheckDetails({ id: this.registerId }).then((response) => {
                        if (response.code === 200) {
                        let config=JSON.parse(JSON.stringify(response.data?response.data:{}));
                        this.form=config;
                        this.tableList.tableData=config.finenessList?config.finenessList:[]
                        this.tableData=config.finenessList?config.finenessList:[]
                        }
                    })
                }
            }
        },
        getSelectDataList(){
            //车间
@@ -469,7 +478,7 @@
        async getData() {
            this.loading = true
            await getRegisterList({
                search_map: this.search_map,
                keyword: this.keyword?this.keyword:'',
                page: this.pagerOptions.currPage,
                pageSize: this.pagerOptions.pageSize
            })
@@ -525,24 +534,21 @@
                })
        },
        tabsClick(tab) {
            console.log(tab.name)
            if (tab.name === "first") {
                this.is_public = true
            } else {
                this.is_public = false
            }
            this.search_map = {
                is_public: this.is_public
            }
            // if (tab.name === "first") {
            //     this.is_public = true
            // } else {
            //     this.is_public = false
            // }
            this.$router.push({
                path:"/productManage/silkRegisterForm/addPage?activeName="+tab.name,
            });
            this.keyword = ''
            this.pagerOptions.currPage = 1
            this.getData()
        },
        // 搜索
        onFilterSearch(searchText) {
            this.search_map = {
                is_public: this.is_public,
                name: searchText
            }
            this.keyword=searchText||''
            this.pagerOptions.currPage = 1
            this.getData()
        },
@@ -587,20 +593,42 @@
                        finenessList:finenessList,
                        ...form
                    }
                    // 编辑
                    if(this.registerId){
                        params.id=this.registerId
                    }
                    // params.workshopGroup=Number(params.workshopGroup)
                    this.isAddloading=true
                    saveRegister(params).then((res) => {
                        if (res.code == 200) {
                            this.$message({
                                message: "保存成功!",
                                type: "success",
                            });
                        }
                        this.isAddloading=false
                    }).catch(() => {
                        setTimeout(() => {
                            this.isAddloading = false;
                            }, 3000);
                    })
                    if(this.activeName=='first'){
                        saveRegister(params).then((res) => {
                            if (res.code == 200) {
                                this.$message({
                                    message: "保存成功!",
                                    type: "success",
                                });
                            }
                            this.isAddloading=false
                        }).catch(() => {
                            setTimeout(() => {
                                this.isAddloading = false;
                                }, 3000);
                        })
                    }else{
                        saveCheck(params).then((res) => {
                            if (res.code == 200) {
                                this.$message({
                                    message: "保存成功!",
                                    type: "success",
                                });
                            }
                            this.isAddloading=false
                        }).catch(() => {
                            setTimeout(() => {
                                this.isAddloading = false;
                                }, 3000);
                        })
                    }
                } else {
                    console.log('error submit!!');