This commit is contained in:
Vergil
2020-04-08 17:53:36 +08:00
parent c94a5d21d1
commit e9c515bb8f
4 changed files with 46 additions and 18 deletions

View File

@@ -379,7 +379,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="callOff('form10')">取消</el-button> <el-button @click="callOff('form10')">取消</el-button>
<el-button type="primary" @click="submit10('form10')">确定</el-button> <el-button :disabled="openUrgentItem_disable" type="primary" @click="submit10('form10')">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -394,6 +394,7 @@ import Cookie from 'js-cookie'
export default { export default {
data() { data() {
return { return {
openUrgentItem_disable: false,
checked_hebing: true, checked_hebing: true,
checked_UrgentItem: false, checked_UrgentItem: false,
UrgentItem: 0, UrgentItem: 0,
@@ -619,6 +620,7 @@ export default {
if (this.$refs['form10'] !== undefined) { if (this.$refs['form10'] !== undefined) {
this.$refs['form10'].resetFields() this.$refs['form10'].resetFields()
} }
this.openUrgentItem_disable = false
this.dialogFormVisible10 = true this.dialogFormVisible10 = true
}, },
typeChange() { typeChange() {
@@ -705,11 +707,13 @@ export default {
submit10(formName) { submit10(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.openUrgentItem_disable = true
addUrgentItem(this.form10.机床号, this.form10.组号, this.form10.零件图号, this.form10.零件名称, this.form10.规格, this.form10.零件数量, this.form10.零件备注, this.id, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time).then(response => { addUrgentItem(this.form10.机床号, this.form10.组号, this.form10.零件图号, this.form10.零件名称, this.form10.规格, this.form10.零件数量, this.form10.零件备注, this.id, this.time_planStart, this.time_planFinish, this.time_gongyiStart, this.time_gongyiFinish, this.time_dingeStart, this.time_dingeFinish, this.time_planpinghengStart, this.time_planpinghengFinish, this.time_machiningStart, this.time).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('添加成功') this.$message.success('添加成功')
this.dialogFormVisible10 = false this.dialogFormVisible10 = false
} else { } else {
this.openUrgentItem_disable = false
this.$message.error('添加失败') this.$message.error('添加失败')
} }
}) })

View File

@@ -345,7 +345,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel('form')">取消</el-button> <el-button @click="cancel('form')">取消</el-button>
<el-button v-show="title==='增加'" type="primary" @click="submitAdd('form')">确定</el-button> <el-button v-show="title==='增加'" :disabled="handleAdd_disable" type="primary" @click="submitAdd('form')">确定</el-button>
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button> <el-button v-show="title==='编辑'" type="primary" @click="submitEdit('form')">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -566,6 +566,7 @@ export default {
inject: ['reload'], inject: ['reload'],
data() { data() {
return { return {
handleAdd_disable: false,
dateRange: '', dateRange: '',
partNumber: '', partNumber: '',
dateRange1: '', dateRange1: '',
@@ -1037,19 +1038,24 @@ export default {
}) })
}, },
handleAdd() { handleAdd() {
this.handleAdd_disable = false
this.addForm('form', [this.dialogFormVisible = true, this.title = '增加']) this.addForm('form', [this.dialogFormVisible = true, this.title = '增加'])
this.form.请购时间 = getNowShotTime() this.form.请购时间 = getNowShotTime()
}, },
submitAdd(formName) { submitAdd(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.handleAdd_disable = true
addData(this.form.请购车间, this.name, this.id, this.form.请购时间, this.form.Remarks).then(response => { addData(this.form.请购车间, this.name, this.id, this.form.请购时间, this.form.Remarks).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('增加成功') this.$message.success('增加成功')
this.dialogFormVisible = false this.dialogFormVisible = false
this.tableData6 = [] this.tableData6 = []
this.searchTable1() this.searchTable1()
} else { this.$message.error('增加失败') } } else {
this.$message.error('增加失败')
this.handleAdd_disable = false
}
}) })
} else { } else {
console.log('error submit!!') console.log('error submit!!')

View File

@@ -231,7 +231,7 @@
<el-input-number v-model="inputC" :step="1" :min="0" :max="spareNumber-SupplementationNumber" style="width: 100px" size="small" /> <el-input-number v-model="inputC" :step="1" :min="0" :max="spareNumber-SupplementationNumber" style="width: 100px" size="small" />
<span>开始工序</span> <span>开始工序</span>
<el-input v-model="inputD" :disabled="true" auto-complete="off" style="width: 100px" size="small"/> <el-input v-model="inputD" :disabled="true" auto-complete="off" style="width: 100px" size="small"/>
<el-button :disabled="spareNumber-SupplementationNumber===0" type="primary" size="small" plain @click="editB">补投重新生产零件</el-button> <el-button :disabled="spareNumber-SupplementationNumber<=0" type="primary" size="small" plain @click="editB">补投重新生产零件</el-button>
</div> </div>
</el-card> </el-card>
<el-card v-show="false"> <el-card v-show="false">
@@ -291,7 +291,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="callOff('form2')">取消</el-button> <el-button @click="callOff('form2')">取消</el-button>
<el-button type="primary" @click="submit('form2')">确定</el-button> <el-button :disabled="handleEdit_disable" type="primary" @click="submit('form2')">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -310,7 +310,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="margin-left: 140px;margin-top: 10px"> <div style="margin-left: 140px;margin-top: 10px">
<el-button type="primary" @click="submitRemark()">确定</el-button> <el-button :disabled="handleEdit_disable" type="primary" @click="submitRemark()">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -323,6 +323,8 @@ import { mapGetters } from 'vuex'
export default { export default {
data() { data() {
return { return {
handleEdit_disable: false,
editB_disable: false,
index: 0, index: 0,
remark1: '', remark1: '',
remark2: '', remark2: '',
@@ -483,12 +485,12 @@ export default {
if (this.$refs['form2'] !== undefined) { if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields() this.$refs['form2'].resetFields()
} }
console.log(index)
this.index = index this.index = index
this.remark1 = '' this.remark1 = ''
this.remark2 = '' this.remark2 = ''
this.PCNumber = parseInt(row.批次数量) this.PCNumber = parseInt(row.批次数量)
this.title = row.零件名称 this.title = row.零件名称
this.handleEdit_disable = false
this.dialogeditVisible = true this.dialogeditVisible = true
this.form.input1 = row.零件图号 this.form.input1 = row.零件图号
this.code = row.工艺计划流水号 this.code = row.工艺计划流水号
@@ -498,6 +500,7 @@ export default {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
if (this.form2.报废数量 > 0) { if (this.form2.报废数量 > 0) {
this.handleEdit_disable = true
editSpare(this.code, this.form2.报废数量, this.form2.报废原因, this.form2.报废时间, this.id).then(response => { editSpare(this.code, this.form2.报废数量, this.form2.报废原因, this.form2.报废时间, this.id).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('报废成功') this.$message.success('报废成功')
@@ -509,6 +512,7 @@ export default {
} }
// this.fetchTableData() // this.fetchTableData()
} else { } else {
this.handleEdit_disable = false
this.$message.success('报废失败') this.$message.success('报废失败')
} }
}) })
@@ -538,15 +542,20 @@ export default {
editB() { editB() {
if (this.spareNumber - this.SupplementationNumber > 0) { if (this.spareNumber - this.SupplementationNumber > 0) {
if (this.inputC > 0) { if (this.inputC > 0) {
editA(this.CutCodeBefore, this.inputC).then(response => { if (!this.editB_disable) {
if (response.data[0].result === '1') { this.editB_disable = true
this.$message.success('补投成功') editA(this.CutCodeBefore, this.inputC).then(response => {
this.fetchTableData() if (response.data[0].result === '1') {
this.inputC = 0 this.$message.success('补投成功')
} else { this.fetchTableData()
this.$message.error('补投失败') this.inputC = 0
} this.editB_disable = false
}) } else {
this.editB_disable = false
this.$message.error('补投失败')
}
})
}
} else { } else {
this.$message.warning('补投数量不能为零') this.$message.warning('补投数量不能为零')
} }

View File

@@ -157,7 +157,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button> <el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="submit('form')"> </el-button> <el-button :disabled="ADD_disable" type="primary" @click="submit('form')"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog v-el-drag-dialog :title="title1" :visible.sync="dialogFormVisible2" center style="min-height: 300px" width="450px"> <el-dialog v-el-drag-dialog :title="title1" :visible.sync="dialogFormVisible2" center style="min-height: 300px" width="450px">
@@ -177,7 +177,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="callOff2('form1')">取消</el-button> <el-button @click="callOff2('form1')">取消</el-button>
<el-button type="primary" @click="submitMachine('form1')"> </el-button> <el-button :disabled="addMachine_disable" type="primary" @click="submitMachine('form1')"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@@ -193,6 +193,8 @@ export default {
}, },
data() { data() {
return { return {
ADD_disable: false,
addMachine_disable: false,
contractNumber_check: '', contractNumber_check: '',
contractNumber: '', // 合同编号 contractNumber: '', // 合同编号
entryName: [], entryName: [],
@@ -344,6 +346,7 @@ export default {
}, },
ADD() { ADD() {
this.addForm('form') this.addForm('form')
this.ADD_disable = false
this.dialogFormVisible1 = true this.dialogFormVisible1 = true
this.form.contractSigningDate = getNowTime()// new Date() this.form.contractSigningDate = getNowTime()// new Date()
this.temp = 1 this.temp = 1
@@ -364,6 +367,7 @@ export default {
}) })
}, },
addTableData1() { addTableData1() {
this.ADD_disable = true
addList(this.form.EntryName, this.form.remark, this.form.contractSigningDate).then(response => { addList(this.form.EntryName, this.form.remark, this.form.contractSigningDate).then(response => {
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
@@ -371,6 +375,7 @@ export default {
this.title = '' this.title = ''
this.fetchTableData1() this.fetchTableData1()
} else { } else {
this.ADD_disable = false
this.$message.error('添加失败') this.$message.error('添加失败')
} }
}) })
@@ -424,12 +429,14 @@ export default {
}, },
addMachine(row) { addMachine(row) {
this.projectNum = row.项目流水号 this.projectNum = row.项目流水号
this.addMachine_disable = false
this.dialogFormVisible2 = true this.dialogFormVisible2 = true
this.title1 = '新增机床' this.title1 = '新增机床'
this.addForm('form1') this.addForm('form1')
this.form1.项目名称 = row.项目名称 this.form1.项目名称 = row.项目名称
}, },
submitMachine() { submitMachine() {
this.addMachine_disable = true
function a() { function a() {
selectMachine(this.projectNum).then(response => { selectMachine(this.projectNum).then(response => {
this.tableData2 = response.data this.tableData2 = response.data
@@ -438,8 +445,10 @@ export default {
} }
if (this.flag === 1) { if (this.flag === 1) {
this.addTable(submitMachine, [this.projectNum, this.form1.设备型号, this.form1.设备名称, this.form1.机床数量], 'form1', a) this.addTable(submitMachine, [this.projectNum, this.form1.设备型号, this.form1.设备名称, this.form1.机床数量], 'form1', a)
this.addMachine_disable = false
} else { } else {
this.editTable(editMachine, [this.c, this.form1.设备型号, this.form1.设备名称, this.form1.机床数量], 'form1', a) this.editTable(editMachine, [this.c, this.form1.设备型号, this.form1.设备名称, this.form1.机床数量], 'form1', a)
this.addMachine_disable = false
} }
}, },
deleteMachine(row) { deleteMachine(row) {