Commit 6994cfe3 authored by kangzhenfei's avatar kangzhenfei

工时分配ok

parent 35a08557
...@@ -46,8 +46,20 @@ export default { ...@@ -46,8 +46,20 @@ export default {
getentryusers(params) { getentryusers(params) {
return Api.get(`${PlanUrl}/orderexecutenew/entryusers`, params); return Api.get(`${PlanUrl}/orderexecutenew/entryusers`, params);
}, },
//工时分配--总工时待分配 //工时分配--工时列表
getentrylist(params) {
return Api.post(`${technologyUrl}workhours/list`, params);
},
//工时分配--总工时待分配workhours/
getallhours(params) { getallhours(params) {
return Api.post(`${technologyUrl}workhours/allhours`, params); return Api.post(`${technologyUrl}workhours/allhours`, params);
}, },
//工时分配--新增保存
subcreatehours(params) {
return Api.post(`${technologyUrl}workhours/createmore`, params);
},
//工时分配--删除一条
deletehours(params) {
return Api.delete(`${technologyUrl}workhours/delete?id=`+ params);
},
} }
\ No newline at end of file
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<Col span="24"> <Col span="24">
<FormItem label="分配工时" prop="setTime"> <FormItem label="分配工时" prop="setTime">
<!-- <InputNumber :max="30" :min="0" v-model="value1"></InputNumber>&nbsp;&nbsp;&nbsp;&nbsp; --> <!-- <InputNumber :max="30" :min="0" v-model="value1"></InputNumber>&nbsp;&nbsp;&nbsp;&nbsp; -->
<InputNumber :max="maxHour" :min="1" v-model="entity.workHour" @on-change="testChange"></InputNumber>工时 &nbsp;&nbsp;&nbsp;&nbsp; <InputNumber :max="maxHour" :min="1" v-model="entity.workHour" @on-change="testChange"></InputNumber>&nbsp;&nbsp;&nbsp;&nbsp;工时
<!-- <InputNumber :max="59" :min="1" v-model="value1"></InputNumber> 分钟 &nbsp;&nbsp;&nbsp;&nbsp; --> <!-- <InputNumber :max="59" :min="1" v-model="value1"></InputNumber> 分钟 &nbsp;&nbsp;&nbsp;&nbsp; -->
</FormItem> </FormItem>
</Col> </Col>
...@@ -104,27 +104,27 @@ export default { ...@@ -104,27 +104,27 @@ export default {
userName: "张珊珊1", userName: "张珊珊1",
cardNo: "08965481", cardNo: "08965481",
id: 1 id: 1
}, },{
{
checked: false, checked: false,
userName: "张珊珊2", userName: "张珊珊2",
cardNo: "08965482", cardNo: "08965482",
id: 2 id: 2
}, },
{
checked: false,
userName: "张珊珊3",
cardNo: "08965483",
id: 3
}
] ]
}; };
}, },
created(){}, created(){},
methods: { methods: {
handleSubmit() { handleSubmit() {
this.listMan.map(item=>{
if(item.checked){
this.entity.cardNo = item.cardNo
}
})
console.log(this.entity); console.log(this.entity);
this.$emit("on-ok", this.entity); this.$emit("on-ok", this.entity);
this.showSelect = true
// this.entity={}
}, },
//单选框 //单选框
radioChange(val) { radioChange(val) {
...@@ -132,6 +132,12 @@ export default { ...@@ -132,6 +132,12 @@ export default {
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
this.entity={
cardNo: "",
oldUserse: null,
userse: null,
workHour: 1,
}
}, },
checkItem(i) { checkItem(i) {
if(this.userflag){ if(this.userflag){
...@@ -153,10 +159,12 @@ export default { ...@@ -153,10 +159,12 @@ export default {
}); });
oolist.map(u => { oolist.map(u => {
if (u.checked) { if (u.checked) {
this.entity.oldUserse = u.userName; this.entity.userName = u.userName;
this.entity.userId = u.id
this.showSelect = false this.showSelect = false
}else{ }else{
this.entity.oldUserse = ''; this.entity.userName = '';
this.entity.userId = ''
} }
}); });
if(oolist.length==0){ if(oolist.length==0){
...@@ -166,14 +174,23 @@ export default { ...@@ -166,14 +174,23 @@ export default {
// 选择新增人员 // 选择新增人员
changeUser(data){ changeUser(data){
console.log(data) console.log(data)
let alloterInfo = this.$refs.userSelected.getSelectItems();
if(data&&data!=undefined){ if(data&&data!=undefined){
this.userflag = true this.userflag = true
} }
if(data==undefined){ if(data==undefined){
this.userflag = false this.userflag = false
} }
let alloterInfo = this.$refs.userSelected.getSelectItems(); // if (!userInfo || userInfo.length == 0) {
// this.$Message.error("请选择人员!");
// return;
// }
console.log(alloterInfo) console.log(alloterInfo)
if(alloterInfo.length>0){
this.entity.cardNo = alloterInfo[0].cardNo
this.entity.userName = alloterInfo[0].userName
this.entity.userId = alloterInfo[0].id
}
}, },
testChange() { testChange() {
// 该方法在input内容改变是就会触发进行检测 // 该方法在input内容改变是就会触发进行检测
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<div class="gs_card_box"> <div class="gs_card_box">
<Card class="gs_card" v-for="(item,index) in cardMan" :key="index"> <Card class="gs_card" v-for="(item,index) in cardMan" :key="index">
<p slot="title" class="gs_title"> <p slot="title" class="gs_title">
{{item.userName}} {{item.userTitle}}
<span class="fr">{{item.cardNo}}</span> <!-- <span class="fr">{{item.cardNo}}</span> -->
</p> </p>
<!-- <p class="gs_p">所属车间:车间A{{i}}</p> <!-- <p class="gs_p">所属车间:车间A{{i}}</p>
<p class="gs_p">所属班组:班组B{{i}}</p> --> <p class="gs_p">所属班组:班组B{{i}}</p> -->
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<!-- <a class="gs_edit" @click="editItem"> <!-- <a class="gs_edit" @click="editItem">
<Icon type="md-create" /> <Icon type="md-create" />
编辑</a> --> 编辑</a> -->
<a class="gs_del" @click="delItem"> <a class="gs_del" @click="delItem(item.id)">
<Icon type="ios-trash-outline" /> <Icon type="ios-trash-outline" />
删除</a> 删除</a>
</p> </p>
...@@ -112,8 +112,30 @@ export default { ...@@ -112,8 +112,30 @@ export default {
console.log("获取失败。") console.log("获取失败。")
} }
}) })
let parm = {
conditions: [
{
fieldName: "dispatchId",
fieldValue: this.$route.query.id,
conditionalType: "Equal"
}
],
}
Api.getentrylist(parm).then(rest =>{
if(rest.success){
this.cardMan = rest.result
}else{
console.log("获取失败。")
}
})
}, },
addItem(){ addItem(){
// let aa=this.$refs.addview.$refs.userSelected.getSelectItems()
// console.log("1",aa)
if(this.allHours==0){
this.$Message.info("无工时分配...")
return
}
this.addmodal = true this.addmodal = true
let id = this.$route.query.id let id = this.$route.query.id
Api.getentryusers({Id:id}).then(res=>{ Api.getentryusers({Id:id}).then(res=>{
...@@ -127,12 +149,19 @@ export default { ...@@ -127,12 +149,19 @@ export default {
editItem(){ editItem(){
this.$Message.success("编辑工时...") this.$Message.success("编辑工时...")
}, },
delItem(){ delItem(itmid){
this.$Modal.confirm({ this.$Modal.confirm({
title: this.title, title: this.title,
content: "<p>" + this.msg + "</p>", content: "<p>" + this.msg + "</p>",
onOk: () => { onOk: () => {
this.$Message.success("删除工时...") Api.deletehours(itmid).then(res=>{
if(res.success){
this.laodHorse()
this.$Message.success("工时已删除")
}else{
this.$Message.error("删除失败...")
}
})
} }
}); });
}, },
...@@ -140,12 +169,21 @@ export default { ...@@ -140,12 +169,21 @@ export default {
this.addmodal = false this.addmodal = false
}, },
addInfo(formdata){ addInfo(formdata){
console.log(formdata) let parme = {
this.cardMan.push(formdata) users: [
// this.cardMan.userName = formdata.userse||formdata.oldUserse {
// this.cardMan.cardNo = formdata.cardNo userTitle: formdata.userName,
// this.cardMan.workHour = formdata.workHour userId: formdata.userId
console.log(this.cardMan) }
],
workHour: formdata.workHour,
dispatchId: this.$route.query.id,
routingDetailId: this.$route.query.routid,
count: this.$route.query.quantity
}
Api.subcreatehours(parme).then(res => {
if(res.success){ this.laodHorse() }
})
this.addmodal = false this.addmodal = false
} }
}, },
......
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