|
|
@ -45,6 +45,8 @@ |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
|
:indexTableColumn="3" |
|
|
|
@success="getList" |
|
|
|
:rules="SupplierdeliverRequestMainRules" |
|
|
|
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
@ -99,6 +101,18 @@ |
|
|
|
@submitForm="submitFormLabel" |
|
|
|
:isShowReduceButton="false" |
|
|
|
/> |
|
|
|
<!-- 上传质量报告 --> |
|
|
|
<BasicForm |
|
|
|
ref="ploadQualityReportRef" |
|
|
|
@success="getList" |
|
|
|
:formAllSchemas="UploadQualityReport.allSchemas" |
|
|
|
:tableAllSchemas="UploadQualityReport.allSchemas" |
|
|
|
:tableData="ploadQualityReportTableData" |
|
|
|
@handleAddTable="handleAddTableUploadQualityReport" |
|
|
|
@handleDeleteTable="handleDeleteTableUploadQualityReport" |
|
|
|
@submitForm="submitFormUploadQualityReport" |
|
|
|
:isShowReduceButton="true" |
|
|
|
/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
@ -112,12 +126,12 @@ import { |
|
|
|
SupplierdeliverRequestDetail, |
|
|
|
SupplierdeliverRequestDetailRules, |
|
|
|
SupplierdeliverRequestDetailLabel, |
|
|
|
UploadQualityReport |
|
|
|
} from './supplierdeliverRequestMain.data' |
|
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
|
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { formatDate,addDay } from '@/utils/formatTime' |
|
|
|
import * as itemBasicApi from '@/api/wms/itembasic' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
|
|
|
|
// 供应商发货申请 |
|
|
|
defineOptions({ name: 'SupplierdeliverRequestMain' }) |
|
|
@ -139,25 +153,28 @@ const planArriveTimeStr = ref() |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
|
nextTick(() => { |
|
|
|
console.log("type:",type) |
|
|
|
console.log("formField:",formField) |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
if (formField == 'poNumber') { |
|
|
|
row['poNumber'] = val[0]['poNumber'] |
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
|
row['poLine'] = val[0]['poLine'] |
|
|
|
row['orderQty'] = val[0]['orderQty'] |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
itemBasicApi.getItembasicPage({ |
|
|
|
code: val[0]['itemCode'] |
|
|
|
}).then((res) => { |
|
|
|
let cf = addDay(row['produceDate'],res.list[0].validityDays); |
|
|
|
row['expireDate'] = cf; |
|
|
|
}).catch((err) => { |
|
|
|
console.log(err) |
|
|
|
// row[formField] = val[0][searchField] |
|
|
|
// if (formField == 'poNumber') { |
|
|
|
// row['poNumber'] = val[0]['poNumber'] |
|
|
|
// row['itemCode'] = val[0]['itemCode'] |
|
|
|
// row['poLine'] = val[0]['poLine'] |
|
|
|
// row['orderQty'] = val[0]['orderQty'] |
|
|
|
// row['uom'] = val[0]['uom'] |
|
|
|
// } |
|
|
|
val.forEach(item=>{ |
|
|
|
const newRow = {...row} |
|
|
|
newRow[formField] = item[searchField] |
|
|
|
newRow['poNumber'] = item['poNumber'] |
|
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
|
newRow['poLine'] = item['poLine'] |
|
|
|
newRow['orderQty'] = item['orderQty'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
@ -292,6 +309,7 @@ const isShowMainButtonLabel = (row, val) => { |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), // 打开 |
|
|
|
defaultButtons.mainListPlanUploadQualityReportBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 |
|
|
|
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 |
|
|
|
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // 审批通过 |
|
|
|
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // 驳回按钮 |
|
|
@ -335,6 +353,9 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} else if (val == 'mainPurPlanClo') { |
|
|
|
// 关闭 |
|
|
|
handleClo(row.id) |
|
|
|
} else if (val == 'mainPlanUploadQualityReport') { |
|
|
|
// 上传质量报告 |
|
|
|
handleUploadQualityReport(row.id) |
|
|
|
} else if (val == 'mainPlanSub') { |
|
|
|
// 提交审批 |
|
|
|
handleSub(row.id) |
|
|
@ -475,6 +496,38 @@ const handleOpe = async (id: number) => { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} |
|
|
|
const ploadQualityReportRef = ref() |
|
|
|
const ploadQualityReportTableData = ref([]) |
|
|
|
/** 上传质量报告 */ |
|
|
|
const handleUploadQualityReport = async (id: number) => { |
|
|
|
console.log('UploadQualityReport',UploadQualityReport.allSchemas) |
|
|
|
// ploadQualityReportRef.value.dialogVisible = true |
|
|
|
ploadQualityReportRef.value.open('create', null, null,'上传质量报告')//创建标签页面 createLabel 标题 |
|
|
|
const tableFormKeys = {} |
|
|
|
UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
ploadQualityReportTableData.value = [tableFormKeys] |
|
|
|
} |
|
|
|
const handleAddTableUploadQualityReport = ()=>{ |
|
|
|
const tableFormKeys = {} |
|
|
|
UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
ploadQualityReportTableData.value.push(tableFormKeys) |
|
|
|
} |
|
|
|
const handleDeleteTableUploadQualityReport = (item, index) => { |
|
|
|
ploadQualityReportTableData.value.splice(index, 1) |
|
|
|
} |
|
|
|
|
|
|
|
const submitFormUploadQualityReport = (formType, data) => { |
|
|
|
console.log("formType==",formType) |
|
|
|
console.log("data==",data) |
|
|
|
ploadQualityReportRef.value.dialogVisible = false |
|
|
|
// formLabelRef.value.formLoading = false |
|
|
|
// formLabelRef.value.dialogVisible = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 提交审批按钮操作 */ |
|
|
|
const handleSub = async (id: number) => { |
|
|
|