| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- <template>
- <el-form
- class="form-no-message"
- ref="formRef"
- :show-message="false"
- label-position="left"
- :model="{
- categoryMsg,
- ...workReport
- }"
- >
- <div class="message-box">
- <ul>
- <li> <span class="label">报工次数</span>{{ countMsg.reportNum }}</li>
- <li>
- <span class="label">累计合格品数量</span
- >{{ countMsg.standardTotalNum }}</li
- >
- <li>
- <span class="label">累计合格品重量</span
- >{{ countMsg.standardTotalWeight }}KG</li
- >
- <li>
- <span class="label">累计投料产品数量</span
- >{{ countMsg.feedProductWeight }}</li
- >
- </ul>
- <div class="right">
- <el-form-item
- label="执行人工号"
- prop="executorJobNum"
- required
- label-width="100px"
- ><personSelectRemote
- v-model="workReport.executorId"
- placeholder="请输入"
- @selfChange="
- (val, item) => (workReport.executorJobNum = item.jobNumber)
- "
- /></el-form-item>
- <el-form-item
- label="执行日期"
- required
- prop="executeTime"
- label-width="100px"
- ><el-date-picker
- v-model="workReport.executeTime"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="datetime"
- format="yyyy-MM-dd HH:mm:ss"
- placeholder="请选择"
- ></el-date-picker
- ></el-form-item>
- </div>
- </div>
- <el-card>
- <el-descriptions title="报工信息" direction="vertical" :column="7" border>
- <el-descriptions-item label="">
- <span class="label-required after" slot="label">投料数量(PCS)</span>
- <el-form-item
- label=""
- label-width="0"
- class="w100"
- prop="categoryMsg.number"
- >
- <el-input-number
- class="w100"
- :controls="false"
- v-model="categoryMsg.number"
- :min="0"
- clearable
- ></el-input-number>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="">
- <span class="label-required after" slot="label">投料重量(KG)</span>
- <el-form-item
- label=""
- label-width="0"
- class="w100"
- prop="categoryMsg.totalWeight"
- ><el-input
- readonly
- class="w100"
- :value="
- (categoryMsg.totalWeight =
- categoryMsg.number * (infoData.productUnitWeight || 1))
- "
- :min="0"
- clearable
- ></el-input>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="舟皿编号/名称" :span="2"
- ><el-input
- :value="`${boatMsg.code}/${boatMsg.name}`"
- @click.native="getCategory('8', 'boatMsg')"
- ></el-input
- ></el-descriptions-item>
- <el-descriptions-item label="舟皿数量" :span="3"
- ><el-input
- placeholder="请输入"
- v-model="boatMsg.extraField.num"
- ></el-input
- ></el-descriptions-item>
- <el-descriptions-item label="质检项" :span="2">
- <el-input
- v-model="workReport.qualityItem"
- placeholder="请输入"
- ></el-input>
- </el-descriptions-item>
- <el-descriptions-item label="质检标准" :span="3">
- <el-input
- v-model="workReport.qualityStandard"
- placeholder="请输入"
- ></el-input
- ></el-descriptions-item>
- <el-descriptions-item label="">
- <span class="label-required after" slot="label">合格品数量(PCS)</span>
- <el-form-item
- label=""
- label-width="0"
- class="w100"
- prop="productInfo.standardNum"
- ><el-input-number
- class="w100"
- :controls="false"
- v-model="workReport.productInfo.standardNum"
- :min="0"
- clearable
- ></el-input-number> </el-form-item
- ></el-descriptions-item>
- <el-descriptions-item label=""
- ><span class="label-required after" slot="label">合格品重量(KG)</span>
- <el-form-item
- label=""
- label-width="0"
- class="w100"
- prop="productInfo.standardWeight"
- ><el-input-number
- readonly
- class="w100"
- :controls="false"
- :value="
- (workReport.productInfo.standardWeight =
- workReport.productInfo.standardNum *
- (infoData.productUnitWeight || 1))
- "
- :min="0"
- clearable
- ></el-input-number> </el-form-item
- ></el-descriptions-item>
- <el-descriptions-item label="不合格品数量(PCS)">
- <el-input-number
- class="w100"
- :controls="false"
- v-model="workReport.productInfo.noStandardNum"
- :min="0"
- clearable
- ></el-input-number>
- </el-descriptions-item>
- <el-descriptions-item label="不合格品重量(KG)"
- ><el-input-number
- class="w100"
- readonly
- :controls="false"
- :value="
- (workReport.productInfo.noStandardWeight =
- workReport.productInfo.noStandardNum *
- (infoData.productUnitWeight || 1))
- "
- :min="0"
- clearable
- ></el-input-number
- ></el-descriptions-item>
- <el-descriptions-item label="副产品重量(KG)"
- ><el-input-number
- class="w100"
- :controls="false"
- v-model="workReport.productInfo.byProductWeight"
- :min="0"
- clearable
- ></el-input-number
- ></el-descriptions-item>
- <el-descriptions-item label="备注">
- <el-input v-model="workReport.remark"></el-input
- ></el-descriptions-item>
- </el-descriptions>
- <el-descriptions
- title="设备信息"
- class="mt-16"
- direction="vertical"
- :column="7"
- border
- >
- <el-descriptions-item label="设备编码">{{
- workReportDeviceList.code
- }}</el-descriptions-item>
- <el-descriptions-item label="设备名称">{{
- workReportDeviceList.name
- }}</el-descriptions-item>
- <el-descriptions-item label="规格">{{
- workReportDeviceList.specification
- }}</el-descriptions-item>
- <el-descriptions-item label="型号">{{
- workReportDeviceList.model
- }}</el-descriptions-item>
- <el-descriptions-item label="升温曲线">
- <el-input
- placeholder="请输入"
- v-model="workReportDeviceList.extraField.temperatureCurve"
- ></el-input>
- </el-descriptions-item>
- <el-descriptions-item label="设备位置">{{
- workReportDeviceList.path
- }}</el-descriptions-item>
- <el-descriptions-item label="操作"
- ><el-link @click="getEquip">更改设备</el-link></el-descriptions-item
- >
- </el-descriptions>
- </el-card>
- <equipmentDailog ref="equipmentRef" :taskId="taskInfo.id" />
- <catogaryDialog ref="catogaryDialogRef" />
- </el-form>
- </template>
- <script>
- import personSelectRemote from '@/components/CommomSelect/person-select-remote';
- import equipmentDailog from '@/components/EquipmentDailog/report-equipment';
- import { reportCount } from '@/api/produceOrder';
- import catogaryDialog from '../catogaryDialog.vue';
- import dayjs from 'dayjs';
- export default {
- components: { personSelectRemote, equipmentDailog, catogaryDialog },
- props: {
- infoData: {
- type: Object,
- default: () => ({})
- },
- taskInfo: {
- type: Object,
- default: () => ({})
- }
- },
- data () {
- return {
- categoryMsg: {
- batchNo: '',
- number: '',
- totalWeight: '',
- brandNum: '',
- sourceCategoryId: '',
- rootCategoryLevelId: '9',
- name: '',
- code: ''
- },
- workReport: {
- qualityItem: '',
- qualityStandard: '',
- executorId: '',
- executorJobNum: '',
- executeTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
- remark: '',
- productInfo: {
- byProductWeight: '',
- standardNum: '',
- standardWeight: '',
- noStandardNum: '',
- noStandardWeight: ''
- }
- },
- workReportDeviceList: {
- code: '',
- name: '',
- path: '',
- model: '',
- rootCategoryLevelId: '',
- specification: '',
- extraField: {
- temperatureCurve: ''
- }
- },
- countMsg: {},
- // 舟皿信息
- boatMsg: {
- code: '',
- name: '',
- path: '',
- model: '',
- rootCategoryLevelId: '',
- specification: '',
- extraField: {
- num: ''
- }
- }
- };
- },
- watch: {
- taskInfo: {
- immediate: true,
- handler () {
- if (this.taskInfo.code) {
- this.getReportCount();
- }
- }
- },
- infoData: {
- immediate: true,
- handler () {
- if (this.infoData.id) {
- // 设备
- this.workReportDeviceList = Object.assign(
- {},
- this.workReportDeviceList,
- {
- code: this.infoData.deviceCode,
- name: this.infoData.deviceName,
- rootCategoryLevelId: this.infoData.rootCategoryLevelId,
- path: this.infoData.path[0]?.pathName,
- model: this.infoData.model,
- sourceInstanceId: this.infoData.sourceInstanceId,
- specification: this.infoData.specification
- }
- );
- }
- }
- }
- },
- created () {
- this.workReport.executorId = this.$store.state.user.info?.userId;
- this.workReport.executorJobNum = this.$store.state.user.info?.jobNumber;
- },
- methods: {
- getCategory (id, memo) {
- this.$refs.catogaryDialogRef.open(id, this[memo], (res) => {
- this[memo].rootCategoryLevelId = res.categoryLevelId;
- this[memo].code = res.code;
- this[memo].name = res.name;
- this[memo].specification = res.specification;
- this[memo].sourceInstanceId = res.id;
- if (memo === 'moduleMsg') {
- this[memo].model = res.modelType;
- this[memo].extraField.stampingTimes = '';
- } else {
- this[memo].extraField.num = '';
- }
- });
- },
- async getReportCount () {
- const res = await reportCount({
- taskCode: this.taskInfo.code,
- workOrderId: this.infoData.id
- });
- this.countMsg = res;
- },
- getEquip () {
- this.$refs.equipmentRef.openSingle(
- [this.workReportDeviceList],
- (res) => {
- this.workReportDeviceList.code = res.code;
- this.workReportDeviceList.name = res.name;
- this.workReportDeviceList.model = res.category?.category?.modelType;
- this.workReportDeviceList.specification =
- res.category?.category?.specification;
- this.workReportDeviceList.sourceInstanceId = res.id;
- this.workReportDeviceList.rootCategoryLevelId =
- res.rootCategoryLevelId;
- this.workReportDeviceList.path = res.positionList[0]?.pathName;
- }
- );
- },
- report (fun) {
- this.$refs.formRef.validate((value) => {
- if (value) {
- if (!this.workReportDeviceList.code) {
- return this.$message.error('请选择设备');
- }
- this.$confirm('是否确定要报工?', '提示').then(() => {
- this.categoryMsg = Object.assign(this.categoryMsg, {
- brandNum: this.infoData.brandNo,
- sourceCategoryId: this.infoData.categoryId,
- name: this.infoData.productName,
- code: this.infoData.productCode
- });
- fun({
- checkState: 1,
- workReport: this.workReport,
- workReportDeviceList: [this.workReportDeviceList],
- workReportCategoryList: [this.categoryMsg]
- }).then((res) => {
- // this.$message.success('报工成功!');
- // this.getReportCount();
- });
- });
- } else {
- this.$message.error('请输入必填项!');
- }
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .form-no-message {
- :deep(.el-input-number) {
- .el-input__inner {
- text-align: left !important;
- }
- }
- }
- .message-box {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 16px;
- .label {
- margin-right: 5px;
- }
- ul {
- list-style: none;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- li {
- margin-right: 20px;
- }
- }
- .right {
- padding-top: 22px;
- display: flex;
- align-items: center;
- .el-form-item {
- margin-left: 10px;
- }
- }
- }
- </style>
|