| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716 |
- <template>
- <div style=" overflow-y: scroll;padding-bottom: 5rem;">
- <div style="background-image: url('../../../assets/images/bc.png');background-size: 100% 100%;">
- <div class="home_header">完工</div>
- <div class="home_header_line"></div>
- <div class="home_con_body">
- <div class="send_work" v-for="(item, index) in list" :key="index">
- <div class="check_box">
- <div @click="handleChoose(item, index)" class="check_box_c">
- </div>
- </div>
- <div class="secd_flex">
- <div class="secd_title">
- <span>派工单号:</span><span>{{ item.dispatch_order_no }}</span>
- </div>
- <span class="secd_title_d">{{ item.product_title }}</span>
- <div style="height: 1px;background-color: #fff;opacity: 0.3;"></div>
- <div style="display: flex;flex-direction: column;gap: 1rem;margin-top: 1rem;">
- <div class="secd_input">
- <div class="secd_input_l">数量:</div>
- <div class="secd_input_r">
- <input type="text" v-model="item.finished_num" @on-change="handleChangeNumber($event, index)"
- placeholder="请输入数量">
- </div>
- </div>
- <div class="secd_input">
- <div class="secd_input_l">班组:</div>
- <div class="secd_input_r">
- <b-form-select id="input-3" v-model="item.team_finish_id" :options="teamList" class="inp select_list"
- required placeholder="请选择站点" @change="(e) => handleChangeTeam(e, index)"></b-form-select>
- </div>
- </div>
- <div class="secd_input">
- <div class="secd_input_l">人员:</div>
- <div class="secd_input_r">
- <b-form-select id="input-3" :options="employeeList" v-model="item.employee_id" class="inp select_list"
- required placeholder="请选择站点" @on-change="handleChangeEmployee($event, index)"></b-form-select>
- </div>
- </div>
- <div class="secd_input">
- <div class="secd_input_l">设备:</div>
- <div class="secd_input_r">
- <b-form-select id="input-3" v-model="item.equipment_id" :options="equipmentList" class="inp select_list"
- required placeholder="请选择站点" @change="(e) => handleChangeEquipment(e, index)"></b-form-select>
- </div>
- </div>
- </div>
- <div style="height: 1px;background-color: #fff;opacity: 0.3;margin-top: .8rem;margin-bottom: .8rem;"></div>
- <div class="defective_products">
- <div>不良品</div>
- <div style="display: flex;align-items: center;gap: .625rem;">
- <img @click="handleBreakAdd(_index, item, index)" src="../../../assets/home/j.png" alt="">
- <img @click="handleBreakCancel(_index, item, index)" src="../../../assets/home/z.png" alt="">
- </div>
- </div>
- <div v-for="(_item, _index) in item.break" :key="_index"
- style="display: flex;flex-direction: column;gap: 1rem;margin-top: .5rem;">
- <div class="secd_input">
- <div class="secd_input_l">不良品原因:</div>
- <div class="secd_input_r">
- <b-form-select id="input-3" v-model="_item.break_id" :options="breakList" class="inp select_list"
- required placeholder="请选择站点"></b-form-select>
- </div>
- </div>
- <div class="secd_input">
- <div class="secd_input_l">不良品数量:</div>
- <div class="secd_input_r">
- <input type="text" placeholder="请输入数量" v-model="_item.break_num">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="footer">
- <div class="return_btn" @click="handleReturn">返回</div>
- <div class="confirm_btn" @click="handleSure">确认</div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [],
- name: '',
- formData: {},
- teamList: [],
- employeeList: [],
- equipmentList: [],
- state: true,
- breakList: []
- }
- },
- created() {
- // 获取不良品原因
- const data2 = {
- url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_list/page',
- post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "dynamicFormCode": "defective", "developmentSystemId": null, "debugFlag": true }
- }
- this.axios.post('/api/testdwy', { ...data2 }).then(res => {
- this.breakList = res.data.content.filter(v => v.status)
- this.breakList.forEach(v => {
- v.value = v.defective_code
- v.text = v.title
- })
- })
- // 获取设备
- const data1 = {
- url: 'http://121.36.142.167:7774/jbl/api/module-data/device_list/page',
- post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "dynamicFormCode": "device", "developmentSystemId": null, "debugFlag": true }
- }
- this.axios.post('/api/testdwy', { ...data1 }).then(res => {
- this.equipmentList = res.data.content.filter(v => v.status)
- this.equipmentList.forEach(v => {
- v.value = v.device_code
- v.text = v.title
- })
- })
- // 获取班组
- const data = {
- url: 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
- post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "dynamicFormCode": "team", "developmentSystemId": null, "debugFlag": true }
- }
- this.axios.post('/api/testdwy', { ...data }).then(res => {
- this.teamList = res.data.content.filter(v => v.status)
- this.teamList.forEach(v => {
- v.value = v.team_code
- v.text = v.title
- })
- })
- // 获取人员
- const data3 = {
- url: 'http://121.36.142.167:7774/jbl/api/module-data/team_code_btn/page',
- post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "workflowSearchBean": {}, "dynamicFormCode": "person", "dynamicFormTable": null, "ignoreField": true, "developmentSystemId": null, "debugFlag": true }
- }
- this.axios.post('/api/testdwy', { ...data3 }).then(res => {
- this.employeeList = res.data.content
- this.employeeList.forEach(v => {
- v.value = v.no
- v.text = v.name
- })
- })
- },
- beforeRouteLeave(to, from, next) {
- localStorage.removeItem(this.$route.query.id + '')
- next()
- },
- beforeRouteEnter(to, from, next) {
- if (localStorage.getItem(to.query.id)) {
- next()
- } else {
- next(vm => {
- vm.$router.replace('/cms/finish/detail')
- // 跳到该路由页面后,再替换为from.path来源路径
- })
- }
- },
- mounted() {
- const id = this.$route.query.id
- this.initData(id)
- },
- methods: {
- handleChangeNumber(e, index) {
- this.list[index].not_finished_num = this.list[index].dispatch_num - (e.target.value * 1)
- },
- handleChangeEmployee(e, index) {
- this.list[index].employee_id_show = this.employeeList.filter(v => e.indexOf(v.no) !== -1).map(v => v.name).toString().replace(/,/g, '/$/$/$').replace(/\//g, '')
- console.log(this.list[index])
- },
- handleChangeTeam(e, index) {
- this.list[index].team_id_show = this.teamList.find(v => v.team_code === e).title
- },
- handleChangeEquipment(e, index) {
- this.list[index].equipment_id_show = this.equipmentList.find(v => v.device_code === e).title
- },
- initData(id) {
- this.list = JSON.parse(localStorage.getItem(id + ''))
- this.list.forEach(v => {
- v.team_finish_id = v.dispatch_orders.team_id
- v.team_id_show = v.dispatch_orders.team_id_show
- v.equipment_id = v.dispatch_orders.equipment_id
- v.equipment_id_show = v.dispatch_orders.equipment_id_show
- v.finished_num = v.not_finished_num
- v.dispatch_order_no = v.dispatch_no
- v.id = null
- v.employee_id = v.dispatch_orders.employee_id.split(',')
- v.employee_id_show = v.dispatch_orders.employee_id_show
- v.break = [
- { break_id: '', break_num: 0 }
- ]
- })
- },
- handleBreakAdd(_index, item, index) {
- item.break.splice(_index + 1, 0, {
- break_id: '',
- break_num: 0
- })
- this.list.splice(index, 1, item)
- },
- handleBreakCancel(_index, item, index) {
- if (_index === 0) {
- item.break = [{ break_id: '', break_num: 0 }]
- } else {
- item.break.splice(_index, 1)
- }
- this.list.splice(index, 1, item)
- },
- handleReturn() {
- localStorage.removeItem(this.$route.query.id + '')
- this.$router.go(-1)
- },
- // handleChooseTeam (e) {
- // if (e) {
- // this.formData.team_id = e
- // // 获取班组下的人员
- // const id = this.teamList.find(v => v.team_code === this.formData.team_id).dynamic_form_value_id
- // const data = {
- // url: `http://121.36.142.167:7774/jbl/api/module-data/team/team/472629516238663680/${id}`
- // }
- // this.axios.post('/api/testdwyget', { ...data }).then(res => {
- // this.employeeList = res.data.data.employee
- // this.employeeList.forEach(v => {
- // v.value = v.team_code
- // v.text = v.team_code_show
- // })
- // this.formData.employee_id = []
- // })
- // } else {
- // this.formData.employee_id = []
- // }
- // },
- handleSure() {
- // console.log(this.list);return false;
- this.list.forEach(v => {
- const data3 = {
- url: 'http://121.36.142.167:7774/jbl/api/module-data/completion_orders/completion_orders',
- post: {
- bizId: -1,
- bizTypeEk: 'LOWCODE',
- dynamicFormId: "474201923419320320",
- showModelId: "474382714828959744",
- data: {
- completion_orders: {
- completion_order_no: null,
- completion_time: new Date(),
- created_by: null,
- created_date: null,
- employee_id: v.employee_id.toString(),
- employee_id_show: v.employee_id_show,
- equipment_id: v.equipment_id,
- equipment_id_show: v.equipment_id_show,
- last_modified_by: null,
- last_modified_date: null,
- process_id: v.dispatch_orders.process_id,
- process_id_show: v.dispatch_orders.process_id_show,
- remark: null,
- site: null,
- team_id: v.team_finish_id,
- team_id_show: v.team_id_show
- },
- completion_orders_dtl: [v]
- }
- }
- }
- // this.axios.post('/api/testdwy', { ...data3 }).then(res => {
- // if (res.code == 200) {
- // this.$Message.success(res.msg)
- // // this.$router.push('/cms/home')
- // }
- // })
- const data4Dtil = [];
- v.break.forEach(vv => {
- if (vv.break_id && vv.break_num) {
- v.defective_num = vv.break_num;
- v.defective_remark = vv.break_id;
- data4Dtil.push(v);
- }
- })
- if (data4Dtil.length > 0) {
- const data4 = {
- url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_orders/defective_orders',
- post: {
- bizId: -1,
- bizTypeEk: 'LOWCODE',
- dynamicFormId: "474139280406949888",
- showModelId: "474140935059877888",
- data: {
- defective_orders: {
- defective_order_no: null,
- defection_time: new Date(),
- created_by: null,
- created_date: null,
- employee_id: v.employee_id.toString(),
- employee_id_show: v.employee_id_show,
- equipment_id: v.equipment_id,
- equipment_id_show: v.equipment_id_show,
- last_modified_by: null,
- last_modified_date: null,
- process_id: v.dispatch_orders.process_id,
- process_id_show: v.dispatch_orders.process_id_show,
- site: null,
- team_id: v.team_finish_id,
- team_id_show: v.team_id_show,
- },
- defective_orders_dtl: data4Dtil
- }
- }
- }
- console.log(JSON.stringify(data4)); return false;
- // this.axios.post('/api/testdwy', { ...data3 }).then(res => {
- // if (res.code == 200) {
- // // this.$Message.success(res.msg)
- //
- //
- // }
- // })
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- /deep/.inp {
- background: #032a64 !important;
- // opacity: 0.4;
- border: none;
- color: #fff;
- }
- ::-webkit-input-placeholder {
- color: #ffffff84;
- /* 设置占位符文字的颜色 */
- }
- .defective_products {
- display: flex;
- justify-content: space-between;
- color: #fff;
- &>div {
- img {
- width: 1.2rem;
- height: 1.2rem;
- }
- }
- }
- .secd_input {
- display: flex;
- height: 2.06rem;
- font-size: 1rem;
- color: #FFFFFF;
- .secd_input_l {
- display: flex;
- align-items: center;
- width: fit-content;
- height: 100%;
- }
- .secd_input_r {
- flex: 1;
- input {
- width: 100%;
- height: 100%;
- border-radius: 0.38rem;
- border: 0.03rem solid #76CFFF;
- background-color: #00000000;
- outline: none;
- padding: 0 .625rem;
- box-sizing: border-box;
- color: #fff;
- }
- }
- }
- .select_list {
- border-radius: 0.38rem;
- border: 0.03rem solid #76CFFF;
- background-color: #00000000;
- outline: none;
- padding: 0 .625rem;
- box-sizing: border-box;
- color: #fff;
- width: 100%;
- height: 100%;
- font-weight: 500;
- letter-spacing: 0.1rem;
- }
- .return_btn {
- background-image: url('../../../assets/home/return.png');
- background-size: 100% 100%;
- }
- .confirm_btn {
- background-image: url('../../../assets/home/confirm.png');
- background-size: 100% 100%;
- }
- .return_btn,
- .confirm_btn {
- width: 10.97rem;
- height: 3.93rem;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #fff;
- font-size: 1.06rem;
- font-weight: 500;
- letter-spacing: 1px;
- }
- .secd_flex_s>span:nth-child(1) {
- font-size: 0.94rem;
- color: #ABDFFF;
- }
- .secd_flex_s>span:nth-child(2) {
- font-size: 0.94rem;
- color: #03FCD3;
- }
- .secd_g {
- font-size: 1rem;
- color: #ABDFFF
- }
- .secd_title_d {
- font-size: 1.13rem;
- color: #FFFFFF;
- text-shadow: 0px 0px 0px rgba(255, 255, 255, 0.5);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .secd_flex_w {
- display: flex;
- justify-content: space-between;
- padding-right: 1.6rem;
- box-sizing: border-box;
- }
- .secd_flex {
- display: flex;
- flex-direction: column;
- gap: .375rem;
- .secd_title {
- font-size: 0.88rem;
- color: #ABDFFF;
- opacity: 0.5;
- }
- }
- .check_box_c {
- width: 1.19rem;
- height: 100%;
- background-image: url('../../../assets/home/check.png');
- background-size: 100% 100%;
- }
- .check_box_c_active {
- width: 1.3rem;
- height: 100%;
- background-image: url('../../../assets/home/checked.png');
- background-size: 100% 100%;
- }
- .send_work {
- background-image: url('../../../assets/home/packUpback.png');
- background-size: 100% 100%;
- margin-top: 1.38rem;
- padding: 0.44rem 0.4rem 1.34rem 1.22rem;
- box-sizing: border-box;
- .check_box {
- height: 1.19rem;
- display: flex;
- justify-content: right;
- }
- }
- .com_top {
- margin-top: 1.72rem !important;
- }
- .completion_con {
- height: 5.19rem;
- background-image: url('../../../assets/home/completion.png');
- background-size: 100% 100%;
- margin-top: 0.72rem;
- padding: 1rem 1.28rem;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .home_con_s {
- position: relative;
- .pack_up {
- position: absolute;
- top: 0;
- left: 50%;
- transform: translateX(-50%);
- width: 5.56rem;
- background-image: url('../../../assets/home/packUp.png');
- background-size: 100% 100%;
- height: 1.97rem;
- display: flex;
- align-items: center;
- justify-content: center;
- img {
- width: 2.59rem;
- height: 0.88rem;
- }
- }
- .pack_up_d {
- top: -1.1rem;
- }
- .pack_up_con {
- height: 14.09rem;
- background-image: url('../../../assets/home/packUpback.png');
- background-size: 100% 100%;
- padding: 1.78rem 2.03rem;
- box-sizing: border-box;
- .pack_up_name {
- height: 1.25rem;
- font-size: 1.25rem;
- color: #fff;
- font-weight: 600;
- }
- .pack_up_grid {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- row-gap: .625rem;
- &>div {
- display: flex;
- flex-direction: column;
- row-gap: .625rem;
- &>div {
- display: flex;
- gap: .125rem;
- span:nth-child(1) {
- font-size: 1.63rem;
- font-family: DIN-BoldItalic, DIN;
- font-weight: 600;
- color: #04FFD5;
- line-height: 1.31rem;
- transform: skewX(-10deg);
- text-shadow: 0px 0px 0px rgba(4, 255, 213, 0.23);
- }
- span:nth-child(2) {
- font-size: 1rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #ABDFFF;
- }
- }
- &>p:nth-child(1) {
- font-size: 1rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #ABDFFF;
- margin-bottom: 0px;
- }
- }
- }
- }
- }
- .home_con_body {
- width: 100%;
- padding: 1rem;
- padding-top: 0px;
- box-sizing: border-box;
- }
- .home_header {
- height: 3.125rem;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #fff;
- font-size: 1.125rem;
- font-weight: 600;
- }
- .home_header_line {
- width: 100%;
- height: .0625rem;
- background-color: #fff;
- opacity: 0.2;
- }
- .content {
- height: calc(100% - 5rem);
- overflow: auto;
- .item {
- width: 94%;
- position: relative;
- left: 3%;
- margin: 1.5rem 0;
- border-radius: 1rem;
- background-color: #fff;
- box-shadow: 0.16rem 0.1rem 0.1rem 0.1rem #9d9b9b;
- font-size: 0.8rem;
- display: flex;
- flex-wrap: wrap;
- .add {
- position: absolute;
- width: 1.5rem;
- height: 1.5rem;
- bottom: -0.5rem;
- left: -0.5rem;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 1.3rem;
- border-radius: 50%;
- box-shadow: 0.1rem 0.1rem 0.1rem 0rem #777676;
- background: #fff;
- }
- .delete {
- width: 1.5rem;
- height: 1.5rem;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 1.3rem;
- position: absolute;
- top: -0.5rem;
- right: -0.5rem;
- border-radius: 50%;
- box-shadow: 0.1rem 0.1rem 0.1rem 0rem #777676;
- background: #fff;
- }
- .unit {
- width: 50%;
- padding: 0.5rem;
- display: flex;
- align-items: center;
- label {
- width: 30%;
- text-align: right;
- }
- }
- }
- }
- .footer_btn {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .footer {
- display: flex;
- justify-content: space-between;
- margin-top: 2rem;
- }
- .boo {
- font-size: 2rem;
- border-radius: 50%;
- width: 2rem;
- height: 2rem;
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 0.5rem;
- border: 0.1rem solid;
- }
- </style>
|