From 8202686b06680db9b82d4a99a31dc7f9dca4ee86 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 09 四月 2024 08:20:09 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue | 526 ++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 386 insertions(+), 140 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
index 449c726..3c8ba1d 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -12,54 +12,45 @@
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
+import {changeFilterEvent, filterChanged} from "@/hook"
+import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove";
+import { useI18n } from 'vue-i18n'
+//璇█鑾峰彇
+const { t } = useI18n()
+
let router = useRouter()
const userStore = useUserInfoStore()
const username = userStore.user.userName
-const getTableRow = (row,type) =>{
+const getTableRow = (row, type) => {
switch (type) {
- case 'edit' :{
+ case 'edit' : {
//alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
- router.push({path: '/main/processCard/PrintFlowCard', query: { id: row.id }})
+ router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}})
break
}
- case 'delete':{
- alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
- break
- }
- case 'setType':{
+
+ case 'setType': {
alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鎺掔増鐘舵��')
break
}
}
}
+
//宸ュ簭
-const value = ref('')
-const options = [
- {
- value: '鍒囧壊',
- label: '鍒囧壊',
- },
- {
- value: '纾ㄨ竟',
- label: '纾ㄨ竟',
- },
- {
- value: '閽㈠寲',
- label: '閽㈠寲',
- },
-]
+const value = ref('鍒囧壊')
+
//鎺掍骇鐘舵��
const stateValue = ref('1')
const stateOptions = [
{
value: '2',
- label: '宸叉帓浜�',
+ label: t('processCard.ProductionSchedulingOk'),
},
{
value: '1',
- label: '鏈帓浜�',
+ label: t('processCard.ProductionSchedulingNo'),
},
]
@@ -70,9 +61,13 @@
//瀹氫箟琛ㄥ崟鍊�
const form = reactive({
date1: '',
- orderId:''
+ orderId: ''
})
+//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
+const titleSelectJson = ref({
+ processType: [],
+})
//琛ㄥ熬姹傚拰
@@ -118,30 +113,46 @@
//鑾峰彇涓冨ぉ鍓嶅埌褰撳墠鏃堕棿
function getNowTime() {
- const start = new Date(new Date().getTime()- 3600 * 1000 * 24 * 7)
+ const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3)
.toISOString()
.replace('T', ' ')
- .slice(0,10) //榛樿寮�濮嬫椂闂�7澶╁墠
- const end = new Date(new Date().getTime()+3600 * 1000 * 24)
+ .slice(0, 10) //榛樿寮�濮嬫椂闂�3澶╁墠
+ const end = new Date(new Date().getTime() + 3600 * 1000 * 24)
.toISOString()
.replace('T', ' ')
- .slice(0,10)//榛樿缁撴潫鏃堕棿褰撳墠鏃堕棿
+ .slice(0, 10)//榛樿缁撴潫鏃堕棿褰撳墠鏃堕棿
return [start, end]
}
-//绗竴娆″姞杞借幏鍙栬繎涓冨ぉ鏃堕棿鍜岄粯璁ょ姸鎬�
-form.date1=getNowTime()
+onMounted(()=>{
+ //鍚敤琛ㄦ牸鎷栧姩閫変腑
+ addListener(xGrid.value,gridOptions)
+})
+
+//绗竴娆″姞杞借幏鍙栬繎3澶╂椂闂村拰榛樿鐘舵��
+form.date1 = getNowTime()
let startTime = form.date1[0]
let endTime = form.date1[1]
+let selectProcesses = value.value
+let inputVal = form.orderId
+if (inputVal == '') {
+ inputVal = null
+}
+if (selectProcesses == '') {
+ selectProcesses = null
+}
//绗竴娆″姞杞芥暟鎹�
-
-request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
+request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
if (res.code == 200) {
pageTotal.value = res.data.total
produceList = produceList.value.concat(deepClone(res.data.data))
+ titleSelectJson.value.processType = res.data.process
xGrid.value.reloadData(produceList)
gridOptions.loading = false
+ //绂佺敤鍒犻櫎銆佷繚瀛樻寜閽�
+ gridOptions.toolbarConfig.buttons[0].disabled = true
+ gridOptions.toolbarConfig.buttons[1].disabled = true
} else {
ElMessage.warning(res.msg)
}
@@ -149,60 +160,78 @@
//鐐瑰嚮鏃舵煡璇�
const getWorkOrder = () => {
- let selectProcesses=value.value
+ let startTime = form.date1[0]
+ let endTime = form.date1[1]
+ let selectProcesses = value.value
let selectState = stateValue.value
- let inputVal=form.orderId
- if (inputVal== ''){
- inputVal=null
+ let inputVal = form.orderId
+ if (inputVal == '') {
+ inputVal = null
}
- if (selectProcesses== ''){
- selectProcesses=null
+ if (selectProcesses == '') {
+ selectProcesses = null
}
- if (inputVal== null && selectState==1){
+ if (inputVal == null && selectState == 1) {
//鏍规嵁鏃堕棿鏌ヨ鏈帓浜ф暟鎹�
- request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}`, filterData.value).then((res) => {
+ request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => {
if (res.code == 200) {
pageTotal.value = res.data.total
xGrid.value.loadData(res.data.data)
gridOptions.loading = false
+ //绂佺敤鍒犻櫎銆佸鏍告寜閽�
+ gridOptions.toolbarConfig.buttons[0].disabled = true
+ gridOptions.toolbarConfig.buttons[1].disabled = true
+ //鍚敤淇濆瓨
+ gridOptions.toolbarConfig.buttons[2].disabled = false
} else {
ElMessage.warning(res.msg)
}
})
- }
- else if(inputVal!=null && selectState==1){
- //鏍规嵁璁㈠崟鍙锋煡璇㈡湭鎺掍骇鏁版嵁
+ } else if (inputVal != null && selectState == 1) {
+ //鏍规嵁宸ュ簭鏌ヨ鏈帓浜ф暟鎹�
request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
if (res.code == 200) {
pageTotal.value = res.data.total
xGrid.value.loadData(res.data.data)
gridOptions.loading = false
+ //绂佺敤鍒犻櫎銆佸鏍告寜閽�
+ gridOptions.toolbarConfig.buttons[0].disabled = true
+ gridOptions.toolbarConfig.buttons[1].disabled = true
+ //鍚敤淇濆瓨
+ gridOptions.toolbarConfig.buttons[2].disabled = false
} else {
ElMessage.warning(res.msg)
}
})
- }
- else if(inputVal== null && selectState==2){
+ } else if (inputVal == null && selectState == 2) {
//鏍规嵁鏃堕棿鏌ヨ宸叉帓浜ф暟鎹�
request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
if (res.code == 200) {
pageTotal.value = res.data.total
xGrid.value.loadData(res.data.data)
gridOptions.loading = false
+ //鍚敤鍒犻櫎銆佸鏍告寜閽�
+ gridOptions.toolbarConfig.buttons[0].disabled = false
+ gridOptions.toolbarConfig.buttons[1].disabled = false
+ //绂佺敤淇濆瓨
+ gridOptions.toolbarConfig.buttons[2].disabled = true
} else {
ElMessage.warning(res.msg)
}
})
- }
-
- else if(inputVal!= null && selectState==2){
+ } else if (inputVal != null && selectState == 2) {
//鏍规嵁璁㈠崟鍙锋煡璇㈠凡鎺掍骇鏁版嵁
request.post(`/productionScheduling/selectSchedulingNot/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
if (res.code == 200) {
pageTotal.value = res.data.total
xGrid.value.loadData(res.data.data)
gridOptions.loading = false
+ //鍚敤鍒犻櫎銆佸鏍告寜閽�
+ gridOptions.toolbarConfig.buttons[0].disabled = false
+ gridOptions.toolbarConfig.buttons[1].disabled = false
+ //绂佺敤淇濆瓨
+ gridOptions.toolbarConfig.buttons[2].disabled = true
} else {
ElMessage.warning(res.msg)
}
@@ -210,74 +239,157 @@
}
+}
-
+/*鍚庣杩斿洖缁撴灉澶氬眰宓屽灞曠ず*/
+const hasDecimal = (value) => {
+ const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+ return regex.test(value); // 杩斿洖true/false
}
//瀛愮粍浠舵帴鏀跺弬鏁�
const xGrid = ref()
const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
+ border: "full",//琛ㄦ牸鍔犺竟妗�
keepSource: true,//淇濇寔婧愭暟鎹�
align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ stripe: true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true, height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
id: 'CustomerList',
showFooter: true,//鏄剧ず鑴�
printConfig: {},
importConfig: {},
exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
+ scrollY: {enabled: true},//寮�鍚櫄鎷熸粴鍔�
+ showOverflow: true,
columnConfig: {
resizable: true,
useKey: true
},
filterConfig: { //绛涢�夐厤缃」
- remote: true
+ // remote: true
},
customConfig: {
storage: true
},
- editConfig: {
+
+ editConfig: {
trigger: 'click',
mode: 'row',
showStatus: true
- },//琛ㄥご鍙傛暟
- columns:[
- {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
- { type: 'checkbox',fixed:"left", title: '閫夋嫨', width: 80 },
- { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
- {field: 'scheduled_start_time' , width: 120,editRender: { name: 'input', attrs: { placeholder: '',type:'date' } }, title: '璁″垝寮�濮嬫椂闂�'},
- {field: 'plan_end_time' , width: 120,editRender: { name: 'input', attrs: { placeholder: '',type:'date' } }, title: '璁″垝缁撴潫鏃堕棿'},
+ },
+ menuConfig: {
+ body: {
+ options: [
+ [
+ { code: 'copyChecked', name: t('basicData.selectSame'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false },
+ { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
+ { code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false },
+ ]
+ ]
+ }
+ },
+ //琛ㄥご鍙傛暟
+ columns: [
+ {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
+ {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
+ {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
+ {
+ field: 'scheduled_start_time',
+ width: 120,
+ editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
+ title: t('processCard.scheduledStartTime')
+ },
+ {
+ field: 'plan_end_time',
+ width: 120,
+ editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
+ title: t('processCard.planEndTime')
+ },
// {field: '鎺掍骇缂栧彿', title: '鎺掍骇缂栧彿', width: 120 },
- {field: 'order_id', title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 100 },
- {field: 'customer_name', title: '瀹㈡埛鍚嶇О', width: 110,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
- {field: 'project', title: '椤圭洰鍚嶇О', width: 100,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
- {field: 'order_number', title: '搴忓彿', filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 70},
-
- {field: 'width', title: '瀹�', width: 60},
- {field: 'height', title: '楂�', width: 60},
- {field: 'quantity', title: '璁㈠崟鏁伴噺', width: 70},
- {field: 'area', title: '璁㈠崟闈㈢Н', width: 90},
- {field: 'scheduling_quantity' , width: 120,editRender: { name: 'input', attrs: { placeholder: '' } }, title: '鎺掍骇鏁伴噺', sortable: true},
- {field: 'pendingProductionQuantity', title: '寰呮帓浜ф暟閲�', width: 120},
- {field: 'pendingProductionArea', title: '寰呮帓浜ч潰绉�', width: 120},
- {field: 'productionScheduledQuantity', title: '宸叉帓浜ф暟閲�', width: 120},
- {field: 'productionScheduledArea', title: '宸叉帓浜ч潰绉�', width: 120},
- {field: 'review_status', title: '瀹℃牳鐘舵��', width: 140},
- {field: 'reviewer', title: '瀹℃牳浜�', width: 140},
- {field: 'product_name', title: '浜у搧鍚嶇О', width: 140},
- {field: 'shape', title: '褰㈢姸', width: 80},
- {field: 'notes', title: '澶囨敞', editRender: { name: 'input', attrs: { placeholder: '' } }, width: 120},
+ {
+ field: 'order_id',
+ title: t('order.orderId'),
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ width: 100,
+ filterMethod: filterChanged
+ },
+ {
+ field: 'customer_name',
+ title: t('processCard.customerName'),
+ width: 110,
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'project',
+ title: t('order.project'),
+ width: 100,
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'order_number',
+ title: t('order.OrderNum'),
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ width: 70,
+ filterMethod: filterChanged
+ },
+ {
+ field: 'technology_number',
+ title: t('processCard.technologyNumber'),
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ width: 70,
+ filterMethod: filterChanged
+ },
+ {
+ field: 'child_width',
+ title: t('order.width'),
+ width: 60,
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'child_height',
+ title: t('order.height'),
+ width: 60,
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {field: 'quantity', title: t('processCard.orderQuantity'), width: 70},
+ {field: 'area', title: t('processCard.orderArea'), width: 90},
+ {
+ field: 'scheduling_quantity',
+ width: 120,
+ editRender: {name: 'input', attrs: {placeholder: ''}},
+ title: t('processCard.productionSchedulingQuantity'),
+ sortable: true
+ },
+ {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 120},
+ {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 120},
+ {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 120},
+ {field: 'productionScheduledArea', title: t('processCard.plannedProductionArea'), width: 120},
+ {field: 'review_status', title: t('processCard.reviewedState'), width: 140},
+ {field: 'reviewer', title: t('processCard.reviewed'), width: 140},
+ {field: 'glass_child', title: t('order.product'), width: 140},
+ {field: 'shape', title: t('order.shape'), width: 80},
+ {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
+ {field: 'scheduling_id', title: t('processCard.schedulingId'), width: 120},
],//琛ㄥご鎸夐挳
toolbarConfig: {
buttons: [
- {code: 'delete', name: '鍒犻櫎',status:'primary' },
- {code: 'review', name: '瀹℃牳',status:'primary' },
- {code: 'save', name: '鎺掍骇',status:'primary' ,icon:'vxe-icon-save'},
+ {code: 'delete', name: t('basicData.delete'), status: 'primary'},
+ {code: 'review', name: t('basicData.review'), status: 'primary'},
+ {code: 'save', name: t('processCard.scheduling'), status: 'primary', icon: 'vxe-icon-save'},
],
import: false,
// export: true,
@@ -285,30 +397,28 @@
zoom: true,
custom: true
},
- data: [
-
- ],//table body瀹為檯鏁版嵁
+ data: [],//table body瀹為檯鏁版嵁
//鑴氶儴姹傚拰
- footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
- let footList=['鏁伴噺','闈㈢Н','鎺掍骇鏁伴噺','宸叉帓浜ф暟閲�','宸叉帓浜ч潰绉�','鏈帓浜ф暟閲�','鏈帓浜ч潰绉�']
- return[
- columns.map((column, columnIndex) => {
- if (columnIndex === 0) {
- return '鍚堣:'
- }
- if (footList.includes(column.field)) {
- return sumNum(data, column.field)
- }
- return ''
- })
- ]
- }
+ // footerMethod({columns, data}) {//椤佃剼鍑芥暟
+ // let footList = ['鏁伴噺', '闈㈢Н', '鎺掍骇鏁伴噺', '宸叉帓浜ф暟閲�', '宸叉帓浜ч潰绉�', '鏈帓浜ф暟閲�', '鏈帓浜ч潰绉�']
+ // return [
+ // columns.map((column, columnIndex) => {
+ // if (columnIndex === 0) {
+ // return '鍚堣:'
+ // }
+ // if (footList.includes(column.field)) {
+ // return sumNum(data, column.field)
+ // }
+ // return ''
+ // })
+ // ]
+ // }
})
-
+//琛ㄦ牸鎸夐挳
const gridEvents = {
- toolbarButtonClick({code}) {
+ async toolbarButtonClick({code}) {
const $grid = xGrid.value
if ($grid) {
switch (code) {
@@ -316,40 +426,48 @@
const $table = xGrid.value
if ($table) {
const selectRecords = $table.getCheckboxRecords()
- if (selectRecords.length==0){
- ElMessage.success("璇峰嬀閫夋帓浜ф暟鎹�")
+ if (selectRecords.length == 0) {
+ ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
return;
}
- for (let i = 0; i < selectRecords.length; i++){
- let start= selectRecords[i].scheduled_start_time
- let end= selectRecords[i].plan_end_time
- let number=selectRecords[i].scheduling_quantity
+ for (let i = 0; i < selectRecords.length; i++) {
+ let start = selectRecords[i].scheduled_start_time
+ let end = selectRecords[i].plan_end_time
+ let number = selectRecords[i].scheduling_quantity
//璁″垝寮�濮嬨�佺粨鏉熸椂闂达紝鎺掍骇鏁伴噺涓嶈兘涓虹┖
- if (start==null || end==null || number==null){
- ElMessage.success("璇峰~鍏ュ搴旂殑鍊煎啀杩涜淇濆瓨")
+ if (start == null || end == null || number == null) {
+ ElMessage.warning("璇峰~鍏ュ搴旂殑鍊煎啀杩涜淇濆瓨")
return;
}
}
- let selectProcesses=value.value
- if (selectProcesses==null || selectProcesses==""){
- ElMessage.success("璇烽�夋嫨鎺掍骇宸ュ簭")
+ let selectProcesses = value.value
+ if (selectProcesses == null || selectProcesses == "") {
+ ElMessage.warning("璇烽�夋嫨鎺掍骇宸ュ簭")
return;
}
let schedulingData = ref({
scheduling: selectRecords,
- processes:selectProcesses,//宸ュ簭
- userName:username//瀹℃牳浜�
+ processes: selectProcesses,//宸ュ簭
+ userName: username//瀹℃牳浜�
})
- console.log(schedulingData.value)
+ //绂佺敤淇濆瓨
+ gridOptions.toolbarConfig.buttons[2].disabled = true
//淇濆瓨鎺掍骇鏁版嵁
request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
if (res.code == 200) {
ElMessage.success("淇濆瓨鎴愬姛")
- location.reload();
+ // 鍚敤淇濆瓨
+ gridOptions.toolbarConfig.buttons[2].disabled = false
+ router.push({
+ path: '/main/processCard/ProductionScheduling',
+ query: { random: Math.random()}
+ })
} else {
+ // 鍚敤淇濆瓨
+ gridOptions.toolbarConfig.buttons[2].disabled = false
ElMessage.warning(res.msg)
- router.push("/login")
+
}
})
@@ -358,10 +476,122 @@
}
+ case 'delete': {
+ const $table = xGrid.value
+ const selectRecords = $table.getCheckboxRecords()
+ if ($table) {
+ if (selectRecords.length == 0) {
+ ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+ return;
+ }
+ const type = await VXETable.modal.confirm('鎮ㄧ‘瀹氳鍒犻櫎璇ユ暟鎹�?')
+ if (type === 'confirm') {
+ let schedulingData = ref({
+ scheduling: selectRecords,
+ })
+
+ request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => {
+ if (res.code == 200) {
+ ElMessage.success("鍒犻櫎鎴愬姛")
+ location.reload();
+ } else {
+ ElMessage.warning(res.msg)
+
+ }
+ })
+ }
+ }
+ return;
+ }
+ case 'review': {
+ const $table = xGrid.value
+ const selectRecords = $table.getCheckboxRecords()
+ if ($table) {
+ if (selectRecords.length == 0) {
+ ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+ return;
+ }
+ let schedulingData = ref({
+ scheduling: selectRecords,
+ userName: username//瀹℃牳浜�
+ })
+ request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => {
+ if (res.code == 200) {
+ ElMessage.success("瀹℃牳鎴愬姛")
+ location.reload();
+ } else {
+ ElMessage.warning(res.msg)
+
+ }
+ })
+
+ }
+ return;
+ }
}
}
},
+ menuClick ({ menu, row, column }) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (menu.code) {
+ case 'copyChecked' :{
+ let result = toolbarButtonClickEvent()
+ if(result){
+ const dataList = xGrid.value.getTableData().visibleData
+ const val = dataList[result.start][result.cell]
+ dataList.forEach((item,index) =>{
+ if(index>=result.start && index<=result.end){
+ item[result.cell] = val
+ }
+ })
+ }
+ break
+ }
+ case 'copyAll' :{
+ let result = toolbarButtonClickEvent()
+ if(result){
+ const dataList = xGrid.value.getTableData().visibleData
+ const val = dataList[result.start][result.cell]
+ dataList.forEach((item,index) =>{
+ if(index>=result.start ){
+ item[result.cell] = val
+ }
+ })
+ }
+ break
+ }
+ case 'clearChecked' :{
+ let result = toolbarButtonClickEvent()
+ if(result){
+ const dataList = xGrid.value.getTableData().visibleData
+ dataList.forEach((item,index) =>{
+ if(index>=result.start && index<=result.end){
+ item[result.cell] = ''
+ }
+ })
+ }
+ break
+ }
+ }
+ }
+ },
+}
+const determineNum = () => {
+ const $grid = xGrid.value
+ const table = $grid.getTableData().fullData
+ const selectRecords = $grid.getCheckboxRecords()
+ let selectState = stateValue.value
+ table.forEach((selectRecords) => {
+ if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity && selectState==1) {
+ ElMessage.warning("鎺掍骇鏁伴噺涓嶈兘澶т簬寰呮帓浜ф暟閲�")
+ //绂佺敤淇濆瓨鎸夐挳
+ //gridOptions.toolbarConfig.buttons[2].disabled = true
+ }
+
+
+ })
}
@@ -373,23 +603,23 @@
<el-row :gutter="0">
<el-date-picker
v-model="form.date1"
- type="daterange"
- format="YYYY/MM/DD"
- value-format="YYYY-MM-DD"
- start-placeholder="寮�濮嬫椂闂�"
- end-placeholder="缁撴潫鏃堕棿"
:default-time="defaultTime"
+ end-placeholder="缁撴潫鏃堕棿"
+ format="YYYY/MM/DD"
+ start-placeholder="寮�濮嬫椂闂�"
+ type="daterange"
+ value-format="YYYY-MM-DD"
/>
- <el-input placeholder="閿�鍞崟鍙�" v-model="form.orderId" style="width: 110px"></el-input>
+ <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 110px"></el-input>
- <el-select v-model="value" class="m-2" placeholder="宸ュ簭" style="width: 90px;">
+ <el-select v-model="value" clearable default-value="default_city" style="width: 120px">
<el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
+ v-for="item in titleSelectJson['processType']"
+ :key="item.id"
+ :label="item.basic_name"
+ :value="item.basic_name"
/>
</el-select>
@@ -403,20 +633,22 @@
</el-select>
<el-button
- @click="getWorkOrder"
id="select"
- type="primary" :icon="Search">鏌ヨ
+ :icon="Search"
+ type="primary" @click="getWorkOrder">{{$t('basicData.search')}}
</el-button>
</el-row>
</div>
<vxe-grid
- max-height="100%"
- @filter-change="filterChanged"
- class="mytable-scrollbar"
ref="xGrid"
+ class="mytable-scrollbar"
+ height="100%"
+ max-height="100%"
v-bind="gridOptions"
v-on="gridEvents"
+ @filter-change="filterChanged"
+ @checkbox-change="determineNum"
>
<!-- @toolbar-button-click="toolbarButtonClickEvent"-->
<!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
@@ -433,7 +665,7 @@
<template #num1_filter="{ column, $panel }">
<div>
<div v-for="(option, index) in column.filters" :key="index">
- <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
+ <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/>
</div>
</div>
</template>
@@ -441,15 +673,29 @@
</vxe-grid>
</div>
+ <div class="vxe-table--cell-area" ref="cellArea" >
+ <span class="vxe-table--cell-main-area" ></span>
+
+ <span class="vxe-table--cell-active-area" ></span>
+ </div>
</template>
<style scoped>
-.main-div-customer{
+.main-div-customer {
width: 99%;
height: 100%;
}
+
#selectForm {
width: 70%;
+ height: 6%;
text-align: center;
}
+.vxe-grid {
+ /* 绂佺敤娴忚鍣ㄩ粯璁ら�変腑 */
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0