| | |
| | | <el-tab-pane label="生产列表"> |
| | | <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between"> |
| | | <div style="display: flex;align-items: center"> |
| | | <div style="width: 90px">扫描条码:</div> |
| | | <div style="width: 70px">扫描条码</div> |
| | | <!-- oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"--> |
| | | <el-input |
| | | id="keyWords" |
| | | v-model="form.orderstepqrcode" |
| | | v-model="form.wocode" |
| | | name="produceCode" |
| | | style="width: 300px" |
| | | placeholder="请扫码或输入工单号" |
| | | style="width: 260px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode')" |
| | | /> |
| | | <!-- @keyup.native="e=>judgeIsScanning(e,'produceCode')"--> |
| | | <div style="width: 90px;margin-left: 20px">生产设备:</div> |
| | | <el-select |
| | | v-model="form.SelectType" |
| | | style="width: 200px;" |
| | | placeholder="请选择" |
| | | @change="selectTypeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in ZZeqpArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | <!-- <div style="width: 90px;margin-left: 20px">生产设备:</div>--> |
| | | <!-- <el-select--> |
| | | <!-- v-model="form.SelectType"--> |
| | | <!-- style="width: 200px;"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- @change="selectTypeChange"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in ZZeqpArr"--> |
| | | <!-- :key="item.code"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | |
| | | <div style="width: 70px;margin-left: 20px">销售单号</div> |
| | | <el-input |
| | | v-model="form.saleOrderCode" |
| | | placeholder="请输入" |
| | | style="width: 180px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode')" |
| | | /> |
| | | |
| | | <div style="width: 70px;margin-left: 20px">产品编码</div> |
| | | <el-input |
| | | v-model="form.partcode" |
| | | placeholder="请输入" |
| | | style="width: 180px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode')" |
| | | /> |
| | | <div style="width: 70px;margin-left: 20px">产品名称</div> |
| | | <el-input |
| | | v-model="form.partname" |
| | | placeholder="请输入" |
| | | style="width:180px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode')" |
| | | /> |
| | | <!-- <div style="width: 70px;margin-left: 20px">规格型号</div>--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.partspec"--> |
| | | <!-- placeholder="请输入"--> |
| | | <!-- style="width:180px"--> |
| | | <!-- @keyup.enter.native="val=>enterNative(val,'produceCode')"--> |
| | | <!-- />--> |
| | | |
| | | </div> |
| | | <div v-if="false" style="display: flex;padding-right: 10px"> |
| | | <el-button v-waves @click="ZZstart"> |
| | | <svg-icon icon-class="start_time" style="margin-right: 2px" /> |
| | | 开始 |
| | | </el-button> |
| | | <el-button v-waves @click="ZZreport"> |
| | | <svg-icon icon-class="report_work" style="margin-right: 2px" /> |
| | | 报工 |
| | | </el-button> |
| | | <div style="display: flex;padding-right: 10px"> |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="search">查询</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button> |
| | | </div> |
| | | <!-- <div v-if="false" style="display: flex;padding-right: 10px">--> |
| | | <!-- <el-button v-waves @click="ZZstart">--> |
| | | <!-- <svg-icon icon-class="start_time" style="margin-right: 2px" />--> |
| | | <!-- 开始--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button v-waves @click="ZZreport">--> |
| | | <!-- <svg-icon icon-class="report_work" style="margin-right: 2px" />--> |
| | | <!-- 报工--> |
| | | <!-- </el-button>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="start_qty" |
| | | label="已开工数量" |
| | | width="110" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.start_qty }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="未报工数量" |
| | | width="120" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <!-- sortable="custom"--> |
| | | <template slot-scope="{row}"> |
| | | <div>{{ row.plan_qty - row.good_qty - row.ng_qty }}</div> |
| | | <!-- <div>{{ row.plan_qty - row.good_qty - row.ng_qty }}</div>--> |
| | | <div>{{ row.start_qty - row.good_qty - row.ng_qty-row.bad_qty }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | width="150" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- label="操作"--> |
| | | <!-- width="150"--> |
| | | <!-- fixed="right"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-button v-waves type="text" @click="edit('edit',row)">编辑</el-button>--> |
| | | <!-- <el-button v-waves type="text" @click="del(row)">删除</el-button>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | label="操作" |
| | | width="150" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-waves type="text" @click="ZZstart(row)">开工</el-button> |
| | | <el-button v-waves type="text" @click="ZZreport(row)">报工</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--分页--> |
| | |
| | | style="width: 300px" |
| | | @keyup.enter.native="val=>enterNative(val,'WXproduceCode')" |
| | | /> |
| | | <!-- @keyup.native="e=>judgeIsScanning(e,'WXproduceCode')"--> |
| | | |
| | | </div> |
| | | <div v-if="false" style="display: flex;padding-right: 10px"> |
| | |
| | | show-tooltip-when-overflow |
| | | width="150" |
| | | sortable="custom" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- label="操作"--> |
| | | <!-- width="150"--> |
| | | <!-- fixed="right"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-button v-waves type="text" @click="edit('edit',row)">编辑</el-button>--> |
| | | <!-- <el-button v-waves type="text" @click="del(row)">删除</el-button>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | label="操作" |
| | | width="150" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="WXSelected==='OUT'" v-waves type="text" @click="enterNative(WXform.orderstepqrcode=row.wo_code+';'+row.stepcode,'WXproduceCode')">发料</el-button> |
| | | <el-button v-if="WXSelected==='IN'" v-waves type="text" @click="enterNative(WXform.orderstepqrcode=row.wo_code+';'+row.stepcode,'WXproduceCode')">收料</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--分页--> |
| | |
| | | style="width: 300px" |
| | | @keyup.enter.native="val=>enterNative(val,'badProduceCode')" |
| | | /> |
| | | <!-- @keyup.native="e=>judgeIsScanning(e,'badProduceCode')"--> |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | </el-form-item> |
| | | <!--自制开始--> |
| | | <el-form-item v-if="dialogTitle==='自制开始'" label="开工数量:"> |
| | | <div style="width: 200px">{{ dialogForm.startqty }}</div> |
| | | <!-- <div style="width: 200px">{{ dialogForm.noreportqty }}</div>--> |
| | | <!-- <div style="width: 200px">{{ dialogForm.startqty }}</div>--> |
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='自制开始'" label="生产设备:"> |
| | | <div style="width: 200px">{{ form.SelectType? ZZeqpArr.find(i=>i.code===form.SelectType).name:'' }}</div> |
| | | <!-- <el-select--> |
| | | <!-- v-model="dialogForm.eqpcode"--> |
| | | <!-- style="width: 200px;"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in ZZeqpArr"--> |
| | | <!-- :key="item.code"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | <!-- <el-form-item v-if="dialogTitle==='自制开始'" label="生产设备:">--> |
| | | <!-- <div style="width: 200px">{{ form.SelectType? ZZeqpArr.find(i=>i.code===form.SelectType).name:'' }}</div>--> |
| | | <!-- <!– <el-select–>--> |
| | | <!-- <!– v-model="dialogForm.eqpcode"–>--> |
| | | <!-- <!– style="width: 200px;"–>--> |
| | | <!-- <!– placeholder="请选择"–>--> |
| | | <!-- <!– >–>--> |
| | | <!-- <!– <el-option–>--> |
| | | <!-- <!– v-for="item in ZZeqpArr"–>--> |
| | | <!-- <!– :key="item.code"–>--> |
| | | <!-- <!– :label="item.name"–>--> |
| | | <!-- <!– :value="item.code"–>--> |
| | | <!-- <!– />–>--> |
| | | <!-- <!– </el-select>–>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- 自制报工 --> |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="下道工序:" style="margin: 0 10px 0 0"> |
| | | <div style="width: 200px">{{ dialogForm.nextstepname }}</div> |
| | |
| | | <div style="width: 200px">{{ dialogForm.wkshopname }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="设备名称:" style="margin: 0 10px 0 0"> |
| | | <div style="width: 200px">{{ dialogForm.eqpname }}</div> |
| | | </el-form-item> |
| | | <!-- <el-form-item v-if="dialogTitle==='自制报工'" label="设备名称:" style="margin: 0 10px 0 0">--> |
| | | <!-- <div style="width: 200px">{{ dialogForm.eqpname }}</div>--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | <el-form-item v-if="dialogTitle==='自制报工'" prop="reckway" label="计件方式:"> |
| | | |
| | |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="合格数量:" prop="startqty"> |
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" /> |
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px;" /> |
| | | <!-- <el-input v-model="dialogForm.noreportqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />--> |
| | | </el-form-item> |
| | | |
| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="备注:"> |
| | | <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" /> |
| | | <el-input v-model="dialogForm.remarks" type="textarea" style="width: 520px;" /> |
| | | </el-form-item> |
| | | |
| | | <!-- <el-form-item v-if="dialogTitle==='自制报工'" label="不良原因:">--> |
| | |
| | | <el-input |
| | | v-if="row.isVisible===1||row.isVisible===2" |
| | | v-model="row.ratio" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | placeholder="请输入" |
| | | /> |
| | | <div v-else> {{ row.ratio }}</div> |
| | |
| | | label="发料数量:" |
| | | prop="fqty" |
| | | > |
| | | <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" /> |
| | | <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^0-9]/g,'')" style="width: 200px;" /> |
| | | </el-form-item> |
| | | <!-- 外协收料--> |
| | | <el-form-item |
| | |
| | | v-model="dialogForm.sqty" |
| | | style="width: 200px" |
| | | :disabled="dialogForm.wxcode===''" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | oninput="value=value.replace(/[^0-9]/g,'')" |
| | | /> |
| | | </el-form-item> |
| | | |
| | |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'SCKBG', |
| | | name: 'ProduceStartOrder', |
| | | components: { |
| | | Pagination |
| | | }, |
| | |
| | | radioSelected: '', // 工序选中 |
| | | WXradioSelected: '', // 工序选中 |
| | | form: { |
| | | orderstepqrcode: '', // 扫描的二维码信息 |
| | | SelectType: '', // 设备编码 |
| | | // orderstepqrcode: '', // 扫描的二维码信息 |
| | | // SelectType: '', // 设备编码 |
| | | wocode: '', |
| | | saleOrderCode: '', // 销售单号 |
| | | partcode: '', // 产品编码 |
| | | partname: '', // 产品名称 |
| | | partspec: '', // 规格型号 |
| | | |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | |
| | | |
| | | operation: getCookie('navTabId'), // 报工人(收料人) |
| | | remarks: '', // 备注 |
| | | |
| | | // isbott: true, |
| | | |
| | | inbarcode: ''// 末道工序时 打印的入库码 |
| | | |
| | |
| | | countJudgeIsScanningInput: 0 // 判断扫码框的个数 |
| | | } |
| | | }, |
| | | watch: { |
| | | // 'form.orderstepqrcode': { |
| | | // handler(newValue) { |
| | | // this.form.orderstepqrcode = newValue |
| | | // |
| | | // // 在这里调用,并执行this.fnThrottle(this.search, 500, 2000)(); |
| | | // this.fnThrottle(this.enterNative, 500, 2000, 'produceCode')() |
| | | // } |
| | | // }, |
| | | // 'WXform.orderstepqrcode': { |
| | | // handler(newValue) { |
| | | // this.form.orderstepqrcode = newValue |
| | | // |
| | | // // 在这里调用,并执行this.fnThrottle(this.search, 500, 2000)(); |
| | | // this.fnThrottle(this.enterNative, 500, 2000, 'WXproduceCode')() |
| | | // } |
| | | // }, |
| | | // 'badForm.orderstepqrcode': { |
| | | // handler(newValue) { |
| | | // this.form.orderstepqrcode = newValue |
| | | // |
| | | // // 在这里调用,并执行this.fnThrottle(this.search, 500, 2000)(); |
| | | // this.fnThrottle(this.enterNative, 500, 2000, 'badProduceCode')() |
| | | // } |
| | | // } |
| | | }, |
| | | |
| | | created() { |
| | | this.getMesOrderStepSearch() |
| | | this.tabClick() |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 防抖 //扫码用的是防抖 |
| | | fnThrottle(method, delay, duration, belong) { |
| | | var that = this |
| | | var timer = this.timer |
| | | var begin = new Date().getTime() |
| | | return function() { |
| | | var current = new Date().getTime() |
| | | clearTimeout(timer) |
| | | if (current - begin >= duration) { |
| | | // method() |
| | | // that.VALUE() |
| | | begin = current |
| | | } else { |
| | | that.timer = setTimeout(function() { |
| | | // method() |
| | | if (belong === 'produceCode') { |
| | | that.enterNative(that.form.orderstepqrcode, belong) |
| | | } |
| | | if (belong === 'WXproduceCode') { |
| | | that.enterNative(that.WXform.orderstepqrcode, belong) |
| | | } |
| | | if (belong === 'badProduceCode') { |
| | | that.enterNative(that.badForm.orderstepqrcode, belong) |
| | | } |
| | | }, delay) |
| | | } |
| | | } |
| | | }, |
| | | // 判断是否是扫码枪扫码 |
| | | judgeIsScanning2(e, belong) { |
| | | if (belong === 'produceCode' && this.form.orderstepqrcode.toString().length === 0) { |
| | | this.judgeIsScanningArr = [] |
| | | this.countJudgeIsScanningInput = 0 |
| | | } |
| | | if (belong === 'WXproduceCode' && this.WXform.orderstepqrcode.toString().length === 0) { |
| | | this.judgeIsScanningArr = [] |
| | | this.countJudgeIsScanningInput = 0 |
| | | } |
| | | const timenow = e.timeStamp |
| | | // console.log(timenow, 1) |
| | | // let flag = true |
| | | let flag = false |
| | | this.judgeIsScanningArr.push(timenow) |
| | | let i |
| | | |
| | | for (i in this.judgeIsScanningArr) { |
| | | console.log(Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2])) |
| | | // flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1 |
| | | if (Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1) { |
| | | this.countJudgeIsScanningInput++ |
| | | } |
| | | if (this.countJudgeIsScanningInput >= 3) { |
| | | flag = true |
| | | } |
| | | if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) { |
| | | if (flag) { |
| | | console.log(flag, 1) |
| | | this.fnThrottle(this.enterNative, 500, 2000, belong)() |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | // // for (i in this.judgeIsScanningArr) { |
| | | // // console.log(i) |
| | | // // console.log( this.judgeIsScanningArr) |
| | | // console.log(Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2])) |
| | | // if (Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 10) { |
| | | // this.countJudgeIsScanningInput++ |
| | | // } |
| | | // if (this.countJudgeIsScanningInput > this.judgeIsScanningArr.length / 2) { |
| | | // flag = true |
| | | // } |
| | | // // flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1 |
| | | // // if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) { |
| | | // if (flag) { |
| | | // console.log(flag, 2) |
| | | // this.fnThrottle(this.enterNative, 500, 2000, belong)() |
| | | // return |
| | | // } |
| | | // // } |
| | | // // } |
| | | }, |
| | | // 判断是否是扫码枪扫码 |
| | | judgeIsScanning(e, belong) { |
| | | const timenow = e.timeStamp |
| | | let flag = true |
| | | this.judgeIsScanningArr.push(timenow) |
| | | let i |
| | | for (i in this.judgeIsScanningArr) { |
| | | flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1 |
| | | if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) { |
| | | if (flag) { |
| | | this.fnThrottle(this.enterNative, 500, 2000, belong)() |
| | | return |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | // 扫码键盘回车事件 |
| | | async enterNative(val, belong) { |
| | | if (getCookie('description') !== 'W') { |
| | |
| | | // 收料:code="200" count=3 |
| | | // 走列表形式 code="200" count=4 |
| | | if (belong === 'produceCode') { |
| | | await this.getMesOrderStepStartSelectEqp() |
| | | |
| | | // console.log('asd') |
| | | // await this.getMesOrderStepStartSelectEqp() |
| | | await this.getMesOrderStepSearch() |
| | | // const orderstepqrcode = this.form.orderstepqrcode |
| | | // const data = { |
| | | // OperType: 'ZZ', |
| | |
| | | search() { |
| | | this.getMesOrderStepSearch() |
| | | }, |
| | | reset() { |
| | | this.form.wocode = '' |
| | | this.form.saleOrderCode = '' |
| | | this.form.partcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.getMesOrderStepSearch() |
| | | }, |
| | | // 自制开始 |
| | | async ZZstart(obj) { |
| | | // if (!this.ZZisExecutable) { |
| | | // return this.$message.info('请先扫码工序二维码!') |
| | | // } |
| | | |
| | | // this.dialogForm.isbott = obj.isbott === 'Y' |
| | | |
| | | const data = { |
| | | OperType: 'ZZ', |
| | | orderstepqrcode: obj.wo_code + ';' + obj.stepcode, |
| | | SelectType: 'START', |
| | | stu_torgcode: getCookie('stu_torgcode') |
| | | } |
| | | |
| | | const { data: res } = await MesOrderStepStart(data) |
| | | |
| | | // console.log(JSON.parse(JSON.stringify(res)), 321) |
| | | this.dialogTitle = '自制开始' |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.saleOrderCode = obj.saleOrderCode |
| | | this.dialogForm.wo_code = obj.wo_code |
| | | this.dialogForm.partcode = obj.partnumber |
| | | this.dialogForm.partname = obj.partname |
| | | this.dialogForm.partspec = obj.partspec |
| | | this.dialogForm.stepseq = obj.seq |
| | | this.dialogForm.stepcode = obj.stepcode |
| | | this.dialogForm.stepname = obj.stepname |
| | | this.dialogForm.stepdesc = obj.stepdesc |
| | | this.dialogForm.planqty = obj.planqty |
| | | this.dialogForm.reportqty = obj.reportqty |
| | | this.dialogForm.noreportqty = obj.noreportqty |
| | | this.dialogForm.saleOrderCode = res.saleOrderCode |
| | | this.dialogForm.wo_code = res.wo_code |
| | | this.dialogForm.partcode = res.partnumber |
| | | this.dialogForm.partname = res.partname |
| | | this.dialogForm.partspec = res.partspec |
| | | this.dialogForm.stepseq = res.seq |
| | | this.dialogForm.stepcode = res.stepcode |
| | | this.dialogForm.stepname = res.stepname |
| | | this.dialogForm.stepdesc = res.stepdesc |
| | | this.dialogForm.planqty = res.planqty |
| | | this.dialogForm.reportqty = res.reportqty |
| | | this.dialogForm.noreportqty = res.noreportqty |
| | | // this.dialogForm.startqty = obj.startqty |
| | | this.dialogForm.startqty = obj.noreportqty |
| | | this.dialogForm.startqty = res.noreportqty |
| | | }) |
| | | |
| | | // await this.getMesOrderStepStartSelectEqp() |
| | | }, |
| | | // 自制报工 |
| | | async ZZreport(obj) { |
| | | // if (!this.ZZisExecutable) { |
| | | // return this.$message.info('请先扫码工序二维码!') |
| | | // } |
| | | const data = { |
| | | OperType: 'ZZ', |
| | | orderstepqrcode: obj.wo_code + ';' + obj.stepcode, |
| | | SelectType: 'REPORT', |
| | | stu_torgcode: getCookie('stu_torgcode') |
| | | } |
| | | this.form.orderstepqrcode = obj.wo_code + ';' + obj.stepcode |
| | | const { data: res } = await MesOrderStepStart(data) |
| | | |
| | | // console.log(JSON.parse(JSON.stringify(res)), 322) |
| | | |
| | | this.dialogTitle = '自制报工' |
| | | this.dialogVisible = true |
| | | this.dialogForm.saleOrderCode = obj.saleOrderCode |
| | | this.dialogForm.wo_code = obj.wo_code |
| | | this.dialogForm.partcode = obj.partnumber |
| | | this.dialogForm.partname = obj.partname |
| | | this.dialogForm.partspec = obj.partspec |
| | | this.dialogForm.stepseq = obj.seq |
| | | this.dialogForm.stepcode = obj.stepcode |
| | | this.dialogForm.stepname = obj.stepname |
| | | this.dialogForm.stepdesc = obj.stepdesc |
| | | this.dialogForm.planqty = obj.planqty |
| | | this.dialogForm.reportqty = obj.reportqty |
| | | this.dialogForm.noputqty = obj.noputqty |
| | | this.dialogForm.noreportqty = obj.noreportqty |
| | | // this.dialogForm.startqty = obj.startqty |
| | | this.dialogForm.startqty = obj.noreportqty |
| | | |
| | | this.dialogForm.nextstepname = obj.nextstepname |
| | | this.dialogForm.nextstepcode = obj.nextstepcode |
| | | this.dialogForm.saleOrderCode = res.saleOrderCode |
| | | this.dialogForm.wo_code = res.wo_code |
| | | this.dialogForm.partcode = res.partnumber |
| | | this.dialogForm.partname = res.partname |
| | | this.dialogForm.partspec = res.partspec |
| | | this.dialogForm.stepseq = res.seq |
| | | this.dialogForm.stepcode = res.stepcode |
| | | this.dialogForm.stepname = res.stepname |
| | | this.dialogForm.stepdesc = res.stepdesc |
| | | this.dialogForm.planqty = res.planqty |
| | | this.dialogForm.reportqty = res.reportqty |
| | | this.dialogForm.noputqty = res.noputqty |
| | | this.dialogForm.noreportqty = res.noreportqty |
| | | // this.dialogForm.startqty = res.startqty |
| | | this.dialogForm.startqty = res.noreportqty |
| | | |
| | | this.dialogForm.startqtySum = obj.noreportqty |
| | | this.dialogForm.nextstepname = res.nextstepname |
| | | this.dialogForm.nextstepcode = res.nextstepcode |
| | | |
| | | this.dialogForm.eqpname = obj.eqpname |
| | | this.dialogForm.eqpcode = obj.eqpcode |
| | | console.log(obj.wkshopcode, 7) |
| | | this.dialogForm.wkshopcode = obj.wkshopcode |
| | | this.dialogForm.wkshopname = obj.wkshopname |
| | | this.dialogForm.startqtySum = res.noreportqty |
| | | // console.log(this.dialogForm.startqtySum, 2) |
| | | this.dialogForm.eqpname = res.eqpname |
| | | this.dialogForm.eqpcode = res.eqpcode |
| | | console.log(res.wkshopcode, 7) |
| | | this.dialogForm.wkshopcode = res.wkshopcode |
| | | this.dialogForm.wkshopname = res.wkshopname |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.userTableDataRef.doLayout() |
| | | }) |
| | | |
| | | // await this.getMesOrderStepStartSelectEqp() |
| | | await this.getMesOrderStepReportSelectUserGroup() |
| | | await this.getMesOrderStepSelectCause('ZZ') |
| | | await this.getMesOrderSelectUserZZ() |
| | |
| | | }, |
| | | // 获取自制报工生产班组下拉列表 |
| | | async getMesOrderStepReportSelectUserGroup() { |
| | | // this.dialogForm.wkshopcode |
| | | |
| | | const { data: res } = await MesOrderStepReportSelectUserGroup({ wkshopcode: this.dialogForm.wkshopcode }) |
| | | this.ZZtreams = res |
| | | }, |
| | |
| | | if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) { |
| | | return this.$message.info('发料数量不能大于未发数量!') |
| | | } |
| | | if (parseFloat(this.dialogForm.fqty) <= 0) { |
| | | return this.$message.info('发料数量要大于零!') |
| | | } |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, // 工单编号 |
| | | partcode: this.dialogForm.partcode, // 产品编码 |
| | |
| | | |
| | | if (this.WXouterprovide2.find(i => i.Name === this.dialogForm.wxcode).acceptQty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('收料数量加不良数量不能大于该供应商可收数量!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.sqty) <= 0) { |
| | | return this.$message.info('收料数量要大于零!') |
| | | } |
| | | |
| | | // if (parseFloat(this.dialogForm.noputqty) > 0) { |
| | |
| | | } |
| | | |
| | | if (this.dialogTitle === '自制开始') { |
| | | // console.log(parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.reportqty)) |
| | | // console.log(parseFloat(this.dialogForm.planqty), 9) |
| | | |
| | | if (parseFloat(this.dialogForm.startqty) > parseFloat(this.dialogForm.noreportqty)) { |
| | | return this.$message.info('开工数量之和不能大于未开数量!') |
| | | } |
| | | // if (this.dialogForm.isbott) { |
| | | // if (parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.reportqty) > parseFloat(this.dialogForm.planqty)) { |
| | | // return this.$message.info('开工数量之和不能大于任务数量!') |
| | | // } |
| | | // } |
| | | // |
| | | // if (!this.dialogForm.isbott) { |
| | | // if (parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.reportqty) > parseFloat(this.dialogForm.noreportqty)) { |
| | | // return this.$message.info('开工数量之和不能大于未开数量!') |
| | | // } |
| | | // } |
| | | |
| | | if (parseFloat(this.dialogForm.startqty) <= 0) { |
| | | return this.$message.info('开工数量必须大于零!') |
| | | } |
| | | |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, // 工单编号 |
| | | partcode: this.dialogForm.partcode, // 产品编码 |
| | | stepseq: this.dialogForm.stepseq, // 工序序号 暂时缺 |
| | | stepcode: this.dialogForm.stepcode, // 工序编码 |
| | | eqpcode: this.form.SelectType, // 生产设备 |
| | | eqpcode: '', // 生产设备 |
| | | taskqty: this.dialogForm.planqty, // 任务数量 |
| | | startqty: this.dialogForm.startqty// 开始数量 |
| | | } |
| | |
| | | } |
| | | |
| | | if (this.dialogTitle === '自制报工') { |
| | | console.log(parseFloat(this.dialogForm.startqtySum) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) |
| | | if (parseFloat(this.dialogForm.startqtySum) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('报工数量加不良数量不能大于了未报数量!') |
| | | } |
| | | if (this.userTableData.length < 1 && this.dialogForm.reckway === 'group') { |
| | | return this.$message.info('人员列表不能为空!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.startqty) <= 0) { |
| | | return this.$message.info('报工数量必须大于零!') |
| | | } |
| | | |
| | | // this.userTableData = [...new Set(this.userTableData)]// 数组去重 |
| | | this.userTableData = this.userTableData.filter(item => item.usercode !== '') |
| | | // 数组中对象相同的去重 |
| | |
| | | // badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 不良原因 |
| | | } |
| | | |
| | | console.log(JSON.parse(JSON.stringify(data)), 'data') |
| | | console.log(JSON.stringify(data), 'data') |
| | | // console.log(JSON.parse(JSON.stringify(data)), 'data') |
| | | // console.log(JSON.stringify(data), 'data') |
| | | |
| | | // this.$store.state.app.buttonIsDisabled = true |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | | SavaMesOrderStepReport(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |