| | |
| | | <el-form-item v-show="isExpandForm" label="创建人员" style=" display: flex;"> |
| | | <el-input v-model="form.creatuser" style="width: 200px" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item v-show="isExpandForm" label="创建时间" style=" display: flex;"> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="form.createdate"--> |
| | | <!-- type="daterange"--> |
| | | <!-- :clearable="false"--> |
| | | <!-- range-separator="~"--> |
| | | <!-- start-placeholder="开始日期"--> |
| | | <!-- end-placeholder="结束日期"--> |
| | | <!-- size="mini"--> |
| | | <!-- />--> |
| | | <el-date-picker |
| | | v-model="form.createdate" |
| | | type="date" |
| | | size="mini" |
| | | :clearable="false" |
| | | class="dateMini" |
| | | format="yyyy-MM-dd" |
| | | placeholder="选择日期" |
| | | /> |
| | | </el-form-item> |
| | | <DateType |
| | | ref="DateTypeRef" |
| | | :is-expand-form="isExpandForm" |
| | | style="display:flex;justify-content: center;align-items: center;position: relative" |
| | | :datatype-list="datatypeList" |
| | | @DateTypeChange="DateTypeChange" |
| | | @cycleTimeChange="cycleTimeChange" |
| | | /> |
| | | </div> |
| | | |
| | | <div |
| | |
| | | :data="tableData" |
| | | :height="isExpandForm?tableHeight:(tableHeight+80)+'px'" |
| | | border |
| | | :summary-method="getSummaries" |
| | | show-summary |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px'}" |
| | | highlight-current-row |
| | |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | v-if="mesSetting.route" |
| | | prop="route_name" |
| | | label="工艺路线" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.route_name">{{ row.route_name }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="工单数" |
| | |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="plan_startdate" |
| | | label="预计开工日期" |
| | | sortable="custom" |
| | | width="130" |
| | | > |
| | | <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 |
| | | prop="plan_enddate" |
| | | label="预计完工日期" |
| | | sortable="custom" |
| | | width="130" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.plan_enddate">{{ row.plan_enddate.substring(0, 11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="SOP预览" placement="top"> |
| | | <i |
| | | v-if="mesSetting.workOrder" |
| | | class="el-icon-files" |
| | | style="cursor: pointer;color:#42b983;margin-right: 15px" |
| | | @click.stop="pre(row,1)" |
| | | /> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip class="item" effect="dark" content="修改" placement="top"> |
| | | <i |
| | | class="el-icon-edit-outline" |
| | |
| | | :style="{color:$store.state.settings.theme}" |
| | | class="el-icon-printer" |
| | | style="cursor: pointer;margin-right: 15px" |
| | | @click.stop="handlePrint(row.wo_code)" |
| | | @click.stop="handlePrint(row.wo_code,row.saleOrderCod)" |
| | | /> |
| | | </el-tooltip> |
| | | |
| | |
| | | <el-table-column |
| | | label="工序单价" |
| | | show-tooltip-when-overflow |
| | | prop="stepprice" |
| | | prop="unprice" |
| | | /> |
| | | <el-table-column |
| | | label="已生产数量" |
| | |
| | | show-tooltip-when-overflow |
| | | prop="delive_qty" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- label="操作"--> |
| | | <!-- width="120"--> |
| | | <!-- fixed="right"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-tooltip class="item" effect="dark" content="打印工序" placement="top">--> |
| | | <!-- <i--> |
| | | <!-- v-if="tableDataDetail.length!==row.seq"--> |
| | | <!-- class="el-icon-printer"--> |
| | | <!-- :style="{color:$store.state.settings.theme}"--> |
| | | <!-- style="cursor: pointer;margin-right: 15px"--> |
| | | <!-- @click="supplementSmallClick(row)"--> |
| | | <!-- />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- <el-tooltip class="item" effect="dark" content="补打生产入库条码" placement="top">--> |
| | | <!-- <i--> |
| | | <!-- v-if="tableDataDetail.length===row.seq"--> |
| | | <!-- class=" el-icon-camera"--> |
| | | <!-- :style="{color:$store.state.settings.theme}"--> |
| | | <!-- style="cursor: pointer;margin-right: 15px"--> |
| | | <!-- @click="getProductInHouseLabCode(row.wo_code)"--> |
| | | <!-- />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | label="操作" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="SOP预览" placement="top"> |
| | | <i |
| | | v-if="mesSetting.tech" |
| | | class="el-icon-files" |
| | | style="cursor: pointer;color:#42b983;margin-right: 15px" |
| | | @click="pre(row,2)" |
| | | /> |
| | | </el-tooltip> |
| | | <!-- <el-tooltip class="item" effect="dark" content="打印工序" placement="top">--> |
| | | <!-- <i--> |
| | | <!-- v-if="tableDataDetail.length!==row.seq"--> |
| | | <!-- class="el-icon-printer"--> |
| | | <!-- :style="{color:$store.state.settings.theme}"--> |
| | | <!-- style="cursor: pointer;margin-right: 15px"--> |
| | | <!-- @click="supplementSmallClick(row)"--> |
| | | <!-- />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- <el-tooltip class="item" effect="dark" content="补打生产入库条码" placement="top">--> |
| | | <!-- <i--> |
| | | <!-- v-if="tableDataDetail.length===row.seq"--> |
| | | <!-- class=" el-icon-camera"--> |
| | | <!-- :style="{color:$store.state.settings.theme}"--> |
| | | <!-- style="cursor: pointer;margin-right: 15px"--> |
| | | <!-- @click="getProductInHouseLabCode(row.wo_code)"--> |
| | | <!-- />--> |
| | | <!-- </el-tooltip>--> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | |
| | | /> |
| | | <!-- oninput="value=value.replace(/[^0-9*.{1}0-9*]/g,'')"--> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="所属车间" prop="wkshopcode"> |
| | | <el-select |
| | | v-model="dialogForm.wkshopcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px;" |
| | | placeholder="请选择车间" |
| | | @change="getMesOrderNewStepContent" |
| | | > |
| | | <!-- @change="sourceType? getMesOrderNewStepContent():routecodeChange()"--> |
| | | <el-option |
| | | v-for="item in wkshopArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | label="产品名称/编码" |
| | | prop="partcode" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item v-if="operation!=='add'" label="产品名称" prop="partname">--> |
| | | <!-- <el-input v-model="dialogForm.partname" disabled style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-if="operation!=='add'" label="产品编码">--> |
| | | <!-- <el-input v-model="dialogForm.partcode" disabled style="width: 200px" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="产品规格" prop="partspec"> |
| | | <el-input v-model="dialogForm.partspec" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | <!-- :disabled="dialogForm.partcode===''"--> |
| | | <el-form-item label="所属车间" prop="wkshopcode"> |
| | | <el-form-item v-if="mesSetting.route" label="工艺路线" prop="routecode"> |
| | | <el-select |
| | | v-model="dialogForm.wkshopcode" |
| | | v-model="dialogForm.routecode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px;" |
| | | placeholder="请选择车间" |
| | | @change="getMesOrderNewStepContent" |
| | | placeholder="请选择工艺路线" |
| | | @change="sourceType? getMesOrderNewStepContent():routecodeChange()" |
| | | > |
| | | <el-option |
| | | v-for="item in wkshopArr" |
| | | :key="item.torg_code" |
| | | :label="item.torg_name" |
| | | :value="item.torg_code" |
| | | v-for="item in routecodeArr" |
| | | :key="item.route_code" |
| | | :label="item.route_name" |
| | | :value="item.route_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="预计交付日期" prop="deliverydate"> |
| | | <el-date-picker |
| | | v-model="dialogForm.deliverydate" |
| | | type="date" |
| | | style="width: 200px;" |
| | | size="mini" |
| | | :clearable="false" |
| | | class="dateMini" |
| | |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="选择日期" |
| | | /> |
| | | <!-- :disabled="dialogForm.deliverydate"--> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="物料清单" prop="bomid"> |
| | | <el-select |
| | | v-model="dialogForm.bomid" |
| | | clearable |
| | | placeholder="请选择物料清单" |
| | | > |
| | | <el-option |
| | | v-for="item in BomDataArr" |
| | | :key="item.id" |
| | | :label="item.version" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="工序来源" required> |
| | | <el-switch |
| | | v-model="sourceType" |
| | | style="width: 200px;" |
| | | inactive-text="基础设置" |
| | | active-text="历史最新" |
| | | :disabled="!dialogForm.wkshopcode" |
| | | @change="sourceTypeChange" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-divider content-position="left">工序信息</el-divider> |
| | |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | row-key="stepcode" |
| | | > |
| | | <el-table-column type="expand"> |
| | | <template slot-scope="props"> |
| | | |
| | | <el-table |
| | | :data="props.row.children" |
| | | style="width: 96%;margin: auto;" |
| | | border |
| | | row-key="eqp_code" |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column |
| | | prop="eqp_code" |
| | | label="设备/往来编码" |
| | | min-width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="eqp_name" |
| | | label="设备/往来名称" |
| | | min-width="120" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="eqp_value"--> |
| | | <!-- label="设备节拍"--> |
| | | <!-- min-width="150"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div style="display: flex;align-items: center">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="row.eqp_value"--> |
| | | <!-- placeholder="请输入"--> |
| | | <!-- oninput="value=value.replace(/[^0-9.]/g,'')"--> |
| | | <!-- @change="val=>eqpValueChange(val,row)"--> |
| | | <!-- />--> |
| | | <!-- <div style="margin-left: 5px">秒</div>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="stand_value"--> |
| | | <!-- label="生产节拍"--> |
| | | <!-- min-width="120"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div>{{ row.stand_value + ' ' + '秒/次' }}</div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="cavity_qty"--> |
| | | <!-- label="腔型数"--> |
| | | <!-- min-width="120"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="row.cavity_qty"--> |
| | | <!-- placeholder="请输入"--> |
| | | <!-- oninput="value=value.replace(/[^0-9.]/g,'')"--> |
| | | <!-- @change="val=>cavityQtyChange(val,row)"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="unprice" |
| | | label="设备工价" |
| | | min-width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input v-model="row.unprice" oninput="value=value.replace(/[^0-9.]/g,'')" /> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- v-if="!sourceType"--> |
| | | <el-table-column |
| | | |
| | | prop="enable" |
| | | label="是否启用" |
| | | min-width="150" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | v-model="row.enable" |
| | | inactive-value="N" |
| | | active-value="Y" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | type="index" |
| | | label="序号" |
| | |
| | | show-tooltip-when-overflow |
| | | /> |
| | | <el-table-column |
| | | prop="stepprice" |
| | | prop="unprice" |
| | | label="生产单价" |
| | | show-tooltip-when-overflow |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-input |
| | | v-model="row.stepprice" |
| | | v-model="row.unprice" |
| | | placeholder="请输入工序单价" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | style="width: 100%" |
| | | @click.stop="" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | title="" |
| | | top="7vh" |
| | | :visible.sync="dialogVisibleApprove" |
| | | width="812px" |
| | | class="dialogVisibleConfirmClass" |
| | |
| | | > |
| | | <!-- 要打印的区域 --> |
| | | <div id="printMe" style="padding: 30px"> |
| | | <div style="font-size: 26px; text-align: center">流程单</div> |
| | | <!-- <div v-for="(item,index) in tableDataPrint" :key="index">--> |
| | | <div> |
| | | <div style="font-size: 26px; text-align: center">流程单</div> |
| | | |
| | | <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;"> |
| | | <div style="width: 78%"> |
| | | <el-form |
| | | ref="formApprove" |
| | | :model="formApprove" |
| | | label-width="80px" |
| | | inline |
| | | style="display: flex;justify-content: space-between" |
| | | <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;"> |
| | | <div style="width: 78%"> |
| | | <el-form |
| | | ref="formApprove" |
| | | :model="formApprove" |
| | | label-width="80px" |
| | | inline |
| | | style="display: flex;justify-content: space-between" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="销售单号:" class="formContent"> |
| | | {{ formApprove.saleOrderCode ? formApprove.saleOrderCode : '/' }} |
| | | </el-form-item> |
| | | <el-form-item label="工单编号:" class="formContent"> |
| | | {{ formApprove.mesordercode }} |
| | | </el-form-item> |
| | | <el-form-item label="源单单号:" class="formContent"> |
| | | {{ formApprove.m_po }} |
| | | </el-form-item> |
| | | <el-form-item label="产品编码:" class="formContent"> |
| | | {{ formApprove.partcode }} |
| | | </el-form-item> |
| | | <el-form-item label="产品名称:" class="formContent"> |
| | | {{ formApprove.partname }} |
| | | </el-form-item> |
| | | <el-form-item label="产品规格:" class="formContent"> |
| | | {{ formApprove.partspec }} |
| | | </el-form-item> |
| | | <el-form-item label="工单数量:" class="formContent"> |
| | | {{ formApprove.plan_qty }} |
| | | </el-form-item> |
| | | <!-- <el-form-item label="工艺路线:" class="formContent">--> |
| | | <!-- {{ formApprove.routename }}--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="打印人员:" class="formContent"> |
| | | <!-- {{ localStorage.getItem('username') }}--> |
| | | {{ formApprove.routename }} |
| | | </el-form-item> |
| | | <el-form-item label="打印时间:" class="formContent"> |
| | | {{ formApprove.lm_date }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | id="qrCode0" |
| | | style="width: 22%;height:90px; |
| | | margin-top: 20px; |
| | | overflow-y: scroll;display: flex; |
| | | justify-content: center; |
| | | position: relative;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="工单编号:" class="formContent"> |
| | | {{ formApprove.mesordercode }} |
| | | </el-form-item> |
| | | <el-form-item label="源单单号:" class="formContent"> |
| | | {{ formApprove.m_po }} |
| | | </el-form-item> |
| | | <el-form-item label="产品编码:" class="formContent"> |
| | | {{ formApprove.partcode }} |
| | | </el-form-item> |
| | | <el-form-item label="产品名称:" class="formContent"> |
| | | {{ formApprove.partname }} |
| | | </el-form-item> |
| | | <el-form-item label="产品规格:" class="formContent"> |
| | | {{ formApprove.partspec }} |
| | | </el-form-item> |
| | | <el-form-item label="工单数量:" class="formContent"> |
| | | {{ formApprove.plan_qty }} |
| | | </el-form-item> |
| | | <!-- <el-form-item label="工艺路线:" class="formContent">--> |
| | | <!-- {{ formApprove.routename }}--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="打印人员:" class="formContent"> |
| | | <!-- {{ localStorage.getItem('username') }}--> |
| | | {{ formApprove.routename }} |
| | | </el-form-item> |
| | | <el-form-item label="打印时间:" class="formContent"> |
| | | {{ formApprove.lm_date }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | <div id="qrCode00" ref="qrCodeDiv00" /> |
| | | </div> |
| | | <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" /> |
| | | <div |
| | | style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px" |
| | | /> |
| | | </div> |
| | | <div |
| | | id="qrCode" |
| | | style="width: 22%;height:90px; |
| | | margin-top: 20px; |
| | | overflow-y: scroll;display: flex; |
| | | justify-content: center; |
| | | position: relative;" |
| | | |
| | | <el-table |
| | | id="table" |
| | | :data="tableDataPrint[0]" |
| | | border |
| | | class="tableDataPrint" |
| | | :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}" |
| | | :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}" |
| | | style="width: 100%;margin-top: 20px;text-align: center;border-color: #000" |
| | | > |
| | | <div id="qrCode0" ref="qrCodeDiv0" /> |
| | | </div> |
| | | <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" /> |
| | | <div |
| | | style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px" |
| | | /> |
| | | <el-table-column |
| | | id="column0" |
| | | prop="seq" |
| | | label="工序号" |
| | | width="70" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column1" |
| | | prop="stepqrcode" |
| | | label="工序二维码" |
| | | width="100" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | |
| | | <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | id="column2" |
| | | prop="stepname" |
| | | label="工序" |
| | | width="120" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column3" |
| | | prop="plan_qty" |
| | | label="加工数量" |
| | | width="100" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column4" |
| | | prop="good_qty" |
| | | width="100" |
| | | align="center" |
| | | label="合格数量" |
| | | /> |
| | | <el-table-column |
| | | id="column5" |
| | | width="100" |
| | | prop="ng_qty" |
| | | align="center" |
| | | label="不良数量" |
| | | /> |
| | | <el-table-column |
| | | id="column6" |
| | | prop="desc" |
| | | align="center" |
| | | width="120" |
| | | label="备注" |
| | | /> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!-- <div style="width:100%;height: 30px;border-bottom: 1px solid #eee;margin-bottom: 20px" />--> |
| | | <el-table |
| | | id="table" |
| | | :data="tableDataPrint" |
| | | border |
| | | class="tableDataPrint" |
| | | :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}" |
| | | :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}" |
| | | style="width: 100%;margin-top: 20px;text-align: center;border-color: #000" |
| | | > |
| | | <el-table-column |
| | | id="column0" |
| | | prop="seq" |
| | | label="工序号" |
| | | width="70" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column1" |
| | | prop="stepqrcode" |
| | | label="工序二维码" |
| | | width="100" |
| | | align="center" |
| | | <div v-if="tableDataPrint[1]" style="margin-top: 100px;"> |
| | | <div style="font-size: 26px; text-align: center">流程单</div> |
| | | |
| | | <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;"> |
| | | <div style="width: 78%"> |
| | | <el-form |
| | | ref="formApprove" |
| | | :model="formApprove" |
| | | label-width="80px" |
| | | inline |
| | | style="display: flex;justify-content: space-between" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="销售单号:" class="formContent"> |
| | | {{ formApprove.saleOrderCode ? formApprove.saleOrderCode : '/' }} |
| | | </el-form-item> |
| | | <el-form-item label="工单编号:" class="formContent"> |
| | | {{ formApprove.mesordercode }} |
| | | </el-form-item> |
| | | <el-form-item label="源单单号:" class="formContent"> |
| | | {{ formApprove.m_po }} |
| | | </el-form-item> |
| | | <el-form-item label="产品编码:" class="formContent"> |
| | | {{ formApprove.partcode }} |
| | | </el-form-item> |
| | | <el-form-item label="产品名称:" class="formContent"> |
| | | {{ formApprove.partname }} |
| | | </el-form-item> |
| | | <el-form-item label="产品规格:" class="formContent"> |
| | | {{ formApprove.partspec }} |
| | | </el-form-item> |
| | | <el-form-item label="工单数量:" class="formContent"> |
| | | {{ formApprove.plan_qty }} |
| | | </el-form-item> |
| | | <!-- <el-form-item label="工艺路线:" class="formContent">--> |
| | | <!-- {{ formApprove.routename }}--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="打印人员:" class="formContent"> |
| | | <!-- {{ localStorage.getItem('username') }}--> |
| | | {{ formApprove.routename }} |
| | | </el-form-item> |
| | | <el-form-item label="打印时间:" class="formContent"> |
| | | {{ formApprove.lm_date }} |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | id="qrCode1" |
| | | style="width: 22%;height:90px; |
| | | margin-top: 20px; |
| | | overflow-y: scroll;display: flex; |
| | | justify-content: center; |
| | | position: relative;" |
| | | > |
| | | <div id="qrCode01" ref="qrCodeDiv01" /> |
| | | </div> |
| | | <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" /> |
| | | <div |
| | | style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px" |
| | | /> |
| | | </div> |
| | | |
| | | <el-table |
| | | id="table" |
| | | :data="tableDataPrint[1]" |
| | | border |
| | | class="tableDataPrint" |
| | | :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}" |
| | | :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}" |
| | | style="width: 100%;margin-top: 20px;text-align: center;border-color: #000" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" class="tableColumn" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | id="column2" |
| | | prop="stepname" |
| | | label="工序" |
| | | width="120" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column3" |
| | | prop="plan_qty" |
| | | label="加工数量" |
| | | width="100" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column4" |
| | | prop="good_qty" |
| | | width="100" |
| | | align="center" |
| | | label="合格数量" |
| | | /> |
| | | <el-table-column |
| | | id="column5" |
| | | width="100" |
| | | prop="ng_qty" |
| | | align="center" |
| | | label="不良数量" |
| | | /> |
| | | <el-table-column |
| | | id="column6" |
| | | prop="desc" |
| | | align="center" |
| | | width="120" |
| | | label="备注" |
| | | /> |
| | | </el-table> |
| | | <el-table-column |
| | | id="column0" |
| | | prop="seq" |
| | | label="工序号" |
| | | width="70" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column1" |
| | | prop="stepqrcode" |
| | | label="工序二维码" |
| | | width="100" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | |
| | | <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | id="column2" |
| | | prop="stepname" |
| | | label="工序" |
| | | width="120" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column3" |
| | | prop="plan_qty" |
| | | label="加工数量" |
| | | width="100" |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | id="column4" |
| | | prop="good_qty" |
| | | width="100" |
| | | align="center" |
| | | label="合格数量" |
| | | /> |
| | | <el-table-column |
| | | id="column5" |
| | | width="100" |
| | | prop="ng_qty" |
| | | align="center" |
| | | label="不良数量" |
| | | /> |
| | | <el-table-column |
| | | id="column6" |
| | | prop="desc" |
| | | align="center" |
| | | width="120" |
| | | label="备注" |
| | | /> |
| | | </el-table> |
| | | </div> |
| | | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 工单sop/工序sop--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | class="sop" |
| | | title="SOP预览" |
| | | :visible.sync="SopDialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleSopClose" |
| | | @close="handleSopClose" |
| | | > |
| | | |
| | | <el-form inline label-width="110px" style="display:flex"> |
| | | <el-form-item label="工单SOP"> |
| | | <el-select |
| | | v-model="dialogSopForm.sop" |
| | | style="width:200px" |
| | | placeholder="请选择" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | @change="sopChange" |
| | | > |
| | | <el-option |
| | | v-for="item in sopArr" |
| | | :key="item.filepath" |
| | | :label="item.filename" |
| | | :value="item.filepath" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="Sop版本"> |
| | | <el-input v-model="dialogSopForm.v" disabled style="width: 200px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | style="margin-left: 37px" |
| | | @click="view" |
| | | >预 览/下 载 |
| | | </el-button> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="handleSopClose">取 消</el-button> |
| | | <!-- <el-button--> |
| | | <!-- v-waves--> |
| | | <!-- type="primary"--> |
| | | <!-- :loading="$store.state.app.buttonIsDisabled"--> |
| | | <!-- :disabled="$store.state.app.buttonIsDisabled"--> |
| | | <!-- @click="handleSopConfirm"--> |
| | | <!-- >确 定</el-button>--> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | AddMesOrderCodeSearch, |
| | | AddUpdateMesOrder, DeleteMesOrder, |
| | | MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent, |
| | | MesOrderSearch, |
| | | MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent, MesOrderProcessSopSearch, |
| | | MesOrderSearch, MesOrderSopSearch, |
| | | UpdateMesOrderStepSearch |
| | | } from '@/api/WorkOrder' |
| | | import { PartSelect } from '@/api/ProductModel' |
| | | import { PrentOrganization, PrentOrganizationNoCompany, StepData } from '@/api/GeneralBasicData' |
| | | import { |
| | | PartSearchBomDate, |
| | | PrentOrganization, |
| | | PrentOrganizationNoCompany, |
| | | StepData, |
| | | StepEqpData |
| | | } from '@/api/GeneralBasicData' |
| | | import Sortable from 'sortablejs' |
| | | import ElDragSelect from '@/components/DragSelect' |
| | | import { MesOrderPrintSearch } from '@/api/GridReport' // base on element-ui |
| | | import DateType from '@/components/DateType' |
| | | import { PartSelectRpute, RouteSelectStep } from '@/api/basicSettings' |
| | | import { DeviceSopSearch } from '@/api/DeviceManager' |
| | | |
| | | export default { |
| | | name: 'WorkOrderList', |
| | | components: { |
| | | Pagination, ElDragSelect |
| | | Pagination, ElDragSelect, DateType |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | |
| | | partname: '', // 产品名称 |
| | | partspec: '', // 产品规格 |
| | | creatuser: '', // 创建人员 |
| | | createdate: '', // 创建时间 |
| | | // createdate: '', // 创建时间 |
| | | datatype: 'ED', // 日期类型(计划开工(PS)、计划完工(PE)、预计交付(ED)、创建日期(CT)) |
| | | timeValue: [], // 查询日期 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | | page: 1, // 第几页 |
| | |
| | | deliverydate: '', // 交付时间 |
| | | data_sources: '', // 数据来源 |
| | | |
| | | mesmaxqty: 0// 工单的最大值 |
| | | routecode: '', // 工艺路线 |
| | | |
| | | mesmaxqty: 0, // 工单的最大值 |
| | | mesqtyinit: 0, // 工单数量初始值 |
| | | |
| | | bomid: ''// |
| | | }, |
| | | ordertypeArr: [// 工单类型 |
| | | { code: 'PO', name: '标准工单' }, |
| | |
| | | ], |
| | | wkshopcode: [ |
| | | { required: true, message: '请选择生产车间', trigger: ['blur', 'change'] } |
| | | ], |
| | | routecode: [ |
| | | { required: true, message: '请选择工艺路线', trigger: ['blur', 'change'] } |
| | | ], |
| | | deliverydate: [ |
| | | { required: true, message: '请选择预计交付日期', trigger: ['blur', 'change'] } |
| | |
| | | stepSelectArr: [], // 工序下拉数据 |
| | | stepSelectedValue: [], // 下拉选中值 |
| | | |
| | | multipleSelection: [] |
| | | multipleSelection: [], |
| | | |
| | | datatypeList: [ |
| | | { code: 'PS', name: '预计开工日期' }, |
| | | { code: 'PE', name: '预计完工日期' }, |
| | | { code: 'ED', name: '预计交付日期' }, |
| | | { code: 'CT', name: '工单创建日期' } |
| | | ], |
| | | |
| | | routecodeArr: [], // |
| | | |
| | | sourceType: false, // 工序的数据来源 |
| | | |
| | | mesSetting: JSON.parse(localStorage.getItem('mesSetting')), |
| | | |
| | | SopDialogVisible: false, |
| | | dialogSopForm: { // 设备SOP表单 |
| | | sop: '', |
| | | v: '' |
| | | }, |
| | | sopArr: [], |
| | | routeCode: '', // 工艺路线code |
| | | partCode: '', |
| | | |
| | | StepEqpArr: [], |
| | | |
| | | editStepEqpArr: [], |
| | | |
| | | flag1: false, |
| | | |
| | | BomDataArr: [] |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | console.log(val, 1) |
| | | const arr = JSON.parse(JSON.stringify(this.stepTableData)) |
| | | const arrStepcode = arr.map(i => i.stepcode) |
| | | |
| | | console.log(arr, 3) |
| | | this.stepTableData = [] |
| | | val.forEach(i => { |
| | | let children = [] |
| | | |
| | | if (arrStepcode.includes(i)) { // 子项保持不变 |
| | | children = arr.find(j => j.stepcode === i).children |
| | | } else { |
| | | // 1.先查找自己原有子项是否有 |
| | | console.log(this.editStepEqpArr.find(j => j.step_code === i), 'this.editStepEqpArr.find(j => j.step_code === i)') |
| | | if (this.editStepEqpArr.find(j => j.step_code === i)) { |
| | | children = this.editStepEqpArr.find(j => j.step_code === i).children |
| | | |
| | | console.log(children, 10) |
| | | } else { |
| | | // 再查找 历史最新或者基础资料是否有 |
| | | if (this.sourceType) { |
| | | children = this.StepEqpArr.find(j => j.step_code === i).children |
| | | console.log(children, 11) |
| | | } |
| | | if (!this.sourceType) { |
| | | children = this.StepEqpArr.find(j => j.step_code === i).children |
| | | console.log(children, 12) |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i, |
| | | stepname: this.stepSelectArr.find(j => j.stepcode === i).stepname, |
| | | stepprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).stepprice : 0 |
| | | unprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).unprice : 0, |
| | | // children:arrStepcode.includes(i)? arr.find(j => j.stepcode === i).children: |
| | | |
| | | children |
| | | |
| | | } |
| | | ) |
| | | }) |
| | |
| | | // }) |
| | | }, |
| | | methods: { |
| | | // 工序设备基础资料 |
| | | async getStepEqpData() { |
| | | const { data: res } = await StepEqpData() |
| | | this.StepEqpArr = res |
| | | }, |
| | | |
| | | // 弹出框关闭 |
| | | handleSopClose() { |
| | | this.SopDialogVisible = false |
| | | this.dialogSopForm = { // 设备SOP表单 |
| | | sop: '', |
| | | v: '' |
| | | } |
| | | }, |
| | | // 预览 |
| | | view() { |
| | | window.open(process.env.VUE_APP_BASE_API_FILE + this.dialogSopForm.sop) |
| | | }, |
| | | sopChange(val) { |
| | | this.dialogSopForm.v = this.sopArr.find(i => i.filepath === val).version |
| | | }, |
| | | async pre(row, type) { |
| | | if (type === 1) { |
| | | const data = { |
| | | wocode: row.wo_code, |
| | | materielcode: row.partcode |
| | | } |
| | | const { data: res } = await MesOrderSopSearch(data) |
| | | this.sopArr = res |
| | | } |
| | | |
| | | if (type === 2) { |
| | | const data = { |
| | | materielcode: this.partCode, |
| | | routecode: this.routeCode ? this.routeCode : '', |
| | | stepcode: row.step_code |
| | | } |
| | | const { data: res } = await MesOrderProcessSopSearch(data) |
| | | this.sopArr = res |
| | | } |
| | | |
| | | this.SopDialogVisible = true |
| | | }, |
| | | // 工序来源切换 |
| | | sourceTypeChange(val) { |
| | | this.flag1 = false |
| | | this.stepTableData = [] |
| | | if (val) { |
| | | this.getMesOrderNewStepContent() |
| | | } else { |
| | | if (this.mesSetting.route) { |
| | | this.routecodeChange() |
| | | } else { |
| | | this.getBasicProcessData() |
| | | } |
| | | } |
| | | }, |
| | | |
| | | DateTypeChange(value) { |
| | | this.form.datatype = value |
| | | }, |
| | | cycleTimeChange(val) { |
| | | this.form.timeValue = val |
| | | }, |
| | | setSort() { |
| | | const el = this.$refs.stepTableDataRef.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] |
| | | this.sortable = Sortable.create(el, { |
| | |
| | | if (res.code === '200') { |
| | | this.getSelect() |
| | | this.getPrentOrganizationNoCompany() |
| | | this.getStepEqpData() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | sourceorder: this.form.sourceorder, // 源单单号 |
| | | saleordercode: this.form.saleordercode, // 销售订单 |
| | | ordertype: this.form.ordertype, // 单据类型 |
| | | createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // 创建时间 |
| | | datatype: this.form.datatype, |
| | | searchdate: this.form.timeValue.join('~'), |
| | | // createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // 创建时间 |
| | | prop: this.form.prop, // 排序字段 |
| | | order: this.form.order, // 排序字段 |
| | | page: this.form.page, // 第几页 |
| | |
| | | this.form.creatuser = '' |
| | | this.form.sourceorder = '' |
| | | this.form.ordertype = '' |
| | | this.form.createdate = '' |
| | | // this.form.createdate = '' |
| | | |
| | | this.form.timeValue = [] |
| | | this.cycleTime = null |
| | | this.$refs.DateTypeRef.clearValue() |
| | | |
| | | this.getMesOrderSearch() |
| | | }, |
| | | // 新增按钮 |
| | |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.data_sources = 'MES' |
| | | |
| | | this.sourceType = true |
| | | this.$nextTick(() => { |
| | | this.setSort() |
| | | }) |
| | |
| | | this.dialogForm.partname = row.partname |
| | | this.dialogForm.partspec = row.partspec |
| | | this.dialogForm.wkshopcode = row.wkshp_code |
| | | this.dialogForm.routecode = row.route_code |
| | | this.dialogForm.deliverydate = row.saleOrderDeliveryDate.substring(0, 11) |
| | | this.dialogForm.mesqty = row.plan_qty |
| | | |
| | | this.dialogForm.mesqtyinit = row.plan_qty |
| | | |
| | | this.dialogForm.bomid = row.bom_id |
| | | await this.getPartSearchBomDate(row.partcode) |
| | | |
| | | const data = { |
| | | sourceid: this.dialogForm.sourceorderid, |
| | |
| | | } |
| | | const { data: res } = await UpdateMesOrderStepSearch(data) |
| | | this.dialogForm.mesmaxqty = res.canupdate_qty |
| | | this.editStepEqpArr = JSON.parse(JSON.stringify(res.stepdata)) |
| | | |
| | | if (res.stepdata.length > 0) { |
| | | res.stepdata.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } else { |
| | | const data2 = { |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | | partcode: this.dialogForm.partcode |
| | | } |
| | | const { data: res2 } = await MesOrderNewStepContent(data2) |
| | | if (res2.length > 0) { |
| | | res2.forEach(i => { |
| | | this.flag1 = res.stepdata.length !== 0 |
| | | // console.log(this.editStepEqpArr.find(i => i.step_code === '102')) |
| | | if (this.mesSetting.route) { // 按工艺路线走模式 |
| | | if (this.dialogForm.routecode) { |
| | | await this.getPartcodeChangeDialog() |
| | | |
| | | // this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | this.stepTableData = [] |
| | | res.stepdata.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.setSort() |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | | if (res.stepdata.length > 0) { |
| | | res.stepdata.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | this.sourceType = true |
| | | } else { |
| | | const data2 = { |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | | partcode: this.dialogForm.partcode |
| | | } |
| | | const { data: res2 } = await MesOrderNewStepContent(data2) |
| | | if (res2.length > 0) { |
| | | res2.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | this.sourceType = false |
| | | } |
| | | } |
| | | } else { |
| | | if (res.stepdata.length > 0) { |
| | | res.stepdata.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | this.sourceType = true |
| | | } else { |
| | | this.sourceType = false |
| | | await this.getBasicProcessData() |
| | | } |
| | | } |
| | | |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.setSort() |
| | | }) |
| | | }, |
| | | // 按工序模式走的时候 引用基础资料 工艺 |
| | | async getBasicProcessData() { |
| | | const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode }) |
| | | res.sort((a, b) => a.step_seq - b.step_seq) |
| | | this.stepTableData = [] |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | stepname: i.step_name, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | }, |
| | | // 工单关闭事件 |
| | | orderClose() { |
| | |
| | | this.dialogForm.partname = this.partArr.find(item => item.partcode === val).partname |
| | | this.dialogForm.partcode = this.partArr.find(item => item.partcode === val).partcode |
| | | this.dialogForm.partspec = this.partArr.find(item => item.partcode === val).partspec |
| | | if (this.dialogForm.wkshopcode) { |
| | | this.getMesOrderNewStepContent() |
| | | |
| | | this.dialogForm.routecode = '' |
| | | |
| | | if (this.mesSetting.route) { |
| | | this.getPartcodeChangeDialog() |
| | | } else { |
| | | this.getBasicProcessData() |
| | | } |
| | | this.getPartSearchBomDate(val) |
| | | }, |
| | | |
| | | async getPartcodeChangeDialog() { |
| | | const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode }) |
| | | this.routecodeArr = res |
| | | |
| | | // if (this.mesSetting.route) { // 按工艺路线走模式 |
| | | this.dialogForm.routecode = this.partArr.find(item => item.partcode === this.dialogForm.partcode).default_route |
| | | if (this.dialogForm.routecode && !this.sourceType) { |
| | | await this.routecodeChange() |
| | | } else { |
| | | await this.getMesOrderNewStepContent() |
| | | } |
| | | // } |
| | | // else { // 按工序走模式 |
| | | // await this.getMesOrderNewStepContent() |
| | | // } |
| | | }, |
| | | // 工艺路线值改变 |
| | | async routecodeChange() { |
| | | if (!this.flag1) { |
| | | const data = { |
| | | partcode: this.dialogForm.partcode, |
| | | routecode: this.dialogForm.routecode |
| | | } |
| | | const { data: res } = await RouteSelectStep(data) |
| | | console.log(res, 887) |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | if (res.length > 0) { |
| | | res.sort((a, b) => a.step_seq - b.step_seq) |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.code, |
| | | // stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } |
| | | |
| | | if (this.flag1 && !this.sourceType) { |
| | | const data = { |
| | | partcode: this.dialogForm.partcode, |
| | | routecode: this.dialogForm.routecode |
| | | } |
| | | const { data: res } = await RouteSelectStep(data) |
| | | console.log(res, 887) |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | if (res.length > 0) { |
| | | res.sort((a, b) => a.step_seq - b.step_seq) |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.code, |
| | | // stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } |
| | | }, |
| | | async getMesOrderNewStepContent() { |
| | | const data = { |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | | partcode: this.dialogForm.partcode |
| | | |
| | | async getMesOrderNewStepContent() { |
| | | // if (!this.mesSetting.route && this.operation === 'edit') { |
| | | // return |
| | | // } |
| | | |
| | | if (this.sourceType) { |
| | | const data = { |
| | | routecode: this.dialogForm.routecode, |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | | partcode: this.dialogForm.partcode |
| | | } |
| | | const { data: res } = await MesOrderNewStepContent(data) |
| | | // console.log(res) |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | if (res.length > 0) { |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | unprice: i.unprice, |
| | | children: i.children |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | } else { |
| | | await this.routecodeChange() |
| | | } |
| | | const { data: res } = await MesOrderNewStepContent(data) |
| | | // console.log(res) |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | if (res.length > 0) { |
| | | res.forEach(i => { |
| | | this.stepTableData.push( |
| | | { |
| | | stepcode: i.step_code, |
| | | // stepname: i.stepname, |
| | | stepprice: i.stepprice |
| | | } |
| | | ) |
| | | }) |
| | | this.stepSelectedValue = this.stepTableData.map(i => i.stepcode) |
| | | } |
| | | }, |
| | | async getPartSearchBomDate(val) { |
| | | const { data: res } = await PartSearchBomDate({ partnumber: val }) |
| | | this.BomDataArr = res |
| | | }, |
| | | |
| | | // 对话框关闭事件 |
| | |
| | | wkshopname: '', // 生产车间名称 |
| | | |
| | | deliverydate: '', // 交付时间 |
| | | data_sources: '' // 数据来源 |
| | | data_sources: '', // 数据来源 |
| | | |
| | | bomid: '' |
| | | } |
| | | |
| | | this.sourceType = false |
| | | |
| | | this.stepSelectedValue = [] |
| | | this.stepTableData = [] |
| | | this.BomDataArr = [] |
| | | this.flag1 = false |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // 对话框取消 |
| | |
| | | return this.$message.info('源单单号不能为空!') |
| | | } |
| | | |
| | | if (this.dialogForm.mesqty <= 0) { |
| | | return this.$message.info('工单数量不能等于零!') |
| | | } |
| | | |
| | | if (this.dialogForm.data_sources === 'ERP' && this.dialogForm.mesmaxqty < this.dialogForm.mesqty) { |
| | | return this.$message.info('此工单的最大修改数值为:' + this.dialogForm.mesmaxqty) |
| | | } |
| | | |
| | | const workListSub = [] |
| | | const WorkListSub = [] |
| | | this.stepTableData.forEach((i, j) => { |
| | | workListSub.push( |
| | | const children = [] |
| | | if (i.children.length > 0) { |
| | | i.children.forEach(k => { |
| | | if (k.enable === 'Y') { |
| | | children.push({ |
| | | eqpcode: k.eqp_code, |
| | | unprice: parseFloat(k.unprice) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | WorkListSub.push( |
| | | { |
| | | stepseq: j + 1, |
| | | stepcode: i.stepcode, |
| | | stepprice: i.stepprice, |
| | | unprice: i.unprice, |
| | | isbott: j === 0 ? 'Y' : 'N', |
| | | isend: j === this.stepTableData.length - 1 ? 'Y' : 'N' |
| | | isend: j === this.stepTableData.length - 1 ? 'Y' : 'N', |
| | | WorkEqpListSub: children |
| | | } |
| | | ) |
| | | }) |
| | | |
| | | if (workListSub.length === 0) { |
| | | if (WorkListSub.length === 0) { |
| | | return this.$message.info('工序不能为空!') |
| | | } |
| | | |
| | |
| | | woqty: this.dialogForm.mesqty, // 工单数量 |
| | | deliverydate: this.dialogForm.deliverydate, // 交付时间 |
| | | data_sources: this.dialogForm.data_sources, // 数据来源 |
| | | isstep: workListSub.length > 0 ? 'Y' : 'N', // |
| | | workListSub |
| | | isstep: WorkListSub.length > 0 ? 'Y' : 'N', // |
| | | difference: this.dialogForm.mesqty - this.dialogForm.mesqtyinit, // 数据差值 |
| | | routecode: this.dialogForm.routecode, |
| | | bomid: this.dialogForm.bomid, |
| | | WorkListSub |
| | | } |
| | | |
| | | this.$store.state.app.buttonIsDisabled = true |
| | |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |
| | | // this.handlePrint() |
| | | this.$message.success(this.operation === 'add' ? '添加成功!' : '派发成功!') |
| | | this.$message.success(this.operation === 'add' ? '添加成功!' : '保存成功!') |
| | | this.getMesOrderSearch() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | | this.$message.error(this.operation === 'add' ? '添加失败!' : '派发失败!') |
| | | this.$message.error(this.operation === 'add' ? '添加失败!' : '保存失败!') |
| | | } |
| | | }) |
| | | } |
| | |
| | | this.dialogVisibleSearch = false |
| | | }, |
| | | // 处理打印 |
| | | handlePrint(wo_code) { |
| | | handlePrint(wo_code, saleOrderCode) { |
| | | // const number = Math.random() * Math.random() |
| | | // this.number = number === 0 ? (10 + Math.random()) : number |
| | | // console.log(number) |
| | | |
| | | this.formApprove.saleOrderCode = this.formApprove.saleOrderCode !== '' ? this.formApprove.saleOrderCode : saleOrderCode |
| | | const data2 = { |
| | | mesordercode: wo_code || this.dialogForm.mesordercode |
| | | } |
| | | MesOrderPrintSearch(data2).then(res2 => { |
| | | if (res2.code === '200') { |
| | | const res3 = res2.data.recordset |
| | | this.dialogVisibleApprove = true |
| | | |
| | | this.tableDataPrint = res3 |
| | | const res3 = res2.data.recordset |
| | | // this.tableDataPrint = res3 |
| | | this.tableDataPrint = this.chunkArray(res3, 8) |
| | | |
| | | this.formApprove.mesordercode = res3[0].wo_code |
| | | this.formApprove.m_po = res3[0].m_po || '/' |
| | | this.formApprove.partcode = res3[0].partcode |
| | |
| | | this.formApprove.lm_date = res3[0].lm_date |
| | | |
| | | this.$nextTick(() => { |
| | | res3.forEach(i => { |
| | | this.bindQRCode(i.seq, i.stepqrcode, 'small') |
| | | this.tableDataPrint.forEach((item, index) => { |
| | | item.forEach(i => { |
| | | this.bindQRCode(i.seq, i.stepqrcode, 'small') |
| | | }) |
| | | this.bindQRCode(index, this.formApprove.mesordercode, 'big') |
| | | const div = document.getElementById('qrCode' + index) |
| | | div.scrollTop = div.scrollHeight // 滚动条位于最底部 |
| | | }) |
| | | this.bindQRCode('0', this.formApprove.mesordercode, 'big') |
| | | |
| | | const div = document.getElementById('qrCode') |
| | | // const div = document.getElementById('qrCode') |
| | | // 这么多代码只需要这一句实现我们所需要的功能,定位div滚动条位置在底部,scrollHeight计算出div的高度,再scrollTop 设置滚动条的高度为多少 |
| | | div.scrollTop = div.scrollHeight // 滚动条位于最底部 |
| | | // div.scrollTop = div.scrollHeight // 滚动条位于最底部 |
| | | // div.scrollTop = 0 // 滚动条位于最顶部 |
| | | }) |
| | | this.dialogVisibleApprove = true |
| | | } |
| | | }) |
| | | }, |
| | |
| | | // 返回按钮 |
| | | dialogVisibleBackPreview() { |
| | | this.dialogVisibleApprove = false |
| | | }, |
| | | chunkArray(array, size) { |
| | | const chunked = [] |
| | | let i = 0 |
| | | while (i < array.length) { |
| | | chunked.push(array.slice(i, i + size)) |
| | | i += size |
| | | } |
| | | return chunked |
| | | }, |
| | | // dialogVisibleConfirmPreview(param) { |
| | | // this.$refs.dialogForm.validate(valid => { |
| | |
| | | // 生成二维码 工单报表二维码 |
| | | bindQRCode(seq, text, size) { |
| | | if (size === 'big') { |
| | | console.log(text, 1) |
| | | new QRCode(this.$refs.qrCodeDiv0, { |
| | | new QRCode(this.$refs['qrCodeDiv0' + seq], { |
| | | text: text, |
| | | width: size === 'big' ? 90 : 60, |
| | | height: size === 'big' ? 90 : 60, |
| | |
| | | }, |
| | | |
| | | dialogVisibleConfirmClose() { |
| | | this.formApprove.saleOrderCode = '' |
| | | // this.dialogForm.mesordercode = '' |
| | | this.formApprove.mesordercode = '' |
| | | this.formApprove.m_po = '' |
| | |
| | | }, |
| | | // 行点击事件 |
| | | async rowClick(row, event, column) { |
| | | this.formApprove.saleOrderCode = row.saleOrderCode |
| | | this.routeCode = row.route_code ? row.route_code : '' |
| | | this.partCode = row.partcode ? row.partcode : '' |
| | | const data = { |
| | | sourceid: row.sourceid, |
| | | sourcewo: row.m_po, |
| | |
| | | }, |
| | | stepSelectedValueChange(val) { |
| | | // console.log(val, 123) |
| | | }, |
| | | getSummaries(param) { |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | const i = 9 |
| | | columns.forEach((column, index) => { |
| | | if (index === i) { |
| | | sums[index] = '总数' |
| | | return |
| | | } |
| | | const values = data.map(item => Number(item[column.property])) |
| | | if (column.property === 'plan_qty') { |
| | | sums[index] = values.reduce((prev, curr) => { |
| | | const value = Number(curr) |
| | | if (!isNaN(value)) { |
| | | return prev + curr |
| | | // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100 |
| | | } |
| | | }, 0) |
| | | |
| | | sums[index] += '' |
| | | } |
| | | }) |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | return sums |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | ::v-deep .el-dialog__body { |
| | | padding: 20px 100px !important; |
| | | } |
| | | |
| | | .sop { |
| | | ::v-deep .el-dialog__body { |
| | | padding: 50px 80px !important; |
| | | } |
| | | } |
| | | |
| | | .dialogVisibleSearch ::v-deep .el-dialog__body { |
| | |
| | | background: #f8f8fa; |
| | | } |
| | | </style> |
| | | <style> |
| | | .sortable-ghost { |
| | | opacity: .8; |
| | | color: #fff !important; |
| | | background: #42b983 !important; |
| | | } |