Commit 852804de authored by xioln's avatar xioln

废品单问题修改

parent 6b030a21
......@@ -285,7 +285,6 @@ export default {
})
},
update(data, deleteRows = []) {
console.log(11111, data)
// data
const tableData = this.value || []
tableData.forEach(row => {
......@@ -299,7 +298,6 @@ export default {
}
}
})
console.log(222, data)
this.$emit('input', data)
}
}
......
......@@ -14,11 +14,7 @@
<td class="center">数值</td>
</tr>
<tr>
<td
class="center"
:class="{ technologist: !technologist }"
colspan="2"
>
<td class="center" :class="{ technologist: !technologist }" colspan="2">
零件图号
</td>
<td class="input">
......@@ -33,11 +29,7 @@
</td>
</tr>
<tr>
<td
class="center"
colspan="2"
:class="{ technologist: !technologist }"
>
<td class="center" colspan="2" :class="{ technologist: !technologist }">
材料名称
</td>
<td class="input">
......@@ -52,11 +44,7 @@
</td>
</tr>
<tr>
<td
class="center"
colspan="2"
:class="{ technologist: !technologist }"
>
<td class="center" colspan="2" :class="{ technologist: !technologist }">
材料牌号
</td>
<td class="input">
......@@ -71,11 +59,7 @@
</td>
</tr>
<tr>
<td
class="center"
colspan="2"
:class="{ technologist: !technologist }"
>
<td class="center" colspan="2" :class="{ technologist: !technologist }">
材料规格
</td>
<td class="input">
......@@ -96,13 +80,7 @@
</td>
<td class="input">
<el-form-item prop="quota">
<el-input
v-model="form.quota"
clearable
type="Number"
min="0"
placeholder="请输入"
/>
<el-input v-model="form.quota" clearable type="Number" min="0" placeholder="请输入" />
<!-- :disabled="costEstimator || (disabled && !costEstimator)" -->
</el-form-item>
</td>
......@@ -113,13 +91,7 @@
</td>
<td class="input">
<el-form-item prop="consumeCount">
<el-input
v-model="form.consumeCount"
clearable
type="Number"
min="0"
placeholder="请输入"
/>
<el-input v-model="form.consumeCount" clearable type="Number" min="0" placeholder="请输入" />
<!-- :disabled="costEstimator || (disabled && !costEstimator)" -->
</el-form-item>
</td>
......@@ -130,13 +102,7 @@
</td>
<td class="input">
<el-form-item prop="price">
<el-input
v-model="form.price"
clearable
type="Number"
min="0"
placeholder="请输入"
/>
<el-input v-model="form.price" clearable type="Number" min="0" placeholder="请输入" />
<!-- :disabled="costEstimator || (disabled && !costEstimator)" -->
</el-form-item>
</td>
......@@ -147,66 +113,36 @@
</td>
<td class="input">
<el-form-item prop="lossValue">
<el-input
v-model="form.lossValue"
clearable
type="Number"
min="0"
placeholder="请输入"
/>
<el-input v-model="form.lossValue" :disabled="true" clearable type="Number" min="0" placeholder="请输入" />
<!-- :disabled="costEstimator || (disabled && !costEstimator)" -->
</el-form-item>
</td>
</tr>
<tr>
<td
class="center"
colspan="2"
:class="{ costEstimator: !costEstimator }"
>
<td class="center" colspan="2" :class="{ costEstimator: !costEstimator }">
辅助材料损失价值
</td>
<td class="input">
<el-form-item prop="subMaterialLossValue">
<el-input
v-model="form.subMaterialLossValue"
clearable
placeholder="请输入"
type="Number"
min="0"
/>
<el-input v-model="form.subMaterialLossValue" clearable placeholder="请输入" type="Number" min="0" />
<!-- :disabled="costEstimator || (disabled && !costEstimator)" -->
</el-form-item>
</td>
</tr>
<tr>
<td
class="center"
colspan="2"
:class="{ costEstimator: !costEstimator }"
>
<td class="center" colspan="2" :class="{ costEstimator: !costEstimator }">
合计损失总值
</td>
<td class="input">
<el-form-item prop="totalLossValue">
<el-input
v-model="form.totalLossValue"
clearable
type="Number"
min="0"
placeholder="请输入"
/>
<el-input v-model="form.totalLossValue" clearable type="Number" min="0" placeholder="请输入" />
<!-- :disabled="costEstimator || (disabled && !costEstimator)" -->
</el-form-item>
</td>
</tr>
<tr>
<td
class="center"
colspan="2"
:class="{ technologist: !technologist }"
>
<td class="center" colspan="2" :class="{ technologist: !technologist }">
拆卸废品时间/件
</td>
<td class="input">
......@@ -228,24 +164,14 @@
<el-form-item prop="clsign">
<label for="">材料定额员:</label>
<el-input
v-model="form.clsign"
clearable
:disabled="disabled"
class="material-quota-officer"
/>
<el-input v-model="form.clsign" clearable :disabled="Activity_1dnbmb6" class="material-quota-officer" />
<!-- <span class="material-quota-officer" contenteditable="true" /> -->
</el-form-item>
</div>
<div>
<el-form-item prop="gysign">
<label for="">工艺员:</label>
<el-input
v-model="form.gysign"
clearable
:disabled="disabled"
class="technologists"
/>
<el-input v-model="form.gysign" clearable :disabled="Activity_1dnbmb6" class="technologists" />
<!-- <span class="technologist" contenteditable="true" /> -->
</el-form-item>
</div>
......@@ -255,23 +181,20 @@
</table>
</el-form>
<div class="table-btn">
<el-button
type="primary"
size="small"
:disabled="disab"
@click="save"
>确定</el-button>
<el-button
size="small"
:disabled="disab"
@click="handleClose"
>取消</el-button>
<el-button type="primary" size="small" :disabled="disab" @click="save">确定</el-button>
<el-button size="small" :disabled="disab" @click="handleClose">取消</el-button>
</div>
</section>
</template>
<script>
export default {
props: {
basicData: {
type: Object,
default: () => null
}
},
data() {
return {
item: {},
......@@ -296,7 +219,9 @@ export default {
// 工艺员
technologist: true,
// 成本核算员
costEstimator: true
costEstimator: true,
// 废品通知单编制
Activity_1dnbmb6: true
}
},
computed: {
......@@ -317,7 +242,6 @@ export default {
handler(val) {
this.$refs.form && this.$refs['form'].resetFields()
if (val) {
this.item = val
Object.keys(this.form).forEach((key) => {
Object.keys(val).forEach((key2) => {
if (key === key2) {
......@@ -352,12 +276,19 @@ export default {
}
},
created() {
this.open(this.$attrs['basic-data'])
this.open(this.basicData)
},
mounted() {},
mounted() { },
methods: {
// 打开弹出框
open(val) {
this.$set(this.form, 'gysign', localStorage.getItem('user'))
this.$nextTick(() => {
if (val && val.taskkey) {
// 废品通知单编制
if (val.taskkey === 'Activity_1dnbmb6') {
this.Activity_1dnbmb6 = false
}
// 成本核算员节点Activity_1lgytbi和财务部会计Activity_07owud7
if (['Activity_1lgytbi', 'Activity_07owud7'].includes(val.taskkey)) {
this.disabled = false
......@@ -365,7 +296,6 @@ export default {
// } else
if (val.taskkey === 'Activity_1lgytbi') {
this.technologist = false
this.$nextTick(() => {
this.$set(this.form, 'gysign', localStorage.getItem('user'))
this.$set(this.rules, 'portCarNumber', [
{
......@@ -402,12 +332,27 @@ export default {
trigger: 'blur'
}
])
})
}
} else {
this.disabled = true
}
this.item = val
this.searchItem()
}
})
},
searchItem() {
const params = {
searchItems: {
items: [{ 'fieldName': 'id', operator: 'EQ', value: this.basicData.id }],
operator: 'AND'
}
}
this.$api.searchApi('ScrapNoticeDoc', params).then(res => {
this.$nextTick(() => {
res.items.content[0].taskkey = this.basicData.taskkey
this.item = res.items.content[0]
})
})
},
save() {
this.$refs.form.validate((valid) => {
......@@ -442,50 +387,6 @@ export default {
message: `${message}成功`,
type: 'success'
})
// Object.keys(this.form).forEach(key => {
// this.form[key] = ''
// })
// setTimeout(() => {
// this.$emit('reload')
// }, 500)
},
// 初始化责任人
firstRemoteMethod(query, key) {
if (query !== '') {
const params = {
'indices': [
'User',
'DxUser'
],
'searchItems': {
'items': [
{
'fieldName': 'id',
'operator': 'EQ',
'value': query
}
],
'operator': 'AND'
},
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
this.HttpRequest('/User/find/recursion', params, 'post')
.then((res) => {
if (res.items.content.length !== 0) {
this.$set(this.form, key, res.items.content[0].userName)
}
})
.catch((err) => {
console.log(err)
})
.finally(() => {})
}
}
}
}
......@@ -494,29 +395,36 @@ export default {
.threeTable {
width: 560px;
margin: 0 20px;
thead {
line-height: 50px;
text-align: center;
font-weight: 700;
}
tbody {
line-height: 32px;
.input {
input {
border: none;
}
}
.width40 {
width: 56px;
padding: 0 20px;
box-sizing: border-box;
}
.center {
text-align: center;
}
.text-indent {
text-indent: 20px;
}
.signature {
td {
padding: 20px;
......@@ -524,19 +432,23 @@ export default {
text-align: right;
line-height: 40px;
}
input {
border: none;
border-bottom: 1px solid #000;
border-radius: 0;
}
.el-input {
width: 150px;
height: 32px;
}
.el-input__inner {
width: 150px;
height: 32px;
}
// .technologist,.material-quota-officer{
// display: inline-block;
// min-width: 150px;
......@@ -548,6 +460,7 @@ export default {
}
}
}
.technologist,
.costEstimator {
&::before {
......
......@@ -399,7 +399,7 @@
<label>合计:</label><el-input
v-model="form.accounts"
clearable
:disabled="costKeeper || (disabled && !costKeeper)"
:disabled="true"
placeholder="请输入"
/>
<!-- <label :class="{ costKeeper: !costKeeper }">合计:</label><el-input
......@@ -429,6 +429,12 @@
</template>
<script>
export default {
props: {
basicData: {
type: Object,
default: () => null
}
},
data() {
return {
item: {},
......@@ -477,7 +483,9 @@ export default {
// 成本核算员
costEstimator: true,
// 成本管理员
costKeeper: true
costKeeper: true,
// 废品通知单编制禁用
Activity_1dnbmb6: false
}
},
watch: {
......@@ -539,6 +547,7 @@ export default {
that.workHourMLossCost = 0
}
if (that.curTotalLossCost) {
console.log(this)
that.accounts = parseFloat(that.curTotalLossCost)
} else if (!that.curTotalLossCost) {
that.accounts = 0
......@@ -576,21 +585,20 @@ export default {
},
deep: true
}
// 'form.accounts': {
// handler(v) {
// this.$emit('accounts', v)
// },
// deep: true
// }
},
created() {
this.open(this.$attrs['basic-data'])
this.open(this.basicData)
},
methods: {
// 打开弹出框
open(val) {
this.$nextTick(() => {
if (val && val.taskkey) {
// 废品通知单编制
if (val.taskkey === 'Activity_1dnbmb6') {
this.Activity_1dnbmb6 = true
}
// 成本核算员节点Activity_1lgytbi和财务部会计Activity_07owud7
// if (['Activity_1lgytbi', 'Activity_07owud7'].includes(val.taskkey)) {
// this.disabled = false
......@@ -605,7 +613,24 @@ export default {
this.disabled = false
this.costEstimator = false
this.costKeeper = false
this.item = val
this.searchItem()
}
})
},
searchItem() {
const params = {
searchItems: {
items: [{ 'fieldName': 'id', operator: 'EQ', value: this.basicData.id }],
operator: 'AND'
}
}
this.$api.searchApi('ScrapNoticeDoc', params).then(res => {
if (res.items.content) {
this.$nextTick(() => {
res.items.content[0].taskkey = this.basicData.taskkey
this.item = res.items.content[0]
})
}
})
},
save() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment