|
@ -2,7 +2,10 @@ |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search |
|
|
<Search |
|
|
:schema="[...SupplierdeliverRequestMain.allSchemas.searchSchema,...SupplierdeliverRequestDetail.allSchemas.searchSchema]" |
|
|
:schema="[ |
|
|
|
|
|
...SupplierdeliverRequestMain.allSchemas.searchSchema, |
|
|
|
|
|
...SupplierdeliverRequestDetail.allSchemas.searchSchema |
|
|
|
|
|
]" |
|
|
@search="setSearchParams" |
|
|
@search="setSearchParams" |
|
|
@reset="setSearchParams" |
|
|
@reset="setSearchParams" |
|
|
/> |
|
|
/> |
|
@ -20,8 +23,9 @@ |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap > |
|
|
<ContentWrap> |
|
|
<Table v-clientTable |
|
|
<Table |
|
|
|
|
|
v-clientTable |
|
|
:columns="tableColumns" |
|
|
:columns="tableColumns" |
|
|
:data="tableObject.tableList" |
|
|
:data="tableObject.tableList" |
|
|
:loading="tableObject.loading" |
|
|
:loading="tableObject.loading" |
|
@ -32,19 +36,30 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
|
|
|
<template #asnNumber="{ row }"> |
|
|
|
|
|
<el-button type="primary" link @click="openDetail(row, '发货单号', row.asnNumber)"> |
|
|
|
|
|
<span>{{ row.asnNumber }}</span> |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</template> |
|
|
<template #number="{ row }"> |
|
|
<template #number="{ row }"> |
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
<span>{{ row.number }}</span> |
|
|
<span>{{ row.number }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row,$index }"> |
|
|
<template #action="{ row, $index }"> |
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event, row)" /> |
|
|
<ButtonBase |
|
|
|
|
|
:Butttondata="butttondata(row, $index)" |
|
|
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<supplierdeliverBasicForm ref="supplierdeliverFormRef" @getList="getList" ></supplierdeliverBasicForm> |
|
|
<supplierdeliverBasicForm |
|
|
|
|
|
ref="supplierdeliverFormRef" |
|
|
|
|
|
@getList="getList" |
|
|
|
|
|
></supplierdeliverBasicForm> |
|
|
<!-- <BasicForm |
|
|
<!-- <BasicForm |
|
|
ref="formRef" |
|
|
ref="formRef" |
|
|
:isOpenSearchTable="true" |
|
|
:isOpenSearchTable="true" |
|
@ -76,28 +91,32 @@ |
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<Detail |
|
|
<Detail |
|
|
ref="detailRef" |
|
|
ref="detailRef" |
|
|
:annexTable="[{ |
|
|
:annexTable="[ |
|
|
|
|
|
{ |
|
|
label: '质检明细', |
|
|
label: '质检明细', |
|
|
prop: 'uploadFile', |
|
|
prop: 'uploadFile', |
|
|
tableName:'SupplierdeliverInspectionDetail', |
|
|
tableName: 'SupplierdeliverInspectionDetail', |
|
|
hasSubDetail:true, // 附件中是否展示明细表 |
|
|
hasSubDetail: true, // 附件中是否展示明细表 |
|
|
showPreview:true, // 附件中是否展示预览按钮 |
|
|
showPreview: true, // 附件中是否展示预览按钮 |
|
|
fileType:['pdf','jpg','png','jpeg'], |
|
|
fileType: ['pdf', 'jpg', 'png', 'jpeg'], |
|
|
align:'left', |
|
|
align: 'left', |
|
|
//明细表数据 |
|
|
//明细表数据 |
|
|
subDetailTableData:{ |
|
|
subDetailTableData: { |
|
|
queryParams:[{ |
|
|
queryParams: [ |
|
|
queryField:'masterId', |
|
|
{ |
|
|
rowField:'masterId' |
|
|
queryField: 'masterId', |
|
|
}], // 查询参数 |
|
|
rowField: 'masterId' |
|
|
getSubList:SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage,//请求接口 |
|
|
} |
|
|
tableColumns:SupplierdeliverInspectionDetail.allSchemas.tableColumns, |
|
|
], // 查询参数 |
|
|
tableList:[],//表格数据 |
|
|
getSubList: SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage, //请求接口 |
|
|
total:1, |
|
|
tableColumns: SupplierdeliverInspectionDetail.allSchemas.tableColumns, |
|
|
pageSize:10, |
|
|
tableList: [], //表格数据 |
|
|
currentPage:1, |
|
|
total: 1, |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
currentPage: 1 |
|
|
} |
|
|
} |
|
|
}]" |
|
|
} |
|
|
|
|
|
]" |
|
|
:isBasic="false" |
|
|
:isBasic="false" |
|
|
:allSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
:allSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" |
|
|
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" |
|
@ -120,19 +139,22 @@ |
|
|
:mode="2" |
|
|
:mode="2" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 创建标签 --> |
|
|
<!-- 创建标签 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="formLabelRef" |
|
|
ref="formLabelRef" |
|
|
@success="getList" |
|
|
@success="getList" |
|
|
:tableAllSchemas="SupplierdeliverRequestDetailLabel.allSchemas" |
|
|
:tableAllSchemas="SupplierdeliverRequestDetailLabel.allSchemas" |
|
|
:tableFormRules="SupplierdeliverRequestDetailRules" |
|
|
:tableFormRules="SupplierdeliverRequestDetailRules" |
|
|
:tableData="detatableData.tableList" |
|
|
:tableData="detatableData1" |
|
|
:isBusiness="true" |
|
|
:isBusiness="true" |
|
|
:isShowButton="false" |
|
|
:isShowButton="false" |
|
|
@searchTableSuccess="searchTableSuccessLabel" |
|
|
@searchTableSuccess="searchTableSuccessLabel" |
|
|
@submitForm="submitFormLabel" |
|
|
|
|
|
:isShowReduceButton="false" |
|
|
:isShowReduceButton="false" |
|
|
@clearInput='clearInput' |
|
|
@clearInput="clearInput" |
|
|
|
|
|
:footButttondata="footButttondata" |
|
|
|
|
|
@footButtonClick="footButtonClick" |
|
|
|
|
|
@formSelectChange="formSelectChangeLabel" |
|
|
|
|
|
@visibleChange='visibleChange' |
|
|
/> |
|
|
/> |
|
|
<!-- 上传质量报告 --> |
|
|
<!-- 上传质量报告 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
@ -154,11 +176,16 @@ |
|
|
</BasicForm> |
|
|
</BasicForm> |
|
|
|
|
|
|
|
|
<!-- 标签打印 --> |
|
|
<!-- 标签打印 --> |
|
|
<SearchTable width="905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" > |
|
|
<SearchTable width="905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1"> |
|
|
<!-- <template #actions> |
|
|
<!-- <template #actions> |
|
|
<el-button type="primary" @click="printAllClick">打印全部</el-button> |
|
|
<el-button type="primary" @click="printAllClick">打印全部</el-button> |
|
|
</template> --> |
|
|
</template> --> |
|
|
</SearchTable> |
|
|
</SearchTable> |
|
|
|
|
|
<labelForm |
|
|
|
|
|
ref="labelFormRef" |
|
|
|
|
|
:tableAllSchemas="SupplierdeliverRequestDetailLabel.allSchemas" |
|
|
|
|
|
@submitForm="submitFormLabel" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
@ -171,9 +198,12 @@ import { |
|
|
SupplierdeliverRequestDetail, |
|
|
SupplierdeliverRequestDetail, |
|
|
SupplierdeliverRequestDetailRules, |
|
|
SupplierdeliverRequestDetailRules, |
|
|
SupplierdeliverRequestDetailLabel, |
|
|
SupplierdeliverRequestDetailLabel, |
|
|
SupplierdeliverRequestPackage, |
|
|
SupplierdeliverRequestPackage |
|
|
} from './supplierdeliverRequestMain.data' |
|
|
} from './supplierdeliverRequestMain.data' |
|
|
import { SupplierdeliverInspectionDetail,SupplierdeliverInspectionDetailRules} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data' |
|
|
import { |
|
|
|
|
|
SupplierdeliverInspectionDetail, |
|
|
|
|
|
SupplierdeliverInspectionDetailRules |
|
|
|
|
|
} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data' |
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' |
|
|
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
@ -185,18 +215,22 @@ import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data' |
|
|
import * as SupplierApi from '@/api/wms/supplier' |
|
|
import * as SupplierApi from '@/api/wms/supplier' |
|
|
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' |
|
|
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' |
|
|
import supplierdeliverBasicForm from './supplierdeliverBasicForm.vue' |
|
|
import supplierdeliverBasicForm from './supplierdeliverBasicForm.vue' |
|
|
|
|
|
import labelForm from './labelForm.vue' |
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
// 供应商发货申请 |
|
|
// 供应商发货申请 |
|
|
defineOptions({ name: 'SupplierdeliverRequestMain' }) |
|
|
defineOptions({ name: 'SupplierdeliverRequestMain' }) |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const genLabelId = ref(); |
|
|
const genLabelId = ref() |
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
|
|
|
|
|
|
const tableColumns = ref([...SupplierdeliverRequestMain.allSchemas.tableColumns,...SupplierdeliverRequestDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([ |
|
|
|
|
|
...SupplierdeliverRequestMain.allSchemas.tableColumns, |
|
|
|
|
|
...SupplierdeliverRequestDetail.allSchemas.tableMainColumns |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
@ -207,8 +241,8 @@ const planArriveTimeStr = ref() |
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
console.log("type:",type) |
|
|
console.log('type:', type) |
|
|
console.log("formField:",formField) |
|
|
console.log('formField:', formField) |
|
|
console.log(formField, searchField, val, formRef, type, row) |
|
|
console.log(formField, searchField, val, formRef, type, row) |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
@ -222,9 +256,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
// } |
|
|
// } |
|
|
//添加费用明细--点击确定 |
|
|
//添加费用明细--点击确定 |
|
|
const itemCodes = [] |
|
|
const itemCodes = [] |
|
|
val.forEach(item=>{ |
|
|
val.forEach((item) => { |
|
|
if(tableData.value.find(item1=>item1['id'] == item['id'])) return |
|
|
if (tableData.value.find((item1) => item1['id'] == item['id'])) return |
|
|
const newRow = {...row} |
|
|
const newRow = { ...row } |
|
|
newRow[formField] = item[searchField] |
|
|
newRow[formField] = item[searchField] |
|
|
newRow['poNumber'] = item['poNumber'] |
|
|
newRow['poNumber'] = item['poNumber'] |
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
newRow['itemCode'] = item['itemCode'] |
|
@ -236,29 +270,29 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
}) |
|
|
}) |
|
|
//有效期 |
|
|
//有效期 |
|
|
ItembasicApi.getItembasicPage({ |
|
|
ItembasicApi.getItembasicPage({ |
|
|
code:itemCodes.join(',') |
|
|
code: itemCodes.join(',') |
|
|
}).then((res)=>{ |
|
|
}).then((res) => { |
|
|
res.list.forEach((item,index)=>{ |
|
|
res.list.forEach((item, index) => { |
|
|
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) |
|
|
const findItem = tableData.value.find((item1) => item1['itemCode'] == item['code']) |
|
|
findItem['expireTime'] = findItem['expireTime'] |
|
|
findItem['expireTime'] = findItem['expireTime'] |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
if(formField == 'ppNumber'){ |
|
|
if (formField == 'ppNumber') { |
|
|
//新增--选择完要货计划,自动展示明细 |
|
|
//新增--选择完要货计划,自动展示明细 |
|
|
getSearchTableData(val[0]['number'],formField,searchField) |
|
|
getSearchTableData(val[0]['number'], formField, searchField) |
|
|
|
|
|
|
|
|
// 设置计划到货时间 |
|
|
// 设置计划到货时间 |
|
|
let beginTime = val[0]['endTime'] |
|
|
let beginTime = val[0]['endTime'] |
|
|
let deliveryDate = formatDate(val[0]['deliveryDate'],'YYYY-MM-DD') |
|
|
let deliveryDate = formatDate(val[0]['deliveryDate'], 'YYYY-MM-DD') |
|
|
planArriveTimeStr.value = deliveryDate + ' '+ beginTime+":00" |
|
|
planArriveTimeStr.value = deliveryDate + ' ' + beginTime + ':00' |
|
|
setV['planArriveTime']= new Date(planArriveTimeStr.value).valueOf(); |
|
|
setV['planArriveTime'] = new Date(planArriveTimeStr.value).valueOf() |
|
|
// 清空子表数据 |
|
|
// 清空子表数据 |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
|
} |
|
|
} |
|
|
if(formField == 'supplierCode'){ |
|
|
if (formField == 'supplierCode') { |
|
|
setV['contactName'] = val[0]['contacts'] |
|
|
setV['contactName'] = val[0]['contacts'] |
|
|
setV['contactPhone'] = val[0]['phone'] |
|
|
setV['contactPhone'] = val[0]['phone'] |
|
|
setV['contactEmail'] = val[0]['email'] |
|
|
setV['contactEmail'] = val[0]['email'] |
|
@ -268,21 +302,30 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
//供应商代码 回车搜索 |
|
|
//供应商代码 回车搜索 |
|
|
const onEnter = async (field,value)=>{ |
|
|
const onEnter = async (field, value) => { |
|
|
console.log(field,value) |
|
|
console.log(field, value) |
|
|
formRef.value.opensearchTable('supplierCode', 'code', '供应商信息', Supplier.allSchemas, SupplierApi.getSupplierPage,[{ |
|
|
formRef.value.opensearchTable( |
|
|
key:'code', |
|
|
'supplierCode', |
|
|
value:value |
|
|
'code', |
|
|
}]) |
|
|
'供应商信息', |
|
|
|
|
|
Supplier.allSchemas, |
|
|
|
|
|
SupplierApi.getSupplierPage, |
|
|
|
|
|
[ |
|
|
|
|
|
{ |
|
|
|
|
|
key: 'code', |
|
|
|
|
|
value: value |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getSearchTableData = async (number,formField,searchField)=>{ |
|
|
const getSearchTableData = async (number, formField, searchField) => { |
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
defaultParams:{number}, |
|
|
defaultParams: { number }, |
|
|
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口 |
|
|
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
|
const { getList:getList1 } = tableMethods |
|
|
const { getList: getList1 } = tableMethods |
|
|
await getList1() |
|
|
await getList1() |
|
|
const tableColumns = PurchasePlanDetail.allSchemas.tableFormColumns |
|
|
const tableColumns = PurchasePlanDetail.allSchemas.tableFormColumns |
|
|
tableColumns.forEach((item) => { |
|
|
tableColumns.forEach((item) => { |
|
@ -290,8 +333,8 @@ const getSearchTableData = async (number,formField,searchField)=>{ |
|
|
}) |
|
|
}) |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
|
const itemCodes = [] |
|
|
const itemCodes = [] |
|
|
tableObject.tableList.forEach(row=>{ |
|
|
tableObject.tableList.forEach((row) => { |
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...row })) |
|
|
newRow[formField] = row[searchField] |
|
|
newRow[formField] = row[searchField] |
|
|
newRow['poNumber'] = row['poNumber'] |
|
|
newRow['poNumber'] = row['poNumber'] |
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
newRow['itemCode'] = row['itemCode'] |
|
@ -301,15 +344,13 @@ const getSearchTableData = async (number,formField,searchField)=>{ |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
itemCodes.push(row['itemCode']) |
|
|
itemCodes.push(row['itemCode']) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
//有效期 |
|
|
//有效期 |
|
|
ItembasicApi.getItembasicPage({ |
|
|
ItembasicApi.getItembasicPage({ |
|
|
code:itemCodes.join(',') |
|
|
code: itemCodes.join(',') |
|
|
}).then((res)=>{ |
|
|
}).then((res) => { |
|
|
res.list.forEach((item,index)=>{ |
|
|
res.list.forEach((item, index) => { |
|
|
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) |
|
|
const findItem = tableData.value.find((item1) => item1['itemCode'] == item['code']) |
|
|
findItem['expireTime'] = findItem['expireTime'] |
|
|
findItem['expireTime'] = findItem['expireTime'] |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -328,12 +369,11 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
console.log("formField:",formField) |
|
|
console.log('formField:', formField) |
|
|
console.log("val:",val) |
|
|
console.log('val:', val) |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
@ -351,8 +391,6 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage // 分页接口 |
|
|
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage // 分页接口 |
|
|
}) |
|
|
}) |
|
@ -391,7 +429,7 @@ const buttonBaseClick = (val, item) => { |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { |
|
|
} else if (val == 'refresh') { |
|
|
// 刷新 |
|
|
// 刷新 |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
searchFormClick({ |
|
|
searchFormClick({ |
|
|
filters: tableObject.params.filters |
|
|
filters: tableObject.params.filters |
|
|
}) |
|
|
}) |
|
@ -415,9 +453,9 @@ const isShowMainButton = (row, val) => { |
|
|
// 根据状态返回该按钮是否显示 |
|
|
// 根据状态返回该按钮是否显示 |
|
|
const isShowMainButtonLabel = (row, val) => { |
|
|
const isShowMainButtonLabel = (row, val) => { |
|
|
if (val.indexOf(row.status) > -1) { |
|
|
if (val.indexOf(row.status) > -1) { |
|
|
if(row.labelStatus == '2'){ |
|
|
if (row.labelStatus == '2') { |
|
|
return true |
|
|
return true |
|
|
}else{ |
|
|
} else { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -428,9 +466,9 @@ const isShowMainButtonLabel = (row, val) => { |
|
|
// 根据状态返回该按钮是否显示 |
|
|
// 根据状态返回该按钮是否显示 |
|
|
const isReGenLabelShowMainButtonLabel = (row, val) => { |
|
|
const isReGenLabelShowMainButtonLabel = (row, val) => { |
|
|
if (val.indexOf(row.status) > -1) { |
|
|
if (val.indexOf(row.status) > -1) { |
|
|
if(row.labelStatus == '1'){ |
|
|
if (row.labelStatus == '1') { |
|
|
return true |
|
|
return true |
|
|
}else{ |
|
|
} else { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -439,17 +477,34 @@ const isReGenLabelShowMainButtonLabel = (row, val) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = (row,$index) => { |
|
|
const butttondata = (row, $index) => { |
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
const findIndex = row['masterId'] |
|
|
if(findIndex>-1&&findIndex<$index){ |
|
|
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId']) |
|
|
|
|
|
: -1 |
|
|
|
|
|
if (findIndex > -1 && findIndex < $index) { |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']),hasPermi: 'wms:supplierdeliver-request-main:open' }), // 打开 |
|
|
defaultButtons.mainListPurchasePlanOpeBtn({ |
|
|
defaultButtons.mainListPlanUploadQualityReportBtn({ hide: isShowMainButton(row, ['1','2','3']),hasPermi: 'wms:supplierdeliver-request-main:uploadCheck'}), // 上传质量报告 |
|
|
hide: isShowMainButton(row, ['5']), |
|
|
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']),hasPermi: 'wms:supplierdeliver-request-main:sub' }), // 提交审批 |
|
|
hasPermi: 'wms:supplierdeliver-request-main:open' |
|
|
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']),hasPermi: 'wms:supplierdeliver-request-main:app' }), // 审批通过 |
|
|
}), // 打开 |
|
|
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']),hasPermi: 'wms:supplierdeliver-request-main:rej' }), // 驳回按钮 |
|
|
defaultButtons.mainListPlanUploadQualityReportBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1', '2', '3']), |
|
|
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:uploadCheck' |
|
|
|
|
|
}), // 上传质量报告 |
|
|
|
|
|
defaultButtons.mainListPlanSubBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:sub' |
|
|
|
|
|
}), // 提交审批 |
|
|
|
|
|
defaultButtons.mainListPlanAppBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:app' |
|
|
|
|
|
}), // 审批通过 |
|
|
|
|
|
defaultButtons.mainListPlanTurBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:rej' |
|
|
|
|
|
}), // 驳回按钮 |
|
|
defaultButtons.mainListEditBtn({ |
|
|
defaultButtons.mainListEditBtn({ |
|
|
hide: isShowMainButton(row, ['1']), |
|
|
hide: isShowMainButton(row, ['1']), |
|
|
hasPermi: 'wms:supplierdeliver-request-main:update' |
|
|
hasPermi: 'wms:supplierdeliver-request-main:update' |
|
@ -475,7 +530,10 @@ const butttondata = (row,$index) => { |
|
|
hasPermi: 'wms:supplierdeliver-request-main:genLabels', |
|
|
hasPermi: 'wms:supplierdeliver-request-main:genLabels', |
|
|
link: true // 文本展现按钮 |
|
|
link: true // 文本展现按钮 |
|
|
}, |
|
|
}, |
|
|
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3','8']),hasPermi: 'wms:supplierdeliver-request-main:printLabel' }), // 标签打印 |
|
|
defaultButtons.mainListPointBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['3', '8']), |
|
|
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:printLabel' |
|
|
|
|
|
}), // 标签打印 |
|
|
//defaultButtons.mainListDocumentPrintBtn({ hide: isShowMainButton(row, ['3','8']) }), // 单据打印 |
|
|
//defaultButtons.mainListDocumentPrintBtn({ hide: isShowMainButton(row, ['3','8']) }), // 单据打印 |
|
|
// 生成记录 |
|
|
// 生成记录 |
|
|
{ |
|
|
{ |
|
@ -488,10 +546,14 @@ const butttondata = (row,$index) => { |
|
|
hasPermi: 'wms:supplierdeliver-request-main:genRecords', |
|
|
hasPermi: 'wms:supplierdeliver-request-main:genRecords', |
|
|
link: true // 文本展现按钮 |
|
|
link: true // 文本展现按钮 |
|
|
}, |
|
|
}, |
|
|
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '4','3']),hasPermi: 'wms:supplierdeliver-request-main:close' }), // 关闭 |
|
|
defaultButtons.mainListPurchasePlanCloBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1', '2', '4', '3']), |
|
|
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:close' |
|
|
|
|
|
}) // 关闭 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const detatableData1 = ref([]) |
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'mainPurPlanOpe') { |
|
|
if (val == 'mainPurPlanOpe') { |
|
@ -524,29 +586,33 @@ const buttonTableClick = async (val, row) => { |
|
|
} else if (val == 'ssbq') { |
|
|
} else if (val == 'ssbq') { |
|
|
// 生成标签 |
|
|
// 生成标签 |
|
|
detatableData.params = { |
|
|
detatableData.params = { |
|
|
masterId:row.masterId |
|
|
masterId: row.masterId |
|
|
} |
|
|
} |
|
|
genLabelId.value = row.masterId |
|
|
genLabelId.value = row.masterId |
|
|
await getDetailList() |
|
|
// await getDetailList() |
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
await getGenerateLabelList(row) |
|
|
} else if( val == 'ressbq'){ |
|
|
formLabelRef.value.open('create', row, null, 'createLabel') //创建标签页面 createLabel 标题 |
|
|
console.log("重新生成标签") |
|
|
} else if (val == 'ressbq') { |
|
|
|
|
|
console.log('重新生成标签') |
|
|
ElMessageBox.confirm(t('ts.重新生成标签会删除上次生成的标签,是否确认继续?'), '提示', { |
|
|
ElMessageBox.confirm(t('ts.重新生成标签会删除上次生成的标签,是否确认继续?'), '提示', { |
|
|
confirmButtonText: t('ts.确 认'), |
|
|
confirmButtonText: t('ts.确 认'), |
|
|
cancelButtonText: t('ts.取 消') |
|
|
cancelButtonText: t('ts.取 消') |
|
|
}).then(() => { |
|
|
}) |
|
|
SupplierdeliverRequestMainApi.deleteOldLabels(row.masterId).then(async res =>{ |
|
|
.then(() => { |
|
|
if(res){ |
|
|
SupplierdeliverRequestMainApi.deleteOldLabels(row.masterId).then(async (res) => { |
|
|
|
|
|
if (res) { |
|
|
// 生成标签 |
|
|
// 生成标签 |
|
|
detatableData.params = { |
|
|
detatableData.params = { |
|
|
masterId:row.masterId |
|
|
masterId: row.masterId |
|
|
} |
|
|
} |
|
|
genLabelId.value = row.masterId |
|
|
genLabelId.value = row.masterId |
|
|
await getDetailList() |
|
|
// await getDetailList() |
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
await getGenerateLabelList(row) |
|
|
|
|
|
formLabelRef.value.open('create', row, null, 'createLabel') //创建标签页面 createLabel 标题 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}).catch(() => { |
|
|
}) |
|
|
|
|
|
.catch(() => { |
|
|
console.info('操作取消') |
|
|
console.info('操作取消') |
|
|
}) |
|
|
}) |
|
|
} else if (val == 'point') { |
|
|
} else if (val == 'point') { |
|
@ -557,22 +623,110 @@ const buttonTableClick = async (val, row) => { |
|
|
handleDocumentPrint(row.masterId) |
|
|
handleDocumentPrint(row.masterId) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const footButttondata = ref([ |
|
|
|
|
|
defaultButtons.formNextStepBtn(null), // BOM下一步 |
|
|
|
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
|
|
|
]) |
|
|
|
|
|
// 获取箱规格 |
|
|
|
|
|
const getGenerateLabelList=async(row)=>{ |
|
|
|
|
|
const params1 = { |
|
|
|
|
|
masterId: row.masterId, |
|
|
|
|
|
pageSize: '500', |
|
|
|
|
|
pageNo: '1', |
|
|
|
|
|
sort: '', |
|
|
|
|
|
by: 'ASC' |
|
|
|
|
|
} |
|
|
|
|
|
await SupplierdeliverRequestDetailApi.getGenerateLabelList(params1).then((res) => { |
|
|
|
|
|
detatableData1.value = res |
|
|
|
|
|
detatableData1.value.forEach((item) => { |
|
|
|
|
|
item.packUnitInitOptions = item.boxPackaging |
|
|
|
|
|
let obj = item?.boxPackaging[0] |
|
|
|
|
|
if (obj) { |
|
|
|
|
|
item.packUnit= obj.packUnit |
|
|
|
|
|
item.packQty = obj.packQty |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// 下一步 |
|
|
|
|
|
const labelFormRef = ref() |
|
|
|
|
|
const footButtonClick = async (val) => { |
|
|
|
|
|
if (val == 'nextStep') { |
|
|
|
|
|
const validateForm = await formLabelRef.value.tableFormRef.validateForm() |
|
|
|
|
|
if (!validateForm) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
let isNext = detatableData1.value.some((item)=>{ |
|
|
|
|
|
return !item.packUnit || !item.packQty |
|
|
|
|
|
}) |
|
|
|
|
|
if(isNext){ |
|
|
|
|
|
message.warning('有数据没有选择箱规格') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
const data = JSON.parse(JSON.stringify(detatableData1.value)) |
|
|
|
|
|
labelFormRef.value.openLabel(data) |
|
|
|
|
|
} else if (val == 'close') { |
|
|
|
|
|
formLabelRef.value.dialogVisible = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 选择箱规格 拖规格 |
|
|
|
|
|
const formSelectChangeLabel = (field, val, row) => { |
|
|
|
|
|
if (field == 'packUnit') { |
|
|
|
|
|
let obj = row.boxPackaging.find((item) => item.packUnit == val) |
|
|
|
|
|
if (obj) { |
|
|
|
|
|
row.packQty = obj.packQty |
|
|
|
|
|
} else { |
|
|
|
|
|
row.packQty = '' |
|
|
|
|
|
} |
|
|
|
|
|
row.secondPackUnit = '' |
|
|
|
|
|
row.secondPackQty = '' |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
// 设置托 |
|
|
|
|
|
if (field == 'secondPackUnit') { |
|
|
|
|
|
let obj = row.secondPackUnitInitOptions.find((item) => item.packUnit == val) |
|
|
|
|
|
if (obj) { |
|
|
|
|
|
row.secondPackQty = obj.packQty |
|
|
|
|
|
} else { |
|
|
|
|
|
row.secondPackQty = '' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// tableForm下拉框弹出隐藏 |
|
|
|
|
|
const visibleChange=(field, val, row, index)=>{ |
|
|
|
|
|
row.secondPackUnitInitOptions=[] |
|
|
|
|
|
if(field=='secondPackUnit'){ |
|
|
|
|
|
if(val){ |
|
|
|
|
|
// 获取托规格 |
|
|
|
|
|
const params1 = { |
|
|
|
|
|
itemCode: row.itemCode, |
|
|
|
|
|
packUnit: row.packUnit |
|
|
|
|
|
} |
|
|
|
|
|
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res) => { |
|
|
|
|
|
row.secondPackUnitInitOptions = res |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
// 获取部门 用于详情 部门回显 |
|
|
const { wsCache } = useCache() |
|
|
const { wsCache } = useCache() |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|
|
const departmentCode = wsCache |
|
|
|
|
|
.get(CACHE_KEY.DEPT) |
|
|
|
|
|
.find((account) => account.id == row.departmentCode)?.name |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
detailRef.value.openDetail(row, titleName, titleValue,'requestSupplierdeliverMain') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'requestSupplierdeliverMain') |
|
|
} |
|
|
} |
|
|
//添加/修改操作 |
|
|
//添加/修改操作 |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const supplierdeliverFormRef = ref() |
|
|
const supplierdeliverFormRef = ref() |
|
|
|
|
|
|
|
|
const openForm = async (type: string, row?: number) => { |
|
|
const openForm = async (type: string, row?: number) => { |
|
|
supplierdeliverFormRef.value.openForm(type, row) |
|
|
supplierdeliverFormRef.value.openForm(type, row, defaultSupplierCode.value) |
|
|
// if(type == "update"){ |
|
|
// if(type == "update"){ |
|
|
// SupplierdeliverRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
// SupplierdeliverRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
// if(item.field == 'supplierCode'){ |
|
|
// if(item.field == 'supplierCode'){ |
|
@ -621,7 +775,8 @@ const handleDelete = async (id: number) => { |
|
|
message.success(t('common.delSuccess')) |
|
|
message.success(t('common.delSuccess')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {}finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -637,7 +792,8 @@ const handleClo = async (id: number) => { |
|
|
message.success(t('ts.关闭成功!')) |
|
|
message.success(t('ts.关闭成功!')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {}finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -653,14 +809,15 @@ const handleOpe = async (id: number) => { |
|
|
message.success(t('ts.打开成功!')) |
|
|
message.success(t('ts.打开成功!')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {}finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const ploadQualityReportRef = ref() |
|
|
const ploadQualityReportRef = ref() |
|
|
const uploadQualityReportTableData = ref([]) |
|
|
const uploadQualityReportTableData = ref([]) |
|
|
|
|
|
|
|
|
const handleAddQualityReport = ()=>{ |
|
|
const handleAddQualityReport = () => { |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
@ -668,31 +825,40 @@ const handleAddQualityReport = ()=>{ |
|
|
uploadQualityReportTableData.value.push(tableFormKeys) |
|
|
uploadQualityReportTableData.value.push(tableFormKeys) |
|
|
console.log('handleAddQualityReport') |
|
|
console.log('handleAddQualityReport') |
|
|
} |
|
|
} |
|
|
const handleDeleteQualityReport = (row,index)=>{ |
|
|
const handleDeleteQualityReport = (row, index) => { |
|
|
uploadQualityReportTableData.value.splice(index,1) |
|
|
uploadQualityReportTableData.value.splice(index, 1) |
|
|
console.log('handleDeleteQualityReport',row) |
|
|
console.log('handleDeleteQualityReport', row) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 上传质量报告 */ |
|
|
/** 上传质量报告 */ |
|
|
const handleUploadQualityReport = async (row) => { |
|
|
const handleUploadQualityReport = async (row) => { |
|
|
console.log('SupplierdeliverInspectionDetail',SupplierdeliverInspectionDetail.allSchemas) |
|
|
console.log('SupplierdeliverInspectionDetail', SupplierdeliverInspectionDetail.allSchemas) |
|
|
const uploadFile = SupplierdeliverInspectionDetail.allSchemas.formSchema.find(item=>item.field=='uploadFile') |
|
|
const uploadFile = SupplierdeliverInspectionDetail.allSchemas.formSchema.find( |
|
|
if(uploadFile){ |
|
|
(item) => item.field == 'uploadFile' |
|
|
|
|
|
) |
|
|
|
|
|
if (uploadFile) { |
|
|
uploadFile['componentProps']['upData']['tableId'] = row.masterId |
|
|
uploadFile['componentProps']['upData']['tableId'] = row.masterId |
|
|
} |
|
|
} |
|
|
ploadQualityReportRef.value.open('create', null, {masterId:row.masterId},t('ts.上传质检报告'),t('ts.上传质检报告'))//创建标签页面 createLabel 标题 |
|
|
ploadQualityReportRef.value.open( |
|
|
|
|
|
'create', |
|
|
|
|
|
null, |
|
|
|
|
|
{ masterId: row.masterId }, |
|
|
|
|
|
t('ts.上传质检报告'), |
|
|
|
|
|
t('ts.上传质检报告') |
|
|
|
|
|
) //创建标签页面 createLabel 标题 |
|
|
const tableFormKeys = {} |
|
|
const tableFormKeys = {} |
|
|
|
|
|
|
|
|
SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
await SupplierdeliverInspectionDetailApi.getSupplierdeliverDetailInfo(row.masterId).then(res => { |
|
|
await SupplierdeliverInspectionDetailApi.getSupplierdeliverDetailInfo(row.masterId).then( |
|
|
if(res){ |
|
|
(res) => { |
|
|
|
|
|
if (res) { |
|
|
// console.log("返回结果:",res) |
|
|
// console.log("返回结果:",res) |
|
|
uploadQualityReportTableData.value = res; |
|
|
uploadQualityReportTableData.value = res |
|
|
} |
|
|
} |
|
|
}) |
|
|
} |
|
|
|
|
|
) |
|
|
//uploadQualityReportTableData.value = [tableFormKeys] |
|
|
//uploadQualityReportTableData.value = [tableFormKeys] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -721,7 +887,8 @@ const handleSub = async (id: number) => { |
|
|
message.success(t('ts.提交审批成功!')) |
|
|
message.success(t('ts.提交审批成功!')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {}finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -737,7 +904,8 @@ const handleApp = async (id: number) => { |
|
|
message.success(t('ts.审批通过成功!')) |
|
|
message.success(t('ts.审批通过成功!')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {}finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -753,7 +921,8 @@ const handleTur = async (id: number) => { |
|
|
message.success(t('ts.驳回成功!')) |
|
|
message.success(t('ts.驳回成功!')) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
await getList() |
|
|
await getList() |
|
|
} catch {}finally{ |
|
|
} catch { |
|
|
|
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -761,11 +930,12 @@ const handleTur = async (id: number) => { |
|
|
/** 处理按钮操作 */ |
|
|
/** 处理按钮操作 */ |
|
|
const genRecords = async (id: number) => { |
|
|
const genRecords = async (id: number) => { |
|
|
let getLoading = null |
|
|
let getLoading = null |
|
|
await SupplierdeliverRequestMainApi.selfCheckReport(id).then(async res => { |
|
|
await SupplierdeliverRequestMainApi.selfCheckReport(id) |
|
|
if(!res){ |
|
|
.then(async (res) => { |
|
|
|
|
|
if (!res) { |
|
|
message.warning(t('ts.请先上传自检报告!')) |
|
|
message.warning(t('ts.请先上传自检报告!')) |
|
|
return |
|
|
return |
|
|
}else{ |
|
|
} else { |
|
|
// 处理的二次确认 |
|
|
// 处理的二次确认 |
|
|
await message.confirm(t('ts.是否处理所选中数据?')) |
|
|
await message.confirm(t('ts.是否处理所选中数据?')) |
|
|
getLoading = ElLoading.service({ |
|
|
getLoading = ElLoading.service({ |
|
@ -774,9 +944,10 @@ const genRecords = async (id: number) => { |
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
}) |
|
|
}) |
|
|
// 发起处理 |
|
|
// 发起处理 |
|
|
SupplierdeliverRequestMainApi.genRecordsSupplierdeliverRequestMain(id).then(res => { |
|
|
SupplierdeliverRequestMainApi.genRecordsSupplierdeliverRequestMain(id) |
|
|
|
|
|
.then((res) => { |
|
|
message.success(t('ts.处理成功!')) |
|
|
message.success(t('ts.处理成功!')) |
|
|
console.log('resresresresres',res) |
|
|
console.log('resresresresres', res) |
|
|
// 刷新列表 |
|
|
// 刷新列表 |
|
|
getList() |
|
|
getList() |
|
|
console.log('刷新列表') |
|
|
console.log('刷新列表') |
|
@ -784,16 +955,16 @@ const genRecords = async (id: number) => { |
|
|
|
|
|
|
|
|
// 单据打印 |
|
|
// 单据打印 |
|
|
handleDocumentPrint(res) |
|
|
handleDocumentPrint(res) |
|
|
}).catch(err=>{ |
|
|
}) |
|
|
console.log("发起处理",err) |
|
|
.catch((err) => { |
|
|
|
|
|
console.log('发起处理', err) |
|
|
getLoading?.close() |
|
|
getLoading?.close() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}) |
|
|
console.log("自检报告校验异常",err) |
|
|
.catch((err) => { |
|
|
|
|
|
console.log('自检报告校验异常', err) |
|
|
getLoading?.close() |
|
|
getLoading?.close() |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -818,62 +989,41 @@ const handleExport = async () => { |
|
|
// 生成标签 |
|
|
// 生成标签 |
|
|
const isCreateLabel = ref(false) |
|
|
const isCreateLabel = ref(false) |
|
|
const formLabelRef = ref() |
|
|
const formLabelRef = ref() |
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({ |
|
|
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage |
|
|
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage |
|
|
}) |
|
|
}) |
|
|
detatableData.pageSize = 500 |
|
|
detatableData.pageSize = 500 |
|
|
const { getList:getDetailList } = detatableMethods |
|
|
const { getList: getDetailList } = detatableMethods |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 生成标签按钮操作 |
|
|
// 生成标签按钮操作 |
|
|
const submitFormLabel = async (formType, submitData) => { |
|
|
const submitFormLabel = async (list) => { |
|
|
let data = {...submitData} |
|
|
|
|
|
if(data.masterId){ |
|
|
|
|
|
data.id = data.masterId |
|
|
|
|
|
} |
|
|
|
|
|
try { |
|
|
try { |
|
|
console.log("formType==",formType) |
|
|
|
|
|
console.log("data==",data) |
|
|
let data = { |
|
|
data.subList = detatableData.tableList |
|
|
subList:list |
|
|
if(detatableData.tableList.find(item=>item.secondPackUnit==item.packUnit)){ |
|
|
|
|
|
message.warning(t('ts.包装规格1和包装规格2不能相同')) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
// 校验物料包装规格数量是否修改 |
|
|
|
|
|
let flag = false; |
|
|
|
|
|
await SupplierdeliverRequestMainApi.checkPackQty(data).then(async res => { |
|
|
|
|
|
if(res){ |
|
|
|
|
|
await message.confirm(t('ts.是否修改物料包装标包数量')+'?').then(()=>{ |
|
|
|
|
|
flag = true; //修改标包数量 |
|
|
|
|
|
}).catch(() =>{ |
|
|
|
|
|
flag = false |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
flag = true; //修改标包数量 |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
console.log("返回结果",flag); |
|
|
|
|
|
if(flag){ |
|
|
|
|
|
console.log("detatableData",detatableData) |
|
|
|
|
|
await message.confirm(t('ts.是否为此数据生成标签?')) |
|
|
await message.confirm(t('ts.是否为此数据生成标签?')) |
|
|
|
|
|
labelFormRef.value.isLoading = true |
|
|
await SupplierdeliverRequestMainApi.genLabel(data) |
|
|
await SupplierdeliverRequestMainApi.genLabel(data) |
|
|
isCreateLabel.value = true |
|
|
isCreateLabel.value = true |
|
|
message.success(t('ts.创建标签成功')) |
|
|
message.success(t('ts.创建标签成功')) |
|
|
} |
|
|
|
|
|
getList() |
|
|
getList() |
|
|
} finally { |
|
|
} finally { |
|
|
formLabelRef.value.formLoading = false |
|
|
formLabelRef.value.formLoading = false |
|
|
formLabelRef.value.dialogVisible = false |
|
|
formLabelRef.value.dialogVisible = false |
|
|
|
|
|
labelFormRef.value.formLoading = false |
|
|
|
|
|
labelFormRef.value.dialogTableVisible = false |
|
|
|
|
|
labelFormRef.value.isLoading = false |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const clearInput = async (field,row,index) => { |
|
|
const clearInput = async (field, row, index) => { |
|
|
row[field]='' |
|
|
row[field] = '' |
|
|
row['secondPackQty']='' |
|
|
row['secondPackQty'] = '' |
|
|
|
|
|
|
|
|
SupplierdeliverRequestDetailRules.secondPackQty[0].required = false |
|
|
SupplierdeliverRequestDetailRules.secondPackQty[0].required = false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const BASE_URL = getJmreportBaseUrl() |
|
|
const BASE_URL = getJmreportBaseUrl() |
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口 |
|
|
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口 |
|
@ -882,45 +1032,45 @@ getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口 |
|
|
const searchTableRef = ref() |
|
|
const searchTableRef = ref() |
|
|
const labelPrint = async (row) => { |
|
|
const labelPrint = async (row) => { |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
const defaultParams = {'moduleName':'supplier','recordNumber':row.number} |
|
|
const defaultParams = { moduleName: 'supplier', recordNumber: row.number } |
|
|
const {tableObject:tableObjectPrint ,tableMethods} = useTable({ |
|
|
const { tableObject: tableObjectPrint, tableMethods } = useTable({ |
|
|
defaultParams, |
|
|
defaultParams, |
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
|
const { getList:getListPrint } = tableMethods |
|
|
const { getList: getListPrint } = tableMethods |
|
|
getListPrint() |
|
|
getListPrint() |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns |
|
|
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns |
|
|
tableColumns.forEach((item) => { |
|
|
tableColumns.forEach((item) => { |
|
|
item.width = item.table?.width |
|
|
item.width = item.table?.width |
|
|
}) |
|
|
}) |
|
|
searchTableRef.value.openData(t('ts.标签信息'),tableObjectPrint,{tableColumns},true) |
|
|
searchTableRef.value.openData(t('ts.标签信息'), tableObjectPrint, { tableColumns }, true) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 打印全部 |
|
|
// 打印全部 |
|
|
const printAllClick = ()=>{ |
|
|
const printAllClick = () => {} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 批量打印--供应商发货申请 |
|
|
// 批量打印--供应商发货申请 |
|
|
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { |
|
|
console.log('批量打印',val) |
|
|
console.log('批量打印', val) |
|
|
// let rows:any = [] |
|
|
// let rows:any = [] |
|
|
// val.forEach(item=>{ |
|
|
// val.forEach(item=>{ |
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
// }) |
|
|
// }) |
|
|
if(val.length == 0){ |
|
|
if (val.length == 0) { |
|
|
message.warning(t('ts.请先选择要打印的数据')) |
|
|
message.warning(t('ts.请先选择要打印的数据')) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) |
|
|
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) |
|
|
|
|
|
|
|
|
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { |
|
|
await PackageApi.batchPrintingLable(val.map((item1) => item1.number).join(',')) |
|
|
|
|
|
.then((res) => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
window.open(src.value + '&asn_number=' + res) |
|
|
window.open(src.value + '&asn_number=' + res) |
|
|
}).catch(err => { |
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
console.log(err) |
|
|
console.log(err) |
|
|
message.error(t('ts.创建标签失败')) |
|
|
message.error(t('ts.创建标签失败')) |
|
|
}) |
|
|
}) |
|
@ -958,14 +1108,14 @@ const handleDeleteTable = (item, index) => { |
|
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|
const submitForm = async (formType, submitData) => { |
|
|
const submitForm = async (formType, submitData) => { |
|
|
let data = {...submitData} |
|
|
let data = { ...submitData } |
|
|
if(data.masterId){ |
|
|
if (data.masterId) { |
|
|
data.id = data.masterId |
|
|
data.id = data.masterId |
|
|
} |
|
|
} |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
let isHave = data.subList.some((item) => { |
|
|
let isHave = data.subList.some((item) => { |
|
|
console.log("CCCCC",item.expireDate) |
|
|
console.log('CCCCC', item.expireDate) |
|
|
if(item.expireDate != null){ |
|
|
if (item.expireDate != null) { |
|
|
item.produceDate > item.expireDate |
|
|
item.produceDate > item.expireDate |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -976,27 +1126,30 @@ const submitForm = async (formType, submitData) => { |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
let planArriveStr = formatDate(data.planArriveTime); |
|
|
let planArriveStr = formatDate(data.planArriveTime) |
|
|
if(planArriveStr > planArriveTimeStr.value){ |
|
|
if (planArriveStr > planArriveTimeStr.value) { |
|
|
let confirmFlag = false; |
|
|
let confirmFlag = false |
|
|
await message.confirm(`${t('ts.计划到货时间大于')}${planArriveTimeStr.value}${t('ts.是否继续?')}`).then(() => { |
|
|
await message |
|
|
console.log("选择了OK") |
|
|
.confirm(`${t('ts.计划到货时间大于')}${planArriveTimeStr.value}${t('ts.是否继续?')}`) |
|
|
|
|
|
.then(() => { |
|
|
|
|
|
console.log('选择了OK') |
|
|
//选择OK |
|
|
//选择OK |
|
|
}).catch(() => { |
|
|
}) |
|
|
|
|
|
.catch(() => { |
|
|
//选择取消 |
|
|
//选择取消 |
|
|
console.log("选择了cancel") |
|
|
console.log('选择了cancel') |
|
|
confirmFlag = true; |
|
|
confirmFlag = true |
|
|
formRef.value.formLoading = false |
|
|
formRef.value.formLoading = false |
|
|
return; |
|
|
return |
|
|
}) |
|
|
}) |
|
|
if(confirmFlag){ |
|
|
if (confirmFlag) { |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if(tableData.value.length <= 0){ |
|
|
if (tableData.value.length <= 0) { |
|
|
message.warning(t('ts.子表明细不能为空!')) |
|
|
message.warning(t('ts.子表明细不能为空!')) |
|
|
formRef.value.formLoading = false |
|
|
formRef.value.formLoading = false |
|
|
return; |
|
|
return |
|
|
} |
|
|
} |
|
|
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data) |
|
|
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -1038,16 +1191,28 @@ const searchFormClick = (searchData) => { |
|
|
getList() // 刷新当前列表 |
|
|
getList() // 刷新当前列表 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const formFormDateChange = (field, val,row, index) => { |
|
|
const formFormDateChange = (field, val, row, index) => { |
|
|
if(field == 'produceDate'){ |
|
|
if (field == 'produceDate') { |
|
|
let produceDateStr = formatDate(val,'YYYYMMDD'); |
|
|
let produceDateStr = formatDate(val, 'YYYYMMDD') |
|
|
row.batch = produceDateStr |
|
|
row.batch = produceDateStr |
|
|
row.supplierBatch = produceDateStr |
|
|
row.supplierBatch = produceDateStr |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const defaultSupplierCode = ref('') |
|
|
|
|
|
const getDefaultSupplier = async () => { |
|
|
|
|
|
let supplier = await SupplierApi.getSupplierPageSCP({ isSearch: false }) |
|
|
|
|
|
if (supplier.list && supplier.list.length > 0) { |
|
|
|
|
|
defaultSupplierCode.value = supplier.list[0]['code'] |
|
|
|
|
|
} else { |
|
|
|
|
|
defaultSupplierCode.value = '' |
|
|
|
|
|
} |
|
|
|
|
|
console.log('defaultSupplierCode', defaultSupplierCode) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
|
|
|
getDefaultSupplier() |
|
|
|
|
|
|
|
|
getList() |
|
|
getList() |
|
|
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate() |
|
|
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate() |
|
|
}) |
|
|
}) |
|
|