| | |
| | | <template>
|
| | | <view class="tl">
|
| | | <workOrderInfo :orederMessage="{proUserList:[]}" />
|
| | | <workOrderInfo :orederMessage="info" />
|
| | | <div class="tl_title">
|
| | | <div class="tl_title_left">
|
| | | <div class="tl_title_left_x"></div>
|
| | | <span>投料信息</span>
|
| | | <!-- <span>{{total == 0 ? '' : total}}{{formList[formList.length - 1].dw ? formList[formList.length - 1].dw : ''}}</span> --> |
| | | <!-- <span>{{total == 0 ? '' : total}}{{formList[formList.length - 1].dw ? formList[formList.length - 1].dw : ''}}</span> -->
|
| | | <!-- <span>{{total == 0 ? '' : total}}{{formList[formList.length - 1].dw ? formList[formList.length - 1].dw : ''}}</span> -->
|
| | | </div>
|
| | | <div class="tl_title_right" @click="add">
|
| | |
| | | </div>
|
| | | </div>
|
| | | </u-swipe-action-item>
|
| | | </u-swipe-action> |
| | | <SelectMaterial ref="selectMaterial" @selectAction="getValue"/> |
| | | <SelectMultipleMaterial ref="selectMultipleMaterial"/>
|
| | | </u-swipe-action>
|
| | | <SelectMaterial ref="selectMaterial" @selectAction="getValue" />
|
| | | <!-- <SelectMultipleMaterial ref="selectMultipleMaterial" @selected="getMaterails"/> -->
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import workOrderInfo from '@/components/workOrderInfo.vue' |
| | | import SelectMaterial from '@/components/selectMaterial.vue' |
| | | import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue' |
| | | |
| | | import workOrderInfo from '@/components/workOrderInfo.vue'
|
| | | import SelectMaterial from '@/components/selectMaterial.vue'
|
| | | // import SelectMultipleMaterial from '@/components/SelectMultipleMaterial.vue'
|
| | | import {
|
| | | queryById,
|
| | | createMaterial,
|
| | | createMaterialStandard
|
| | | } from '@/util/api/WorkOrderAPI'
|
| | | import {
|
| | | positiveInteger,
|
| | | number
|
| | | } from '@/common/config'
|
| | | export default {
|
| | | components: {
|
| | | workOrderInfo, |
| | | SelectMaterial, |
| | | SelectMultipleMaterial
|
| | | workOrderInfo,
|
| | | SelectMaterial,
|
| | | // SelectMultipleMaterial
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | deviceId: '',
|
| | | workorderId: '',
|
| | | // formList: [{
|
| | | // id: Date.now(),
|
| | | // toolingTypeId: '', // 工装类型
|
| | |
| | | // dw: '', // 物料单位
|
| | | // unitAttribute: ''
|
| | | // }],
|
| | | info: {},
|
| | | materialList: [{
|
| | | id: '',
|
| | | materialName: '',
|
| | |
| | | }
|
| | | }],
|
| | | };
|
| | | }, |
| | | },
|
| | | onLoad(obj) {
|
| | | this.workorderId = obj.id
|
| | | queryById(this.workorderId)
|
| | | .then(res => {
|
| | | if (res.code === 200) {
|
| | | this.info = res.data
|
| | | this.deviceId = res.data.pgmodel.id
|
| | | }
|
| | | })
|
| | | },
|
| | | methods: {
|
| | | open1(index) { |
| | | // this.$refs.selectMaterial.open({}) |
| | | this.$refs.selectMultipleMaterial.open({}) |
| | | open1(index) {
|
| | | // this.$refs.selectMaterial.open({})
|
| | | this.index = index
|
| | | this.$refs.selectMaterial.open({
|
| | | workorderId: this.workorderId,
|
| | | deviceId: this.deviceId
|
| | | })
|
| | | },
|
| | | deleItem(index) {
|
| | | if (this.materialList.length === 1) {
|
| | |
| | | }
|
| | | this.materialList.splice(index, 1)
|
| | | },
|
| | | add() { |
| | | add() {
|
| | | this.total += 1
|
| | | this.materialList.unshift({
|
| | | id: '',
|
| | |
| | | })
|
| | | this.materialList[index].num = ''
|
| | | }
|
| | | }, |
| | | getValue(item) { |
| | | console.log(item); |
| | | }
|
| | | },
|
| | | getValue(v) {
|
| | | for (let i = 0; i < this.materialList.length; i++) {
|
| | | if (item.id === this.materialList[i].id) {
|
| | | uni.$u.toast({
|
| | | message: '不能重复选择相同物料'
|
| | | })
|
| | | return
|
| | | }
|
| | | }
|
| | | this.materialList[this.index].id = item.id
|
| | | this.materialList[this.index].materialName = item.materialName
|
| | | this.materialList[this.index].num = item.num
|
| | | this.materialList[this.index].batch = item.batch
|
| | | this.materialList[this.index].locationName = item.locationName
|
| | | this.materialList[this.index].materialCode = item.materialCode
|
| | | this.materialList[this.index].procedureName = item.procedureName
|
| | | this.materialList[this.index].qualityType = item.qualityType
|
| | | this.materialList[this.index].unitAttribute = item.unitAttribute
|
| | | },
|
| | | // getMaterails({materials}) {
|
| | | // console.log(item);
|
| | | // }
|
| | | }
|
| | | }
|
| | | </script>
|