|
|
@@ -13,7 +13,7 @@
|
|
|
<el-button type="primary" class="bt" @click="onDel" v-if="DelType === true" >删除</el-button>
|
|
|
<el-button type="primary" class="bt" @click="onADD" v-if="AddType === true">新增</el-button>
|
|
|
<el-button type="primary" class="bt" @click="hesuan" v-if="AddType === true">核算参数调整</el-button>
|
|
|
- <el-button type="primary" class="bt" @click="onADD" v-if="AddType === true">修正核算参数</el-button>
|
|
|
+ <el-button type="primary" icon="edit" @click="onxzhscsclick" class="bt" title="修正核算参数">修正核算参数</el-button>
|
|
|
<!-- <el-button type="primary" @click="onClear2" >换型清场</el-button> -->
|
|
|
</header>
|
|
|
|
|
|
@@ -1872,6 +1872,41 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!--修正核算参数-->
|
|
|
+ <el-dialog v-model="xzhscslist" title="修正核算参数" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
|
|
|
+ <el-button type="primary" @click="xzhscsConfirm">更新</el-button>
|
|
|
+ <el-button type="" @click="sxzhscsCancel">退出</el-button>
|
|
|
+ <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
|
|
|
+ <el-form-item label="当前工单 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
|
|
|
+ <el-input v-model="xzhscsformData['gdbh']"
|
|
|
+ @keyup.enter="xzhscsgetProductValue" style="width: 200px;"/>
|
|
|
+ <el-input v-model="xzhscsformData['cpdh']" disabled style="width: 120px;margin-left: 10px;"/>
|
|
|
+ <el-input v-model="xzhscsformData['gdmc']" disabled style="width: 500px;"/>
|
|
|
+ <el-input v-model="xzhscsformData['yjdh']" disabled style="width: 120px;margin-left: 10px;"/>
|
|
|
+ <el-input v-model="xzhscsformData['yjmc']" disabled style="width: 500px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-table ref="paichengRef"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ :row-style="{ height: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ style="width: 100%;height: 74vh" border tooltip-effect="dark"
|
|
|
+ :data="sxzhscstableData" row-key="ID"
|
|
|
+ :cell-class-name="sxzhscsCellClass">
|
|
|
+ <template v-for="(item, idx) in xzhstableColumns">
|
|
|
+ <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
|
|
|
+ <div v-if="['难度系数', '损耗代号', '印刷方式', '版距','计损色数', '损耗系数'].includes(item.prop)">
|
|
|
+ <el-input v-model="row[item.prop]" :clearable="false"
|
|
|
+ :id="`input${idx}${$index}`" />
|
|
|
+ </div>
|
|
|
+ <div v-else>{{ row[item.prop] }}</div>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1951,7 +1986,8 @@ import {
|
|
|
CoefficientEdit,
|
|
|
ChromaDataEdit,
|
|
|
PrintingModeDataEdit
|
|
|
-} from '@/api/jixiaoguanli/jitairibaobiao'
|
|
|
+} from '@/api/jixiaoguanli/jitairibaobiao'
|
|
|
+import{ AccountingParameter,ProductNameData,AccountingParameterEdit} from "@/api/yunyin/yunying";
|
|
|
import {
|
|
|
MachineTeamAdd,
|
|
|
setMachineTeam,
|
|
|
@@ -3388,11 +3424,13 @@ function gytableDatadoubleClick(row, column, event) {
|
|
|
console.log(row)
|
|
|
type2.value="update"
|
|
|
MachineChanliang(row.UniqId)
|
|
|
-
|
|
|
}
|
|
|
-const uid=ref()
|
|
|
-function getUid(row, column, event) {
|
|
|
- uid.value=row.UniqId
|
|
|
+const uid=ref()
|
|
|
+const _Gd_gdbh=ref()
|
|
|
+function getUid(row, column, event) {
|
|
|
+ console.log(row.工单编号)
|
|
|
+ uid.value=row.UniqId
|
|
|
+ _Gd_gdbh.value=row.工单编号
|
|
|
console.log(uid.value)
|
|
|
}
|
|
|
//获取详细信息
|
|
|
@@ -3421,7 +3459,6 @@ const MachineChanliang = async(value) => {
|
|
|
formdata3.value.starttime = date + " 20:30:00"; // 设置为 20:30:00
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
console.log(formdata3.value)
|
|
|
}
|
|
|
}
|
|
|
@@ -3785,32 +3822,61 @@ if(selected.value==='难度调整系数'){
|
|
|
//核算调整弹窗确定
|
|
|
const hesuanenterDialog = async () => {
|
|
|
if(selected.value==='难度调整系数'){
|
|
|
- const id=ref('')
|
|
|
- // console.log(multipleSelection.value.length)
|
|
|
- // console.log(multipleSelection.value[0])
|
|
|
- for(let i=0;i<multipleSelection.value.length;i++){
|
|
|
- id.value+=multipleSelection.value[i].UniqId+','
|
|
|
- console.log(multipleSelection.value[i].UniqId)
|
|
|
- }
|
|
|
- const res = await CoefficientEdit({id:id.value,工价系数:hesuanValue.缩放系数 })
|
|
|
- console.log(res)
|
|
|
- if(res.code===0){
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '成功'
|
|
|
- })
|
|
|
- multipleSelection.value=''
|
|
|
- multipleTable.clearSelection();
|
|
|
- console.log(multipleSelection.value)
|
|
|
- hesuanVisible.value=false
|
|
|
- }else{
|
|
|
+ try{
|
|
|
+ const id=ref('')
|
|
|
+ // console.log(multipleSelection.value[0])
|
|
|
+ for(let i=0;i<multipleSelection.value.length;i++){
|
|
|
+ id.value+=multipleSelection.value[i].UniqId+','
|
|
|
+ console.log(multipleSelection.value[i].UniqId)
|
|
|
+ }
|
|
|
+ const res = await CoefficientEdit({id:id.value,工价系数:hesuanValue.缩放系数 })
|
|
|
+ console.log(res)
|
|
|
+ if(res.code===0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ multipleSelection.value=''
|
|
|
+ multipleTable.clearSelection();
|
|
|
+ console.log(multipleSelection.value)
|
|
|
+ hesuanVisible.value=false
|
|
|
+ FacilitychanLiang()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
ElMessage({
|
|
|
type: 'error',
|
|
|
- message: '失败'
|
|
|
+ message: '请确认是否已选择要修改的内容'
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
}else if(selected.value=== '凹印版距'){
|
|
|
- console.log('凹印版距')
|
|
|
+ const id=ref('')
|
|
|
+ // console.log(multipleSelection.value.length)
|
|
|
+ // console.log(multipleSelection.value[0])
|
|
|
+ for(let i=0;i<multipleSelection.value.length;i++){
|
|
|
+ id.value+=multipleSelection.value[i].UniqId+','
|
|
|
+ console.log(multipleSelection.value[i].UniqId)
|
|
|
+ }
|
|
|
+ const res = await PrintingModeDataEdit({id:id.value,plate:hesuanValue.产品板距,mode:hesuanValue.印刷方式 })
|
|
|
+ console.log(res)
|
|
|
+ if(res.code===0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ hesuanVisible.value=false
|
|
|
+ FacilitychanLiang()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
}else if(selected.value=== '色度数'){
|
|
|
const id=ref('')
|
|
|
// console.log(multipleSelection.value.length)
|
|
|
@@ -3819,7 +3885,7 @@ if(selected.value==='难度调整系数'){
|
|
|
id.value+=multipleSelection.value[i].UniqId+','
|
|
|
console.log(multipleSelection.value[i].UniqId)
|
|
|
}
|
|
|
- const res = await CoefficientEdit({id:id.value,工价系数:hesuanValue.缩放系数 })
|
|
|
+ const res = await ChromaDataEdit({id:id.value,ms:hesuanValue.色度数 })
|
|
|
console.log(res)
|
|
|
if(res.code===0){
|
|
|
ElMessage({
|
|
|
@@ -3827,6 +3893,7 @@ if(selected.value==='难度调整系数'){
|
|
|
message: '成功'
|
|
|
})
|
|
|
hesuanVisible.value=false
|
|
|
+ FacilitychanLiang()
|
|
|
}else{
|
|
|
ElMessage({
|
|
|
type: 'error',
|
|
|
@@ -3907,7 +3974,172 @@ if(selected.value==='难度调整系数'){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+// =========== 修正核算参数 ===========
|
|
|
+const xzhstableColumns = ref(
|
|
|
+ [
|
|
|
+ { label: '方案', prop: '方案', width: '65' },
|
|
|
+ { label: '印件号及工序名称', prop: '印件号及工序名称', width: '300' },
|
|
|
+ { label: '参照设备', prop: '参照设备', width: '90' },
|
|
|
+ { label: '难度系数', prop: 'sxzhscsold_难度系数', width: '90' },
|
|
|
+ { label: '新难度系数', prop: '难度系数', width: '100' },
|
|
|
+ { label: '原损耗代号', prop: 'sxzhscsold_损耗代号', width: '150' },
|
|
|
+ { label: '基础损耗', prop: '基础损耗', width: '90' },
|
|
|
+ { label: '新损耗代号', prop: '损耗代号', width: '150' },
|
|
|
+ { label: '原印刷方式', prop: 'sxzhscsold_印刷方式', width: '150' },
|
|
|
+ { label: '原来版距', prop: 'sxzhscsold_版距', width: '100' },
|
|
|
+ { label: '新印刷方式', prop: '印刷方式', width: '100' },
|
|
|
+ { label: '新来版距', prop: '版距', width: '90' },
|
|
|
+ { label: '原计损色数', prop: 'sxzhscsold_计损色数', width: '100' },
|
|
|
+ { label: '新计损色数', prop: '计损色数', width: '100' },
|
|
|
+ { label: '原损耗系数', prop: 'sxzhscsold_损耗系数', width: '100' },
|
|
|
+ { label: '新损耗系数', prop: '损耗系数', width: '100' },
|
|
|
+ ]
|
|
|
+)
|
|
|
+const handleKeyDown = (event, x, y, prop) => {
|
|
|
+ const currentElement = document.getElementById(`input${x}${y}`);
|
|
|
+ if (currentElement === null && currentElement === undefined) return
|
|
|
+ let move = 0
|
|
|
+ switch (event.keyCode) {
|
|
|
+ case 13: // Enter
|
|
|
+ case 40: // 向下箭头
|
|
|
+ if (y < sxzhscstableData.value.length )
|
|
|
+ document.getElementById(`input${x}${y + 1}`).focus();
|
|
|
+ break;
|
|
|
+ case 38: // 向上箭头
|
|
|
+ if ( y > 0) {
|
|
|
+ document.getElementById(`input${x}${y - 1}`).focus();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 39: // 向左箭头
|
|
|
+ if ( x === 4) {
|
|
|
+ move = x + 3
|
|
|
+ } else if(x === 7){
|
|
|
+ move = x + 3
|
|
|
+ } else if( x === 10){
|
|
|
+ move = x + 1
|
|
|
+ }else if( x === 11){
|
|
|
+ move = x + 2
|
|
|
+ }else if( x === 13){
|
|
|
+ move = x + 2
|
|
|
+ }
|
|
|
+ document.getElementById(`input${move}${y}`).focus();
|
|
|
+ break;
|
|
|
+ case 37: // 向右箭头
|
|
|
+ if ( x === 15) {
|
|
|
+ move = x - 2
|
|
|
+ } else if (x=== 13) {
|
|
|
+ move = x - 2
|
|
|
+ }else if (x=== 11) {
|
|
|
+ move = x - 1
|
|
|
+ }else if (x=== 10) {
|
|
|
+ move = x - 3
|
|
|
+ }else if (x=== 7) {
|
|
|
+ move = x - 3
|
|
|
+ }
|
|
|
+ document.getElementById(`input${move}${y}`).focus();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+const xzhscslist = ref(false);
|
|
|
+const xzhscsformData = reactive({
|
|
|
+ gdbh: '',
|
|
|
+ cpdh: '',
|
|
|
+ gdmc: '',
|
|
|
+ yjdh:'',
|
|
|
+ yjmc:'',
|
|
|
+});
|
|
|
+const sxzhscstableData = ref([]);
|
|
|
+//修正核算参数按钮
|
|
|
+const onxzhscsclick = () => {
|
|
|
+ if(_Gd_gdbh.value == null){
|
|
|
+ xzhscslist.value = false;
|
|
|
+ ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能' })
|
|
|
+ }else{
|
|
|
+ xzhscsformData['gdbh'] = _Gd_gdbh.value;
|
|
|
+ // xzhscsformData['cpdh'] = _Gd_cpdh.value;
|
|
|
+ // xzhscsformData['gdmc'] = _Gd_cpmc.value;
|
|
|
+ // _AccountingParameterdata();
|
|
|
+ xzhscslist.value = true;
|
|
|
+ }
|
|
|
+};
|
|
|
+//修正核算参数回车
|
|
|
+const xzhscsgetProductValue = () => {
|
|
|
+ _AccountingParameterdata()
|
|
|
+};
|
|
|
+// 修正工单核算参数表格数据
|
|
|
+const _AccountingParameterdata = async ()=>{
|
|
|
+
|
|
|
+ const ProductNamedata = await ProductNameData({workOrder:_Gd_gdbh.value});
|
|
|
+ if(ProductNamedata.code===0){
|
|
|
+ xzhscsformData['cpdh']=ProductNamedata.data.产品代号
|
|
|
+ xzhscsformData['gdmc']=ProductNamedata.data.产品名称
|
|
|
+ xzhscsformData['yjdh']=ProductNamedata.data.印件代号
|
|
|
+ xzhscsformData['yjmc']=ProductNamedata.data.印件名称
|
|
|
+ }
|
|
|
+
|
|
|
+ let workOrder = xzhscsformData['gdbh'];
|
|
|
+ try {
|
|
|
+ const AccountingParameterdata = await AccountingParameter({workOrder:workOrder});
|
|
|
+ sxzhscstableData.value = AccountingParameterdata.data;
|
|
|
+ const formattedData = AccountingParameterdata.data.map(item=>{
|
|
|
+ item.sxzhscsold_难度系数 = item.难度系数;
|
|
|
+ item.sxzhscsold_损耗代号 = item.损耗代号;
|
|
|
+ item.sxzhscsold_印刷方式 = item.印刷方式;
|
|
|
+ item.sxzhscsold_版距 = item.版距;
|
|
|
+ item.sxzhscsold_计损色数 = item.计损色数;
|
|
|
+ item.sxzhscsold_损耗系数 = item.损耗系数;
|
|
|
+ return item
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//修正核算参数更新
|
|
|
+const xzhscsConfirm = async () => {
|
|
|
+ const firstCharValid = sxzhscstableData.value.map(item => {
|
|
|
+ const firstChar = item["损耗代号"] ? item["损耗代号"].charAt(0) : '';
|
|
|
+ return firstChar === '0' || firstChar === '';
|
|
|
+ });
|
|
|
+ if(firstCharValid.includes(false)){
|
|
|
+ ElMessage({type: 'warning',message: '损耗代号开头必须是 0' })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (sxzhscstableData.value) {
|
|
|
+ const formattedData = sxzhscstableData.value.map(item => {
|
|
|
+ return {
|
|
|
+ Uniqid: parseInt(item.UniqId),
|
|
|
+ chromatic: parseFloat(item.计损色数) ?? '',
|
|
|
+ difficulty: parseFloat(item.难度系数) ?? '',
|
|
|
+ loss: item.损耗代号 ??'',
|
|
|
+ plate: parseInt(item.版距) ?? '',
|
|
|
+ printMode: item.印刷方式 ?? '',
|
|
|
+ wastage: parseFloat(item.损耗系数),
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const AccountingParameterEditdata = await AccountingParameterEdit(formattedData);
|
|
|
+ if (AccountingParameterEditdata.code === 0) {
|
|
|
+ xzhscslist.value = false;
|
|
|
+ ElMessage({ type: 'success', message: '更新成功' });
|
|
|
+ } else {
|
|
|
+ ElMessage({ type: 'error', message: '更新失败' });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.error("数据错误");
|
|
|
+ }
|
|
|
+};
|
|
|
+//修正核算参数退出
|
|
|
+const sxzhscsCancel = () => {
|
|
|
+ xzhscslist.value = false;
|
|
|
+};
|
|
|
+//修正核算参数颜色
|
|
|
+const sxzhscsCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (column.label === '新难度系数' || column.label === '新损耗代号' || column.label === '新印刷方式' || column.label === '新来版距' || column.label === '新计损色数' || column.label === '新损耗系数') {
|
|
|
+ return 'background-plan-usage-low';
|
|
|
+ }
|
|
|
+}
|
|
|
// ============== 表格控制部分结束 ===============
|
|
|
|
|
|
// 获取需要的字典 可能为空 按需保留
|