From 221cc610f407b71973013de281fd19f7fc909e52 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 19 十二月 2023 10:44:08 +0800
Subject: [PATCH] modified: src/const/crud/customerOrder/customerOrderForm.js
---
src/views/technology/structure/single-structure-form.vue | 166 +++++++++++++++++++++++++++++--------------------------
1 files changed, 88 insertions(+), 78 deletions(-)
diff --git a/src/views/technology/structure/single-structure-form.vue b/src/views/technology/structure/single-structure-form.vue
index b3ad774..813347d 100644
--- a/src/views/technology/structure/single-structure-form.vue
+++ b/src/views/technology/structure/single-structure-form.vue
@@ -2,11 +2,11 @@
<div style="height: 100%">
<div class="page-header">
<div class="header-left">
- <a @click="$router.go(-1)"><i class="icon-btn-back"></i></a>
+ <a @click="goBack"><i class="icon-btn-back"></i></a>
<h2>缂栬緫-浜у搧缁撴瀯</h2>
</div>
<div class="btn-group header-right">
- <el-button title="淇濆瓨" :disabled="isSubmit" v-thinclick="`save`"
+ <el-button title="淇濆瓨" type="primary" :disabled="isSubmit" v-thinclick="`save`"
>淇濆瓨</el-button
>
</div>
@@ -47,34 +47,6 @@
>
</el-input>
</el-form-item>
- <!-- <el-form-item label="缁撴瀯绫诲瀷" prop="bomTypeDb">
- <el-select
- v-model="dataForm.bomTypeDb"
- placeholder="璇烽�夋嫨缁撴瀯绫诲瀷"
- style="width:100%"
- >
- <el-option
- v-for="(item, index) in bomTypeDbOptions"
- :label="item.label"
- :value="item.value"
- :key="index"
- >
- </el-option>
- </el-select>
- </el-form-item> -->
- <!-- <el-form-item label="鏇夸唬" prop="alternativeNo">
- <el-input v-model="dataForm.alternativeNo"></el-input>
- </el-form-item>
- <el-form-item label="鏇夸唬鎻忚堪" prop="alternativeDesc">
- <el-input
- type="textarea"
- :autosize="{ minRows: 1, maxRows: 3 }"
- v-model="dataForm.alternativeDesc"
- ></el-input>
- </el-form-item> -->
- <!-- <el-form-item label="鐗堟湰鍙�" prop="version">
- <el-input v-model="dataForm.version" disabled></el-input>
- </el-form-item> -->
<el-form-item label="澶囨敞" prop="remark">
<el-input
type="textarea"
@@ -82,15 +54,6 @@
v-model="dataForm.remark"
></el-input>
</el-form-item>
- <!-- <el-form-item label="宸插悓姝ヨ嚦IFS" prop="ifsSync">
- <span
- style="width: 146px;display: inline-block;font-size:12px;font-weight:bold;"
- >{{ dataForm.ifsSync ? '鏄�' : '鍚�' }}</span
- >
- </el-form-item> -->
- <!-- <el-form-item label="榛樿缁撴瀯" prop="master">
- <el-checkbox v-model="dataForm.master"></el-checkbox>
- </el-form-item> -->
</el-col>
</el-row>
</el-form>
@@ -110,7 +73,7 @@
size="medium"
class="blue-but"
@click="addNode()"
- >娣诲姞
+ >娣诲姞琛�
</el-button>
</div>
</div>
@@ -120,12 +83,14 @@
:data="nodeList"
:default-sort="{ prop: 'lineItemNo' }"
height="650"
- :header-cell-style="{ color: '#999' }"
+ border
+ :header-cell-style="{ color: '#000' }"
:row-class-name="structureComponentRowClass"
+ class="l-mes"
>
<el-table-column
prop="lineItemNo"
- label="琛岄」鍙�"
+ label="搴忓彿"
align="center"
width="70"
>
@@ -135,11 +100,13 @@
prop="operationName"
align="center"
>
- <template scope="scope">
+ <template scope="scope" >
<el-input
- v-model="scope.row.operationName"
- placeholder="璇烽�夋嫨娑堣�楀伐搴�"
- v-if="scope.row.isUpdate"
+ style="width:90%"
+ v-model="scope.row.operationName"
+ placeholder="璇烽�夋嫨娑堣�楀伐搴�"
+ readonly
+ v-if="scope.row.isUpdate"
>
<el-button
slot="append"
@@ -155,6 +122,7 @@
<el-table-column label="闆朵欢鍙�" prop="partNo" align="center">
<template scope="scope">
<el-input
+ style="width:90%"
:class="customClass[scope.$index]"
v-model="scope.row.partNo"
placeholder="璇烽�夋嫨闆朵欢"
@@ -184,6 +152,8 @@
<el-table-column label="鏁伴噺" prop="qpa" align="center">
<template slot-scope="scope">
<el-input
+ style="width:90%"
+ clearable
size="small"
v-model="scope.row.qpa"
placeholder="璇峰~鍐欐暟閲�"
@@ -193,31 +163,15 @@
<span v-show="!scope.row.isUpdate">{{ scope.row.qpa }}</span>
</template>
</el-table-column>
-
<el-table-column label="鍗曚綅" prop="unit" align="center">
</el-table-column>
- <!-- <el-table-column label="鐩樻暟(鐩�)" prop="discNum" align="center">
- <template slot-scope="scope">
- <el-input
- size="small"
- v-model="scope.row.discNum"
- placeholder="璇峰~鍐欑洏鏁�"
- v-show="scope.row.isUpdate"
- ></el-input>
- <span v-show="!scope.row.isUpdate">{{
- scope.row.discNum
- }}</span>
- </template>
- </el-table-column> -->
- <!-- <el-table-column label="鍥惧彿" prop="drawingNumber" align="center">
- </el-table-column> -->
<el-table-column align="center" label="鎿嶄綔" width="85px">
<template slot-scope="scope">
<el-button
type="text"
size="small"
class="blue-but"
- v-if="!scope.row.isUpdate"
+ v-if="!scope.row.isUpdate && scope.row.id!=null"
@click="editNode(scope.$index, scope.row)"
>缂栬緫</el-button
>
@@ -225,7 +179,7 @@
type="text"
size="small"
class="blue-but"
- v-if="scope.row.isUpdate"
+ v-if="scope.row.isUpdate && scope.row.id!=null"
:loading="nodeSaveLoading"
@click="addOrUpdateNode(scope.$index, scope.row)"
>淇濆瓨</el-button
@@ -346,6 +300,26 @@
this.getBomTypeDbOptions()
},
methods: {
+ goBack(){
+ let isUnSave = false
+ const _than = this
+ _than.nodeList.forEach(e=>{
+ if(e.isUpdate || e.id==null){
+ isUnSave = true
+ }
+ })
+ if(isUnSave){
+ _than.$confirm('鎮ㄨ繕鏈夋湭淇濆瓨鐨勫瓙鑺傜偣锛岀‘璁ょ寮�鍚�?', '鎻愮ず', {
+ confirmButtonText: '浠嶈绂诲紑',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ _than.$router.go(-1)
+ }).catch(() => {});
+ }else{
+ _than.$router.go(-1)
+ }
+ },
// 鏌ヨ缁撴瀯绫诲瀷瀛楀吀
getBomTypeDbOptions() {
remote('bom_type_db').then((response) => {
@@ -424,41 +398,49 @@
this.currRow = null
},
save() {
+ const _than = this
this.isSubmit = true
- this.$refs.dataForm.validate((valid) => {
+ _than.nodeList.forEach(e=>{
+ e.version = _than.dataForm.version
+ })
+ _than.dataForm.components = _than.nodeList
+ _than.$refs.dataForm.validate((valid) => {
if (valid) {
- if (this.dataForm.id) {
- putObj(this.dataForm)
+ if (_than.dataForm.id) {
+ putObj(_than.dataForm)
.then((response) => {
var data = response.data
if (data.code === 0) {
- this.$message.success('淇濆瓨鎴愬姛')
+ _than.$message.success('淇濆瓨鎴愬姛')
+ _than.$nextTick(()=>{
+ _than.init(_than.dataForm.id)
+ })
} else {
- this.$message.error('淇濆瓨澶辫触')
+ _than.$message.error('淇濆瓨澶辫触')
}
- this.isSubmit = false
+ _than.isSubmit = false
})
.catch(() => {
- this.isSubmit = false
+ _than.isSubmit = false
})
} else {
- addObj(this.dataForm)
+ addObj(_than.dataForm)
.then((response) => {
var data = response.data
if (data.code === 0) {
- this.dataForm.id = data.data
- this.$message.success('淇濆瓨鎴愬姛')
+ _than.dataForm.id = data.data
+ _than.$message.success('淇濆瓨鎴愬姛')
} else {
- this.$message.error('淇濆瓨澶辫触')
+ _than.$message.error('淇濆瓨澶辫触')
}
- this.isSubmit = false
+ _than.isSubmit = false
})
.catch(() => {
- this.isSubmit = false
+ _than.isSubmit = false
})
}
} else {
- this.isSubmit = false
+ _than.isSubmit = false
}
})
},
@@ -635,6 +617,10 @@
}
},
delNode(index, row) {
+ if(row.id==null){
+ this.nodeList.splice(index,1)
+ return
+ }
this.$confirm('鏄惁纭鍒犻櫎闆朵欢鍙蜂负' + row.partNo, '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
@@ -826,4 +812,28 @@
.el-input__red {
border: 1px solid red;
}
+.l-mes .el-input-group__append,
+.l-mes .el-input-group__prepend {
+ padding: 0;
+ border-top: none;
+ border-right: none;
+ border-left: none;
+ border-radius: 0;
+ background-color: transparent;
+}
+
+.l-mes .el-input-group__append .el-button,
+.l-mes .el-input-group__prepend .el-button {
+ padding: 0;
+ width: 25px;
+ border: none !important;
+ line-height: 28px;
+ color: #c0c4cc;
+ margin: -1px 0;
+}
+
+.l-mes .el-input-group__append .el-button i,
+.l-mes .el-input-group__prepend .el-button i {
+ vertical-align: middle;
+}
</style>
--
Gitblit v1.9.3