From c00e8941aaa8acee4950978071571a5de2679dd1 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 08 四月 2024 14:36:09 +0800
Subject: [PATCH] 保存纤度登记的接口,字段类型调整,处理数据格式+联调获取纤度检验列表的接口,字段调试
---
src/views/productManage/silkRegisterForm/addPage.vue | 126 +++++++++++++++++++++++++----------------
src/api/productManage/silkRegisterForm.js | 2
src/components/layout/components/appsidebar/index.vue | 2
3 files changed, 79 insertions(+), 51 deletions(-)
diff --git a/src/api/productManage/silkRegisterForm.js b/src/api/productManage/silkRegisterForm.js
index e50631a..95b4d92 100644
--- a/src/api/productManage/silkRegisterForm.js
+++ b/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
})
diff --git a/src/components/layout/components/appsidebar/index.vue b/src/components/layout/components/appsidebar/index.vue
index 899306f..399cc40 100644
--- a/src/components/layout/components/appsidebar/index.vue
+++ b/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>
diff --git a/src/views/productManage/silkRegisterForm/addPage.vue b/src/views/productManage/silkRegisterForm/addPage.vue
index db3ef01..8029790 100644
--- a/src/views/productManage/silkRegisterForm/addPage.vue
+++ b/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, }, // 閿�鍞礋璐d汉
{ 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!!');
--
Gitblit v1.8.0