From 3f386968d4b5cbb002ad93483f86a5443159e18a Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期六, 08 二月 2025 09:54:32 +0800
Subject: [PATCH] 1.递交
---
src/views/materialManager/materialList.vue | 571 ++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 385 insertions(+), 186 deletions(-)
diff --git a/src/views/materialManager/materialList.vue b/src/views/materialManager/materialList.vue
index 3eac471..83c3938 100644
--- a/src/views/materialManager/materialList.vue
+++ b/src/views/materialManager/materialList.vue
@@ -24,17 +24,6 @@
<el-form-item label="姣嶄欢瑙勬牸" style=" display: flex;">
<el-input v-model="form.parentpartspec" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
- <!-- <el-form-item label="瀛樿揣绫诲瀷" style=" display: flex;">-->
- <!-- <el-select v-model="form.parttype" style="width: 200px" placeholder="璇烽�夋嫨">-->
- <!-- <el-option-->
- <!-- v-for="item in parttypeArr"-->
- <!-- :key="item.code"-->
- <!-- :label="item.name"-->
- <!-- :value="item.code"-->
- <!-- />-->
- <!-- </el-select>-->
- <!-- </el-form-item>-->
-
<el-form-item label="鐗堟湰缂栧彿" style=" display: flex;">
<el-input v-model="form.version" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
@@ -127,13 +116,23 @@
<template slot-scope="{row}">
<div v-if="!row[item.prop]">/</div>
- <div v-else-if="item.prop==='startdate'">{{ row.startdate.substring(0, 11) }}</div>
+ <!-- <div v-else-if="item.prop==='startdate'">{{ row.startdate.substring(0, 11) }}</div>-->
<div v-else-if="item.prop==='status'">
<div v-if="row[item.prop]==='Y'">
<i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
鏄�
</div>
<div v-if="row[item.prop]==='N'">
+ <i class="el-icon-info" style="margin-right: 2px" />
+ 鍚�
+ </div>
+ </div>
+ <div v-else-if="item.prop==='isdefaultbom'">
+ <div v-if="row[item.prop]==='1'">
+ <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+ 鏄�
+ </div>
+ <div v-if="row[item.prop]==='0'">
<i class="el-icon-info" style="margin-right: 2px" />
鍚�
</div>
@@ -316,13 +315,13 @@
label-width="80px"
style="margin-left: 20px;"
>
+
<el-form-item label="姣嶄欢缂栫爜" prop="parentpartcode">
<el-select
v-model="dialogForm.parentpartcode"
style="width: 490px"
placeholder="璇烽�夋嫨"
:popper-append-to-body="false"
- :disabled="operation!=='add'"
filterable
@change="partSelectChange"
>
@@ -397,7 +396,14 @@
/>
</el-form-item>
<el-form-item label="鐗堟湰鍙�" prop="version">
- <el-input v-model="dialogForm.version" disabled style="width: 200px" />
+ <el-input v-model="dialogForm.version" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="BOM灞傜骇">
+ <el-input v-model="dialogForm.bomdepth" disabled style="width: 200px" />
+ </el-form-item>
+
+ <el-form-item label="榛樿BOM">
+ <el-checkbox v-model="dialogForm.isdefaultbom" />
</el-form-item>
</el-form>
</div>
@@ -440,7 +446,6 @@
>
<template slot-scope="{row}">
<el-select
- v-if="row.isVisible===1"
v-model="row.SMATERIRL_CODE"
filterable
style="width: 100%;"
@@ -448,13 +453,12 @@
@change="val=>tableChange(val,row)"
>
<el-option
- v-for="item in PartSelectArr"
+ v-for="item in PartDetailSelectArr"
:key="item.partcode"
:label="item.partcode+' / '+item.partname"
:value="item.partcode"
/>
</el-select>
- <div v-if="row.isVisible===0">{{ row.SMATERIRL_CODE }}</div>
</template>
</el-table-column>
@@ -491,6 +495,53 @@
</template>
</el-table-column>
<el-table-column
+ prop="idchildbom"
+ label="瀛愪欢BOM"
+ width="110"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <!-- {{ row.idchildbom }}-->
+ <el-select
+ v-model="row.idchildbom"
+ style="width: 490px"
+ placeholder="璇烽�夋嫨"
+ >
+ <template slot="empty">
+ <el-table
+ :data="row.tableData2"
+ border
+ stripe
+ class="tableFixed"
+ highlight-current-row
+ :row-class-name="tableRowClassName"
+ style="width: 400px"
+ height="200"
+ @row-click="r=>rowClick(r,row)"
+ >
+ <el-table-column
+ prop="materiel_code"
+ label="浜у搧缂栫爜"
+ />
+ <el-table-column
+ prop="materiel_name"
+ label="浜у搧鍚嶇О"
+ />
+ <el-table-column
+ prop="materiel_spec"
+ label="瑙勬牸鍨嬪彿"
+ />
+ <el-table-column
+ prop="version"
+ label="鐗堟湰鍙�"
+ />
+ </el-table>
+ </template>
+ </el-select>
+ </template>
+ </el-table-column>
+
+ <el-table-column
prop="BASE_QUANTITY"
label="鍩烘湰鐢ㄩ噺"
width="110"
@@ -498,13 +549,11 @@
>
<template slot-scope="{row}">
<el-input
- v-if="row.isVisible===1"
v-model="row.BASE_QUANTITY"
oninput="value=value.replace(/[^0-9.]/g,'')"
placeholder="璇疯緭鍏�"
@input="val=>inputChange(val,row)"
/>
- <div v-if="row.isVisible===0">{{ row.BASE_QUANTITY }}</div>
</template>
</el-table-column>
<el-table-column
@@ -515,13 +564,12 @@
>
<template slot-scope="{row}">
<el-input
- v-if="row.isVisible===1"
+
v-model="row.LOSS_QUANTITY"
oninput="value=value.replace(/[^0-9.]/g,'')"
placeholder="璇疯緭鍏�"
@input="val=>inputChange(val,row)"
/>
- <div v-if="row.isVisible===0">{{ row.LOSS_QUANTITY }}</div>
</template>
</el-table-column>
<el-table-column
@@ -537,13 +585,9 @@
width="80"
fixed="right"
>
- <template slot-scope="{row}">
+ <template slot-scope="{row,$index}">
<div class="operationClass">
- <!-- <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveRow(row)">纭畾</el-button>-->
- <!-- <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancelRow(row)">鍙栨秷</el-button>-->
- <!-- <el-button v-if="row.isVisible===0" v-waves type="text" @click="editRow(row)">缂栬緫</el-button>-->
- <!-- <el-button v-if="row.isVisible===0" v-waves type="text" @click="delRow(row)">鍒犻櫎</el-button>-->
- <el-button v-waves type="text" @click="delRow(row)">鍒犻櫎</el-button>
+ <el-button v-waves type="text" @click="delRow(row,$index)">鍒犻櫎</el-button>
</div>
</template>
</el-table-column>
@@ -579,7 +623,7 @@
AddUpdateTBomUnitGroup,
BomMainData,
AddUpdateTBomParentData,
- TMaterielClassTree, AddUpdateTBomMaxVsion
+ AddUpdateTBomDetailsData, AddUpdateTBomMaxVsion, AddUpdateTBomDetailsBomData, TBomAddUpdate, TBomDelete
} from '@/api/ProductModel'
export default {
@@ -603,12 +647,12 @@
version: '', // 鐗堟湰鍙�
createusername: '', // 鍒涘缓浜哄憳
createdate: '', // 鍒涘缓鏃ユ湡
- prop: 'lm_date', // 鎺掑簭瀛楁
+ prop: 'id', // 鎺掑簭瀛楁
order: 'desc', // 鎺掑簭瀛楁
page: 1, // 绗嚑椤�
rows: 20 // 姣忛〉澶氬皯鏉�
},
- parttypeArr: [], // 瀛樿揣绫诲瀷
+
openTypeArr: [// 鍚敤鐘舵��
{ label: '鏄�', value: 'Y' },
{ label: '鍚�', value: 'N' }
@@ -619,11 +663,11 @@
tableColumnSettingsArray: [
{ minWidth: 50, width: false, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
- { minWidth: 25, width: 50, prop: 'RowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
+ { minWidth: 25, width: 50, prop: 'rowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
{
minWidth: 110,
width: false,
- prop: 'partcode',
+ prop: 'materiel_code',
label: '姣嶄欢缂栫爜',
id: 3,
show: true,
@@ -633,7 +677,7 @@
{
minWidth: 110,
width: false,
- prop: 'partname',
+ prop: 'materiel_name',
label: '姣嶄欢鍚嶇О',
id: 4,
show: true,
@@ -643,7 +687,7 @@
{
minWidth: 110,
width: false,
- prop: 'partspec',
+ prop: 'materiel_spec',
label: '姣嶄欢瑙勬牸',
id: 5,
show: true,
@@ -653,7 +697,7 @@
{
minWidth: 110,
width: false,
- prop: 'stocktype_name',
+ prop: 'materiel_typename',
label: '瀛樿揣绫诲瀷',
id: 6,
show: true,
@@ -663,7 +707,7 @@
{
minWidth: 110,
width: false,
- prop: 'uom_name',
+ prop: 'unitname',
label: '璁¢噺鍗曚綅',
id: 7,
show: true,
@@ -684,7 +728,7 @@
minWidth: false,
width: 110,
prop: 'status',
- label: '鍚姩鐘舵��',
+ label: '鍚敤鐘舵��',
id: 9,
show: true,
fixed: false,
@@ -707,13 +751,22 @@
show: true,
fixed: false,
sortable: true
+ }, {
+ minWidth: false,
+ width: 110,
+ prop: 'isdefaultbom',
+ label: '榛樿BOM',
+ id: 12,
+ show: true,
+ fixed: false,
+ sortable: true
},
{
minWidth: false,
width: 110,
- prop: 'username',
+ prop: 'lm_user',
label: '鍒涘缓浜哄憳',
- id: 12,
+ id: 13,
show: true,
fixed: false,
sortable: true
@@ -723,7 +776,7 @@
width: 160,
prop: 'lm_date',
label: '鍒涘缓鏃堕棿',
- id: 13,
+ id: 14,
show: true,
fixed: false,
sortable: true
@@ -743,7 +796,9 @@
quantity: '',
status: 'Y',
startdate: '',
- version: ''
+ version: '',
+ isdefaultbom: false,
+ bomdepth: ''
},
operation: '',
dialogFormRules: {
@@ -767,17 +822,15 @@
// ],
startdate: [
{ required: true, message: '璇烽�夋嫨鍚敤鏃ユ湡', trigger: ['blur', 'change'] }
+ ],
+ version: [
+ { required: true, message: '璇烽�夋嫨鐗堟湰鍙�', trigger: ['blur', 'change'] }
]
},
- PartSelectArrAll: [], // 浜у搧鎵�鏈夊��
PartSelectArr: [], // 浜у搧鍙�夊��
- PartSelectArrTemp: [], // 浜у搧宸查�夋殏瀛樺��
dialogTableDataArr: [],
- sxArr: [
- { code: 'Z', name: '涓绘枡' },
- { code: 'F', name: '杈呮枡' }
- ],
- UnitGroupArr: []// 璁¢噺鍗曚綅鏁扮粍
+ UnitGroupArr: [], // 璁¢噺鍗曚綅鏁扮粍
+ PartDetailSelectArr: []
}
},
@@ -785,7 +838,7 @@
created() {
this.getBomMainData()
this.getAddUpdateTBomParentData()
- // this.getStockTypeSelect()
+ this.getAddUpdateTBomDetailsData()
},
mounted() {
window.addEventListener('resize', this.getHeight)
@@ -830,12 +883,11 @@
async getAddUpdateTBomParentData() {
const { data: res } = await AddUpdateTBomParentData()
this.PartSelectArr = res
- this.PartSelectArrAll = res
},
// 鑾峰彇瀛樿揣绫诲瀷涓嬫媺鎺ュ彛
- async getStockTypeSelect() {
- const { data: res } = await TMaterielClassTree()
- this.parttypeArr = res
+ async getAddUpdateTBomDetailsData() {
+ const { data: res } = await AddUpdateTBomDetailsData()
+ this.PartDetailSelectArr = res
},
async partSelectChange(val) {
const res = this.PartSelectArr.find(item => item.partcode === val)
@@ -856,7 +908,7 @@
this.UnitGroupArr = r
}
- await this.getAddUpdateTBomMaxVsion(this.dialogForm.parentpartcode)
+ // await this.getAddUpdateTBomMaxVsion(this.dialogForm.parentpartcode)
},
async getAddUpdateTBomMaxVsion(parentpartcode) {
const { data: res } = await AddUpdateTBomMaxVsion({ parentpartcode })
@@ -903,55 +955,67 @@
this.dialogVisible = true
this.dialogForm.startdate = handleDatetime(new Date())
+
+ // this.$refs.dialogTableDataArrRef.doLayout()
},
// 淇敼鎸夐挳
async edit(operation, row) {
- const res = await BomMainDataView({ bomid: row.id })
- if (res.code === '200') {
- this.operation = operation
- this.dialogVisible = true
+ this.operation = operation
- const childrenArr = [] // 瀛愰泦鏁扮粍partcode
-
- res.data.forEach((item, index) => {
- let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
- number = number === 0 ? (10 + Math.random()) : number
-
- // item.SEQ = (index + 1) + '0'
- // item.isVisible = 0
- // item.number = number
- this.dialogTableDataArr.push({
- SEQ: item.seq,
- isVisible: 0,
- number,
- SMATERIRL_CODE: item.partcode,
- SMATERIRL_NAME: item.partname,
- SMATERIRL_SPEC: item.partspec,
- uomcode: item.uom_code,
- uomname: item.uom_name,
- BASE_QUANTITY: item.base_quantity,
- LOSS_QUANTITY: item.loss_quantity,
- TOTAL_QUANTITY: item.total_quantity
-
- })
- childrenArr.push(item.partcode)
- })
-
- this.$nextTick(() => {
- this.dialogForm.bomid = row.id
- this.dialogForm.parentpartcode = row.partcode
- this.dialogForm.parentpartname = row.partname
- this.dialogForm.parentpartspec = row.partspec
- this.dialogForm.uomcode = row.uom_code
- this.dialogForm.uomname = row.uom_name
- this.dialogForm.startdate = row.startdate
- this.dialogForm.status = row.status
- this.dialogForm.quantity = row.quantity
- this.dialogForm.version = row.version
-
- this.PartSelectArr = this.PartSelectArr.filter(item => !childrenArr.includes(item.partcode) && item.partcode !== this.dialogForm.parentpartcode)
- })
+ this.UnitGroupArr = []
+ this.UnitGroupArr.push({
+ unitcode: row.unitcode,
+ unitname: row.unitname
+ })
+ const t = this.PartSelectArr.find(item => item.partcode === row.materiel_code).idunitgroup
+ if (t) {
+ const { data: r } = await AddUpdateTBomUnitGroup({ idunitgroup: t })
+ this.UnitGroupArr = r
}
+
+ this.dialogForm = {
+ bomid: row.id,
+ parentpartcode: row.materiel_code,
+ parentpartname: row.materiel_name,
+ parentpartspec: row.materiel_spec,
+ uomcode: row.unitcode,
+ uomname: row.unitname,
+ quantity: row.quantity,
+ status: row.status,
+ startdate: row.startdate,
+ version: row.version,
+ isdefaultbom: row.isdefaultbom === '1',
+ bomdepth: row.bomdepth
+ }
+
+ const children = []
+
+ row.children.forEach((i, index) => {
+ let number = Math.random() * Math.random() // 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+ number = number === 0 ? (10 + Math.random()) : number
+ children.push({
+ SEQ: (index + 1) + '0',
+ number,
+ SMATERIRL_CODE: i.materiel_code,
+ SMATERIRL_NAME: i.materiel_name,
+ SMATERIRL_SPEC: i.materiel_spec,
+ uomcode: i.unitcode,
+ uomname: '',
+ UnitGroupArr: [],
+ tableData2: [],
+ BASE_QUANTITY: i.base_quantity,
+ LOSS_QUANTITY: i.loss_quantity,
+ TOTAL_QUANTITY: i.total_quantity,
+ idchildbom: i.idchildbom
+ })
+ this.tableChange(i.materiel_code, children[index])
+ })
+
+ this.dialogTableDataArr = children
+
+ this.dialogVisible = true
+
+ this.$refs.dialogTableDataArrRef.doLayout()
},
// 杈撳叆妗嗗�兼敼鍙樻椂瑙﹀彂
inputChange(val, row) {
@@ -979,89 +1043,59 @@
const { data: r } = await AddUpdateTBomUnitGroup({ idunitgroup: res.idunitgroup })
row.UnitGroupArr = r
}
+
+ const { data: r2 } = await AddUpdateTBomDetailsBomData({ materiel_code: val })
+ if (r2.length > 0) {
+ row.idchildbom = row.idchildbom ? row.idchildbom : r2[0].id
+ row.tableData2 = r2
+ row.idchildbom = row.tableData2.find(i => parseFloat(i.id) === parseFloat(row.idchildbom)).version
+ }
},
addDialog() {
- // if (this.dialogTableDataArr.find(item => item.isVisible === 1)) {
- // return this.$message.info('璇峰厛淇濆瓨鏈潯璁板綍锛�')
- // }
-
- let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+ let number = Math.random() * Math.random() // 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
number = number === 0 ? (10 + Math.random()) : number
this.dialogTableDataArr.push({
SEQ: (this.dialogTableDataArr.length + 1) + '0',
- isVisible: 1,
number,
SMATERIRL_CODE: '',
SMATERIRL_NAME: '',
SMATERIRL_SPEC: '',
uomcode: '',
uomname: '',
+ idchildbom: '',
UnitGroupArr: [],
- BASE_QUANTITY: '',
- LOSS_QUANTITY: '',
- TOTAL_QUANTITY: ''
+ tableData2: [],
+ BASE_QUANTITY: '1',
+ LOSS_QUANTITY: '0',
+ TOTAL_QUANTITY: '1'
})
},
- saveRow(row) {
- if (row.SMATERIRL_CODE === '' || row.BASE_QUANTITY === '' || row.LOSS_QUANTITY === '') {
- return this.$message.info('淇濆瓨澶辫触锛岃琛屽唴瀹规湭濉叏锛�')
- }
-
- row.isVisible = 0
- this.PartSelectArr = this.PartSelectArr.filter(i => i.partcode !== row.SMATERIRL_CODE)
- },
- cancelRow(row) {
- row.isVisible = 0
- this.dialogTableDataArr = this.dialogTableDataArr.filter(i => i.number !== row.number)
- },
- editRow(row) {
- if (this.dialogTableDataArr.find(item => item.isVisible === 1)) {
- return this.$message.info('璇峰厛淇濆瓨鍏跺畠琛岃褰曪紒')
- }
-
- row.isVisible = 1
-
- this.PartSelectArrAll.forEach(item => {
- if (item.partcode === row.SMATERIRL_CODE) {
- this.PartSelectArr.unshift(item)
- }
- })
- },
- delRow(row) {
- // this.PartSelectArrAll.forEach(item => {
- // if (item.partcode === row.SMATERIRL_CODE) {
- // this.PartSelectArr.unshift(item)
- // }
- // })
- this.dialogTableDataArr.forEach((item, index) => {
- if (item.SMATERIRL_CODE === row.SMATERIRL_CODE) {
- this.dialogTableDataArr.splice(index, 1)
- }
- })
+ delRow(row, index) {
+ this.dialogTableDataArr.splice(index, 1)
this.dialogTableDataArr.forEach((item, index) => {
item.SEQ = (index + 1) + '0'
})
},
// 鍒犻櫎鎸夐挳
async del(row) {
- // this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
- // confirmButtonText: '纭畾',
- // cancelButtonText: '鍙栨秷',
- // type: 'warning'
- // }).then(() => {
- // DeleteBoIventory({ bomid: row.id }).then(res => {
- // if (res.code === '200') {
- // this.$message.success('鍒犻櫎鎴愬姛!')
- // if (this.form.page > 1 && this.tableData.length === 1) {
- // this.form.page--
- // }
- // this.getBomMainData()
- // }
- // })
- // }).catch(() => {
- // this.$message.info('宸插彇娑堝垹闄�')
- // })
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ TBomDelete(row).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
+ this.getBomMainData()
+ }
+ })
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝垹闄�')
+ })
},
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
@@ -1075,9 +1109,8 @@
this.dialogForm.status = 'Y'
this.dialogForm.startdate = ''
this.dialogForm.version = ''
- this.PartSelectArr = []
- this.PartSelectArrAll = []
- this.PartSelectArrTemp = []
+ this.dialogForm.bomdepth = ''
+ this.dialogForm.isdefaultbom = false
this.dialogTableDataArr = []
this.$refs.dialogForm.clearValidate()
},
@@ -1091,35 +1124,64 @@
return this.$message.info('瀛愪欢淇℃伅涓嶈兘涓虹┖锛�')
}
+ if (this.dialogTableDataArr.find(i => i.SMATERIRL_CODE === this.dialogForm.parentpartcode)) {
+ return this.$message.info('鐖朵欢涓嶈兘浣滀负鑷繁鐨勫瓙浠讹紒')
+ }
+
this.$refs.dialogForm.validate(valid => {
if (valid) {
+ const children = []
+
+ this.dialogTableDataArr.forEach(i => {
+ children.push({
+ id: i.id,
+ m_id: this.dialogForm.bomid,
+ 'seq': i.SEQ,
+ 'materiel_code': i.SMATERIRL_CODE,
+ 'materiel_name': i.SMATERIRL_NAME,
+ 'materiel_spec': i.SMATERIRL_SPEC,
+ 'unitcode': i.uomcode,
+ 'base_quantity': i.BASE_QUANTITY,
+ 'loss_quantity': i.LOSS_QUANTITY,
+ 'total_quantity': i.TOTAL_QUANTITY,
+ 'idchildbom': i.idchildbom ? i.tableData2.find(j => j.version === i.idchildbom).id : ''
+ })
+ })
+
const data = {
- bomid: this.dialogForm.bomid,
- parentpartcode: this.dialogForm.parentpartcode,
- parentpartname: this.dialogForm.parentpartname,
- parentpartspec: this.dialogForm.parentpartspec,
- uomcode: this.PartSelectArrTemp.length > 0 ? this.PartSelectArrTemp[0].uom_code : this.dialogForm.uomcode,
- quantity: this.dialogForm.quantity,
- status: this.dialogForm.status,
- startdate: this.dialogForm.startdate,
- version: this.dialogForm.version,
- worklist: this.dialogTableDataArr,
- opertype: this.operation === 'add' ? 'Add' : 'Update'
+ rowNum: '',
+ 'id': this.dialogForm.bomid,
+ 'materiel_code': this.dialogForm.parentpartcode,
+ 'materiel_name': this.dialogForm.parentpartname,
+ 'materiel_spec': this.dialogForm.parentpartspec,
+ 'materiel_typecode': '',
+ 'materiel_typename': '',
+ 'unitcode': this.dialogForm.uomcode,
+ 'unitname': this.UnitGroupArr.find(i => i.unitcode === this.dialogForm.uomcode).unitname,
+ 'quantity': this.dialogForm.quantity,
+ 'status': this.dialogForm.status,
+ 'startdate': this.dialogForm.startdate,
+ 'version': this.dialogForm.version,
+ 'isdefaultbom': this.dialogForm.isdefaultbom ? '1' : '0',
+ 'bomdepth': this.dialogForm.bomdepth === '' ? '1' : this.dialogForm.bomdepth,
+ 'lm_user': '',
+ 'lm_date': '',
+ children
}
- // console.log(data)
+ console.log(JSON.parse(JSON.stringify(data)))
this.$store.state.app.buttonIsDisabled = true
- // AddUpdateBoIventory(data).then(res => {
- // if (res.code === '200') {
- // this.dialogVisible = false
- // this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
- // this.getBomMainData()
- // this.$store.state.app.buttonIsDisabled = false
- // } else {
- // this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
- // this.$store.state.app.buttonIsDisabled = false
- // }
- // })
+ TBomAddUpdate(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
+ if (res.code === '200') {
+ this.dialogVisible = false
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.getBomMainData()
+ this.$store.state.app.buttonIsDisabled = false
+ } else {
+ this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ this.$store.state.app.buttonIsDisabled = false
+ }
+ })
}
})
},
@@ -1134,7 +1196,12 @@
},
tableRowClassName({ row, rowIndex }) {
return 'custom-row'
+ },
+
+ rowClick(r, row) {
+ row.idchildbom = r.version
}
+
}
}
</script>
@@ -1146,3 +1213,135 @@
height: 34px;
}
</style>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-button--text {
+ font-size: 14px;
+ cursor: pointer;
+}
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+ color: $main_color;
+ cursor: pointer;
+}
+
+.el-icon-edit-outline {
+ margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+ height: 34px;
+ display: flex;
+ align-items: center;
+ padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+ //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+ background-color: #f8f8fa;
+ border: none;
+}
+
+::v-deep .el-input__inner {
+ height: 34px;
+ line-height: 34px;
+ //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+ //padding: 20px 100px !important;
+ padding: 20px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+ display: flex;
+ justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+ transform: scale(0.8);
+}
+
+::v-deep .cell {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+ height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+ background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+ color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+ border: 1px solid #eee;
+ width: 99%;
+ margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+.userDialogVisible ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+::v-deep .el-select__caret {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.tableFixed {
+ ::v-deep .el-table__fixed-right {
+ height: 100% !important;
+ }
+
+ ::v-deep .el-table__fixed {
+ height: 100% !important;
+ }
+}
+
+::v-deep .el-range__icon {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-separator {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-input {
+ font-size: 14px;
+}
+
+::v-deep .el-range-separator {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+</style>
+
--
Gitblit v1.9.3