| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="å·¥åå·(ä»»å¡å·)"> |
| | | <j-input placeholder="请è¾å
¥å·¥åå·(ä»»å¡å·)" v-model="queryParam.workOrderCode"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ç©æç¼å·"> |
| | | <j-input placeholder="请è¾å
¥ç©æç¼å·" v-model="queryParam.materialNumber"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="å·¥åç¶æ"> |
| | | <j-dict-select-tag dictCode="work_order_status" placeholder="请è¾å
¥å·¥åç¶æ" v-model="queryParam.workOrderStatus"></j-dict-select-tag> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="éåå¸äºº"> |
| | | <j-select-user-by-dep placeholder="请è¾å
¥éåå¸äºº" v-model="queryParam.republisher"></j-select-user-by-dep> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-row :gutter="{ xs: 4, sm: 8, md: 16}"> |
| | | <a-col :span="12"> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="产线"> |
| | | <j-tree-select dict="base_factory,factory_name,id" pid-field="parent_id" |
| | | v-model="queryParam.factoryId"></j-tree-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="èµ·æ¢æ¥æ"> |
| | | <a-range-picker |
| | | style="width: 100%" |
| | | @change="dateRangeChange" |
| | | :value="dateRange" |
| | | :disabledDate="disabledDate" |
| | | @openChange="onOpenChange" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <a-button type="primary" @click="productionSchedule" icon="retweet" |
| | | style="margin-left: 8px">æäº§</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <div class="table-operator"> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <div class="table-operator"> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | <a-menu-item key="1" @click="batchDel"> |
| | | <a-icon type="delete" /> |
| | | å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ |
| | | <a-icon type="down" /> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a |
| | | style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" |
| | | style="max-width:80px;font-size: 12px;font-style: italic;" /> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <span v-if="record.workOrderStatus === 'NEW'"> |
| | | <a-popconfirm title="ç¡®å®åå¸å?" @confirm="() => handlePublish(record.id)"> |
| | | <a>åå¸</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" /> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED'"> |
| | | <a @click="handleRePublish(record)">éåå¸</a> |
| | | <a-divider type="vertical" /> |
| | | </span> |
| | | <span> |
| | | <a-dropdown v-if="record.workOrderStatus === 'NEW'"> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | <span v-if="record.workOrderStatus !== 'NEW'"> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </span> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <mes-production-work-order-modal ref="modalForm" @ok="modalFormOk"></mes-production-work-order-modal> |
| | | </a-card> |
| | | <mes-production-work-order-list-modal ref="modal" @ok="modalFormOk"></mes-production-work-order-list-modal> |
| | | <mes-production-work-order-modal ref="modalForm"></mes-production-work-order-modal> |
| | | <mes-production-work-order-republish-modal ref="republishModal" @ok="modalFormOk"></mes-production-work-order-republish-modal> |
| | | </a-card> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-card> |
| | | <MesProductionWeekCalendar |
| | | ref="weekCalendar" |
| | | :start-date="calendarStartDate" |
| | | @select="onDateSelect" |
| | | @change="onCalendarChange" |
| | | > |
| | | <!-- ä½¿ç¨ææ§½èªå®ä¹æ¥æåå
æ ¼å
容 --> |
| | | <template #dateCell="{ date, isSelected, isToday }"> |
| | | <div class="custom-date-content"> |
| | | <!-- 示ä¾ï¼å¨æ¥æåå
æ ¼ä¸æ¾ç¤ºå·¥åä¿¡æ¯ --> |
| | | <div |
| | | v-for="workOrder in getWorkOrdersForDate(date)" |
| | | :key="workOrder.id" |
| | | class="work-order-item" |
| | | :class="{ 'urgent': isUrgent(workOrder) }" |
| | | > |
| | | <span class="work-order-shift">{{ workOrder.groupName }}</span> |
| | | <span class="work-order-material">{{ workOrder.materialName }}</span> |
| | | <span class="work-order-quantity">{{ workOrder.planQuantity }}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </MesProductionWeekCalendar> |
| | | </a-card> |
| | | </a-col> |
| | | </a-row> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import MesProductionWorkOrderModal from './modules/MesProductionWorkOrderModal' |
| | | import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import MesProductionWorkOrderModal from './modules/MesProductionWorkOrderModal' |
| | | import MesProductionWeekCalendar from '@views/mes/modules/MesProductionWeekCalendar.vue' |
| | | import MesProductionWorkOrderListModal from '@views/mes/modules/MesProductionWorkOrderListModal.vue' |
| | | import MesProductionWorkOrderRepublishModal from '@views/mes/modules/MesProductionWorkOrderRepublishModal.vue' |
| | | import { filterMultiDictText } from '@/components/dict/JDictSelectUtil' |
| | | import moment from 'moment' |
| | | import { getAction, postAction, requestPut } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'MesProductionWorkOrderList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | MesProductionWorkOrderModal |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'æäº§å·¥å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'å·¥åå·(ä»»å¡å·)', |
| | | align:"center", |
| | | dataIndex: 'workOrderCode' |
| | | }, |
| | | { |
| | | title:'ç©æç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'materialNumber' |
| | | }, |
| | | { |
| | | title:'ç©æåç§°', |
| | | align:"center", |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title:'计åç产æ°é', |
| | | align:"center", |
| | | dataIndex: 'planQuantity' |
| | | }, |
| | | { |
| | | title:'产线(åä½)', |
| | | align:"center", |
| | | dataIndex: 'factoryId_dictText' |
| | | }, |
| | | { |
| | | title:'çç»', |
| | | align:"center", |
| | | dataIndex: 'groupId_dictText' |
| | | }, |
| | | { |
| | | title:'çæ¬¡(åä½)', |
| | | align:"center", |
| | | dataIndex: 'shiftId_dictText' |
| | | }, |
| | | { |
| | | title:'æäº§æ¥æ', |
| | | align:"center", |
| | | dataIndex: 'workOrderDate' |
| | | }, |
| | | { |
| | | title:'å·¥åç¶æ', |
| | | align:"center", |
| | | dataIndex: 'workOrderStatus_dictText' |
| | | }, |
| | | { |
| | | title:'å®é
æ¥å·¥æ°é', |
| | | align:"center", |
| | | dataIndex: 'actualQuantity' |
| | | }, |
| | | { |
| | | title:'åå¸äºº', |
| | | align:"center", |
| | | dataIndex: 'publisher' |
| | | }, |
| | | { |
| | | title:'å叿¶é´', |
| | | align:"center", |
| | | dataIndex: 'publishTime' |
| | | }, |
| | | { |
| | | title:'éåå¸äºº', |
| | | align:"center", |
| | | dataIndex: 'republisher' |
| | | }, |
| | | { |
| | | title:'éå叿¶é´', |
| | | align:"center", |
| | | dataIndex: 'republishTime' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | export default { |
| | | name: 'MesProductionWorkOrderList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | MesProductionWorkOrderModal, |
| | | MesProductionWeekCalendar, |
| | | MesProductionWorkOrderListModal, |
| | | MesProductionWorkOrderRepublishModal |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'æäº§å·¥å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/mesproductionworkorder/mesProductionWorkOrder/list", |
| | | delete: "/mesproductionworkorder/mesProductionWorkOrder/delete", |
| | | deleteBatch: "/mesproductionworkorder/mesProductionWorkOrder/deleteBatch", |
| | | exportXlsUrl: "/mesproductionworkorder/mesProductionWorkOrder/exportXls", |
| | | importExcelUrl: "mesproductionworkorder/mesProductionWorkOrder/importExcel", |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | { |
| | | title: 'å·¥åå·(ä»»å¡å·)', |
| | | align: 'center', |
| | | dataIndex: 'workOrderCode' |
| | | }, |
| | | { |
| | | title: 'ç©æç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'materialNumber' |
| | | }, |
| | | { |
| | | title: 'ç©æåç§°', |
| | | align: 'center', |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title: '计åç产æ°é', |
| | | align: 'center', |
| | | dataIndex: 'planQuantity' |
| | | }, |
| | | { |
| | | title: '产线', |
| | | align: 'center', |
| | | dataIndex: 'factoryId_dictText' |
| | | }, |
| | | { |
| | | title: 'çç»', |
| | | align: 'center', |
| | | dataIndex: 'groupId_dictText' |
| | | }, |
| | | { |
| | | title: 'çæ¬¡', |
| | | align: 'center', |
| | | dataIndex: 'shiftId_dictText' |
| | | }, |
| | | { |
| | | title: 'æäº§æ¥æ', |
| | | align: 'center', |
| | | dataIndex: 'workOrderDate' |
| | | }, |
| | | { |
| | | title: 'å·¥åç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'workOrderStatus_dictText' |
| | | }, |
| | | { |
| | | title: 'å®é
æ¥å·¥æ°é', |
| | | align: 'center', |
| | | dataIndex: 'actualQuantity' |
| | | }, |
| | | { |
| | | title: 'åå¸äºº', |
| | | align: 'center', |
| | | dataIndex: 'publisher' |
| | | }, |
| | | { |
| | | title: 'å叿¶é´', |
| | | align: 'center', |
| | | dataIndex: 'publishTime' |
| | | }, |
| | | { |
| | | title: 'éåå¸äºº', |
| | | align: 'center', |
| | | dataIndex: 'republisher' |
| | | }, |
| | | { |
| | | title: 'éå叿¶é´', |
| | | align: 'center', |
| | | dataIndex: 'republishTime' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/mesproductionworkorder/mesProductionWorkOrder/list', |
| | | delete: '/mesproductionworkorder/mesProductionWorkOrder/delete', |
| | | deleteBatch: '/mesproductionworkorder/mesProductionWorkOrder/deleteBatch', |
| | | exportXlsUrl: '/mesproductionworkorder/mesProductionWorkOrder/exportXls', |
| | | importExcelUrl: 'mesproductionworkorder/mesProductionWorkOrder/importExcel', |
| | | listProductionLinesOption: '/base/factory/queryIdTree', |
| | | schedule: '/mesproductionworkorder/mesProductionWorkOrder/schedule', |
| | | publish: '/mesproductionworkorder/mesProductionWorkOrder/publish' |
| | | }, |
| | | dictOptions: {}, |
| | | superFieldList: [], |
| | | // ç¨äºæ¼ç¤ºçå·¥åæ°æ® |
| | | workOrdersByDate: {}, |
| | | // æ¥åèµ·å§æ¥æ |
| | | calendarStartDate: moment(), |
| | | productionLineData: [], |
| | | dateRange: [], |
| | | tempStartDate: null, // 临æ¶åå¨å¼å§æ¥æ |
| | | hoveredDate: null, // åå¨é¼ æ æ¬åçæ¥æ |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList() |
| | | this.initDictConfig() |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | modalFormOk() { |
| | | this.onClearSelected() |
| | | this.loadData(1).then(() => { |
| | | if (this.queryParam.factoryId) { |
| | | // åæ¶æ´æ°æ¥åä¸çå·¥åæ°æ® |
| | | this.updateCalendarWorkOrders() |
| | | } |
| | | }).catch(error => { |
| | | console.error('æ°æ®å 载失败:', error) |
| | | }) |
| | | }, |
| | | loadData(arg) { |
| | | return new Promise((resolve, reject) => { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list屿§!") |
| | | reject(new Error("请设置url.list屿§!")) |
| | | return |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//æ¥è¯¢æ¡ä»¶ |
| | | console.log('params', params) |
| | | if (!params) { |
| | | reject(new Error("æ¥è¯¢åæ°æ æ")) |
| | | return false; |
| | | } |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | // console.log(res) |
| | | //update-begin---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | resolve(res) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | reject(new Error(res.message)) |
| | | } |
| | | }).catch(error => { |
| | | reject(error) |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }) |
| | | }, |
| | | searchQuery() { |
| | | this.queryParam = Object.assign(this.queryParam, this.dateRange) |
| | | this.loadData(1).then(() => { |
| | | if (this.queryParam.factoryId) { |
| | | // åæ¶æ´æ°æ¥åä¸çå·¥åæ°æ® |
| | | this.updateCalendarWorkOrders() |
| | | } |
| | | }).catch(error => { |
| | | console.error('æ°æ®å 载失败:', error) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.dateRange = [] |
| | | this.workOrdersByDate = {} |
| | | this.loadData(1); |
| | | }, |
| | | handlePublish(id) { |
| | | requestPut(this.url.publish, null, { ids: id }).then(res => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | this.loadData(1).then(() => { |
| | | if (this.queryParam.factoryId) { |
| | | // åæ¶æ´æ°æ¥åä¸çå·¥åæ°æ® |
| | | this.updateCalendarWorkOrders() |
| | | } |
| | | }).catch(error => { |
| | | console.error('æ°æ®å 载失败:', error) |
| | | }) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | handleRePublish(record) { |
| | | this.$refs.republishModal.add(record) |
| | | }, |
| | | initDictConfig() { |
| | | getAction(this.url.listProductionLinesOption, null).then(res => { |
| | | if (res.success) { |
| | | this.productionLineData = res.result |
| | | } |
| | | }) |
| | | }, |
| | | getSuperFieldList() { |
| | | let fieldList = [] |
| | | fieldList.push({ type: 'int', value: 'delFlag', text: 'å 餿 è®°', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'workOrderCode', text: 'å·¥åå·(ä»»å¡å·)', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'materialNumber', text: 'ç©æç¼ç ', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'materialName', text: 'ç©æåç§°', dictCode: '' }) |
| | | fieldList.push({ type: 'double', value: 'planQuantity', text: '计åç产æ°é', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'factoryId', text: '产线ID(åä½)', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'groupId', text: 'çç»ID', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'shiftId', text: 'çæ¬¡ID(åä½)', dictCode: '' }) |
| | | fieldList.push({ type: 'datetime', value: 'workOrderDate', text: 'æäº§æ¥æ' }) |
| | | fieldList.push({ type: 'string', value: 'workOrderStatus', text: 'å·¥åç¶æ', dictCode: 'work_order_status' }) |
| | | fieldList.push({ type: 'double', value: 'actualQuantity', text: 'å®é
æ¥å·¥æ°é', dictCode: '' }) |
| | | fieldList.push({ type: 'string', value: 'publisher', text: 'åå¸äºº', dictCode: '' }) |
| | | fieldList.push({ type: 'datetime', value: 'publishTime', text: 'å叿¶é´' }) |
| | | fieldList.push({ type: 'string', value: 'republisher', text: 'éåå¸äºº', dictCode: '' }) |
| | | fieldList.push({ type: 'datetime', value: 'republishTime', text: 'éå叿¶é´' }) |
| | | this.superFieldList = fieldList |
| | | }, |
| | | productionSchedule() { |
| | | if (!this.queryParam.factoryId || this.dateRange.length === 0) { |
| | | this.$message.warning('è¯·éæ©äº§çº¿åæäº§æ¥æèå´ï¼') |
| | | return |
| | | } |
| | | getAction(this.url.schedule, { |
| | | factoryId: this.queryParam.factoryId, |
| | | startDate: this.dateRange[0].format('YYYY-MM-DD'), |
| | | endDate: this.dateRange[1].format('YYYY-MM-DD') |
| | | }).then(res => { |
| | | if (res.success) { |
| | | this.$refs.modal.edit(res.result, this.dateRange) |
| | | } |
| | | }) |
| | | }, |
| | | onOpenChange(open) { |
| | | if (!open) { |
| | | // å
³é鿩卿¶éç½®ç¶æ |
| | | this.tempStartDate = null |
| | | this.hoveredDate = null |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'int',value:'delFlag',text:'å 餿 è®°',dictCode:''}) |
| | | fieldList.push({type:'string',value:'workOrderCode',text:'å·¥åå·(ä»»å¡å·)',dictCode:''}) |
| | | fieldList.push({type:'string',value:'materialNumber',text:'ç©æç¼ç ',dictCode:''}) |
| | | fieldList.push({type:'string',value:'materialName',text:'ç©æåç§°',dictCode:''}) |
| | | fieldList.push({type:'double',value:'planQuantity',text:'计åç产æ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'factoryId',text:'产线ID(åä½)',dictCode:''}) |
| | | fieldList.push({type:'string',value:'groupId',text:'çç»ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'shiftId',text:'çæ¬¡ID(åä½)',dictCode:''}) |
| | | fieldList.push({type:'datetime',value:'workOrderDate',text:'æäº§æ¥æ'}) |
| | | fieldList.push({type:'string',value:'workOrderStatus',text:'å·¥åç¶æ',dictCode:'work_order_status'}) |
| | | fieldList.push({type:'double',value:'actualQuantity',text:'å®é
æ¥å·¥æ°é',dictCode:''}) |
| | | fieldList.push({type:'string',value:'publisher',text:'åå¸äºº',dictCode:''}) |
| | | fieldList.push({type:'datetime',value:'publishTime',text:'å叿¶é´'}) |
| | | fieldList.push({type:'string',value:'republisher',text:'éåå¸äºº',dictCode:''}) |
| | | fieldList.push({type:'datetime',value:'republishTime',text:'éå叿¶é´'}) |
| | | this.superFieldList = fieldList |
| | | disabledDate(current) { |
| | | // 妿æä¸´æ¶å¼å§æ¥æï¼åéå¶ç»ææ¥æèå´ |
| | | if (this.tempStartDate) { |
| | | const startDate = this.tempStartDate.clone().startOf('day') |
| | | const maxDate = startDate.clone().add(6, 'days').endOf('day') // 7天å
æ¬èµ·å§æ¥ |
| | | const minDate = startDate.clone().subtract(6, 'days').startOf('day') // ä¹å¯ä»¥ååé6天 |
| | | // ç¦ç¨è¶
åº7天èå´çæ¥æ |
| | | return current && (current < minDate || current > maxDate) |
| | | } |
| | | // é»è®¤ä¸ç¦ç¨ |
| | | return false |
| | | }, |
| | | dateRangeChange(dates, dateStrings) { |
| | | this.dateRange = dates |
| | | if (dates && dates.length > 0) { |
| | | if (dates.length === 1) { |
| | | // éæ©äºå¼å§æ¥æï¼ä¿åå°ä¸´æ¶åé |
| | | this.tempStartDate = dates[0] |
| | | this.hoveredDate = dates[0] |
| | | } else if (dates.length === 2) { |
| | | // éæ©äºç»ææ¥æï¼éªè¯èå´ |
| | | const startDate = dates[0] |
| | | const endDate = dates[1] |
| | | const diffDays = endDate.diff(startDate, 'days') + 1 |
| | | |
| | | if (diffDays > 7) { |
| | | this.$message.warning('æ¥æèå´ä¸è½è¶
è¿7天') |
| | | // èªå¨è°æ´ä¸º7天èå´ |
| | | const adjustedEndDate = startDate.clone().add(6, 'days') |
| | | this.dateRange = [startDate, adjustedEndDate] |
| | | this.queryParam.startDate = startDate.format('YYYY-MM-DD') |
| | | this.queryParam.endDate = adjustedEndDate.format('YYYY-MM-DD') |
| | | } else { |
| | | this.queryParam.startDate = dateStrings[0] |
| | | this.queryParam.endDate = dateStrings[1] |
| | | } |
| | | // é置临æ¶ç¶æ |
| | | this.tempStartDate = null |
| | | this.hoveredDate = null |
| | | } |
| | | } else { |
| | | // æ¸
é¤äºéæ© |
| | | this.queryParam.startDate = null |
| | | this.queryParam.endDate = null |
| | | this.tempStartDate = null |
| | | this.hoveredDate = null |
| | | } |
| | | }, |
| | | // å¤çæ¥æéæ©äºä»¶ |
| | | onDateSelect(date) { |
| | | console.log('Selected date:', date.format('YYYY-MM-DD')) |
| | | }, |
| | | // å¤çæ¥åå¨ååäºä»¶ |
| | | onCalendarChange(date) { |
| | | console.log('Calendar week changed:', date.format('YYYY-MM-DD')) |
| | | }, |
| | | // æ´æ°æ¥åä¸çå·¥åæ°æ® |
| | | updateCalendarWorkOrders() { |
| | | // å°å½åè¡¨æ ¼æ°æ®ææ¥æåç»æ¾ç¤ºå¨æ¥åä¸ |
| | | const workOrdersByDate = {} |
| | | this.dataSource.filter(workOrder => workOrder.workOrderStatus !== 'NEW').forEach(workOrder => { |
| | | const workOrderDate = workOrder.workOrderDate |
| | | if (workOrderDate) { |
| | | if (!workOrdersByDate[workOrderDate]) { |
| | | workOrdersByDate[workOrderDate] = [] |
| | | } |
| | | workOrdersByDate[workOrderDate].push({ |
| | | id: workOrder.id, |
| | | groupName: workOrder.groupId_dictText || '', |
| | | materialName: workOrder.materialName || '', |
| | | planQuantity: workOrder.planQuantity || 0 |
| | | }) |
| | | } |
| | | }) |
| | | this.workOrdersByDate = workOrdersByDate |
| | | }, |
| | | // è·åæå®æ¥æçå·¥å |
| | | getWorkOrdersForDate(date) { |
| | | const dateStr = date.format('YYYY-MM-DD') |
| | | console.log(dateStr) |
| | | return this.workOrdersByDate[dateStr] || [] |
| | | }, |
| | | // 夿工忝å¦ç´§æ¥ |
| | | isUrgent(workOrder) { |
| | | return workOrder.status === 'urgent' |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | @import '~@assets/less/common.less'; |
| | | |
| | | .work-order-item { |
| | | font-size: 12px; |
| | | padding: 2px 4px; |
| | | margin-bottom: 2px; |
| | | background-color: #f0f0f0; |
| | | border-radius: 2px; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .work-order-item.urgent { |
| | | background-color: #ffccc7; |
| | | border-left: 2px solid #ff4d4f; |
| | | } |
| | | |
| | | .work-order-shift { |
| | | font-weight: bold; |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .work-order-material { |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | .work-order-quantity { |
| | | float: right; |
| | | } |
| | | </style> |