| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <template>
- <view class="workorder-page">
- <navigation title="工单执行"></navigation>
- <view class="list-box" v-if="dataList.length>0">
- <view class="list-item" v-for="(item, index) in dataList" :key="index">
- <view class="item-text">订单号:{{ item.orderNum || '-' }}</view>
- <view class="item-text">设备名称:{{ item.equipmentName || '-' }}</view>
- <view class="item-text">产品名称:{{ item.productionName || '-' }}</view>
- <view class="item-text">客户名称:{{ item.customerName || '-' }}</view>
- <view class="item-text">工序名称:{{ item.processName || '-' }}</view>
- <view class="btn-box">
- <view class="btn-item" @click="workreport(item.id)">
- <view>报工</view>
- </view>
- </view>
- </view>
- </view>
- <empty v-else text="暂无数据"></empty>
- <!-- 确认框 -->
- <u-modal :show="show" :title="title" :showCancelButton="true" @cancel="modalCancel" @confirm="modalConfirm">
- <view class="slot-content">
- <u--form labelPosition="left" labelWidth="160rpx" :model="info" :rules="rules" ref="form">
- <view class="form">
- <u-form-item label="报工数量" prop="reportNum" borderBottom>
- <u--input v-model="info.reportNum" placeholder="请填写报工数量" border="none"></u--input>
- </u-form-item>
- <u-form-item label="废品数量" prop="wasteNum">
- <u--input v-model="info.wasteNum" placeholder="请填写废品数量" border="none"></u--input>
- </u-form-item>
- </view>
- </u--form>
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- dataList: [],
- show: false,
- title: '报工',
- info: {
- id: '',
- reportNum: '',
- wasteNum: ''
- },
- rules: {
- reportNum: {
- type: 'string',
- required: true,
- message: '请填写报工数量',
- trigger: ['blur', 'change']
- },
- wasteNum: {
- type: 'string',
- required: true,
- message: '请填写废品数量',
- trigger: ['blur', 'change']
- },
- },
- }
- },
- onShow() {
- this.getList()
- },
- methods: {
- getList() {
- uni.showLoading({
- title: '正在加载...'
- })
- this.$api.listCurrentOrder().then(res => {
- this.dataList = res.data
- uni.hideLoading()
- }).catch(err => {})
- },
- // 报工
- workreport(id) {
- uni.navigateTo({
- url: '/subPackages/work/workreport?id=' + id
- });
- // this.info.id = id
- // this.info.reportNum = ''
- // this.info.wasteNum = ''
- // this.show = true
- },
- modalConfirm() {
- let that = this
- this.$refs.form.validate().then(res => {
- this.$api.productCompleteOrder(this.info).then(res => {
- this.show = false
- uni.showToast({
- title: '操作成功!',
- duration: 2000
- });
- setTimeout(function() {
- that.getList()
- }, 2000);
- }).catch(err => {})
- }).catch(err => {
- console.log('表单错误信息:', err);
- })
- },
- modalCancel() {
- this.show = false
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .workorder-page {
- .list-box {
- padding: 0 20rpx;
- color: $uni-text-color-list;
- .list-item {
- background-color: $uni-bg-color;
- padding: 20rpx;
- border-radius: 20rpx;
- margin-top: 28rpx;
- .item-text {
- margin-top: 10rpx;
- }
- }
- .btn-box {
- display: flex;
- justify-content: flex-end;
- margin-top: 10rpx;
- .btn-item {
- width: 175rpx;
- height: 50rpx;
- line-height: 50rpx;
- text-align: center;
- border-radius: 24rpx;
- margin-left: 20rpx;
- border: 1px solid #43adfd;
- color: #43adfd;
- }
- }
- }
- }
- </style>
|