作者 张晓杰

Merge branch 'dev' of http://39.105.222.208:1024/leihd/factory-web into dev

不能预览此文件类型
... ... @@ -80,6 +80,29 @@ export function selectUp(url,parameter){
params: parameter
})
}
//生产计划查看
export function queryBynumber(url,parameter){
return axios({
url:url,
method:'get',
params:parameter
})
}
//工序查询
export function querygx(url,parameter){
return axios({
url:url,
method:'get',
params:parameter
})
}
//下载
export function downloadLocal(url){
return axios({
url:url,
method:'get',
})
}
export function getUserList(parameter) {
return axios({
... ...
... ... @@ -249,7 +249,9 @@ export const JeecgListMixin = {
this.$refs.tanForm.title = "工资计算";
this.$refs.tanForm.disableSubmit = false;
},
handleEdit: function (record) {
console.log(record)
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
... ... @@ -288,6 +290,15 @@ export const JeecgListMixin = {
this.$refs.modalForm.title = "详情";
this.$refs.modalForm.disableSubmit = true;
},
// 生产计划查看
handleDetail2: function (record) {
console.log("生产计划查看:",record.orderNumber)
this.$refs.modalForm.edit(record);
this.$refs.modalForm.queryBynumber(record.orderNumber);
this.$refs.modalForm.querygx(record.orderNumber,record.productType)
this.$refs.modalForm.title = "生产订单>详情";
this.$refs.modalForm.disableSubmit = true;
},
/* 导出 */
handleExportXls2() {
let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
... ... @@ -395,6 +406,7 @@ export const JeecgListMixin = {
let url = getFileAccessHttpUrl(text)
window.open(url);
},
}
},
}
\ No newline at end of file
... ...
不能预览此文件类型
... ... @@ -10,7 +10,7 @@
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="岗位" >
<a-form-item label="岗位">
<a-select ref="select" v-model="queryParam.jobTitle" placeholder="请输入岗位" style="width: 285px">
<a-select-option value="OfficeAdministrative">办公室行政人员</a-select-option>
<a-select-option value="WorkshopDirector">车间管理员</a-select-option>
... ... @@ -26,8 +26,8 @@
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="是否在职" >
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="是否在职">
<a-select ref="select" v-model="queryParam.notes" placeholder="请选择是否在职" style="width: 285px">
<a-select-option value="在职">在职</a-select-option>
<a-select-option value="离职">离职</a-select-option>
... ... @@ -46,7 +46,17 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tbl_salary_suanfa')">导出</a-button>
<a-upload
name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
@change="handleImportExcel"
>
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<j-super-query
:fieldList="superFieldList"
ref="superQueryModal"
... ... @@ -136,40 +146,7 @@ export default {
return parseInt(index) + 1
},
},
{
title: '岗位',
align: 'center',
dataIndex: 'jobTitle',
fixed: 'left',
width: 100,
customRender: function (text) {
if (text === 'OfficeAdministrative') {
return '办公室行政人员'
} else if (text === 'WorkshopDirector') {
return '车间管理员'
} else if (text === 'WorkshopTechnicalManager') {
return '车间技术总管'
} else if (text === 'WorkshopTechnician') {
return '车间技术员'
} else if (text === 'WorkshopAuxiliaryPersonnel') {
return '车间辅助人员'
} else if (text === 'PurchasingOfficer') {
return '采购员'
} else if (text === 'ProcurementSupervisor') {
return '采购主管'
} else if (text === 'Assembler') {
return '装配工'
} else if (text === 'AssemblySupervisor') {
return '装配主管'
} else if (text === 'OtherWorker') {
return '其他'
} else if (text === 'WorkshopGeneralWorker') {
return '普工'
} else {
return text
}
},
},
{
title: '工号',
align: 'center',
... ... @@ -180,6 +157,8 @@ export default {
{
title: '姓名',
align: 'center',
fixed: 'left',
width: 100,
dataIndex: 'userName',
},
{
... ... @@ -207,6 +186,39 @@ export default {
dataIndex: 'phone',
},
{
title: '岗位',
align: 'center',
dataIndex: 'jobTitle',
customRender: function (text) {
if (text === 'OfficeAdministrative') {
return '办公室行政人员'
} else if (text === 'WorkshopDirector') {
return '车间管理员'
} else if (text === 'WorkshopTechnicalManager') {
return '车间技术总管'
} else if (text === 'WorkshopTechnician') {
return '车间技术员'
} else if (text === 'WorkshopAuxiliaryPersonnel') {
return '车间辅助人员'
} else if (text === 'PurchasingOfficer') {
return '采购员'
} else if (text === 'ProcurementSupervisor') {
return '采购主管'
} else if (text === 'Assembler') {
return '装配工'
} else if (text === 'AssemblySupervisor') {
return '装配主管'
} else if (text === 'OtherWorker') {
return '其他'
} else if (text === 'WorkshopGeneralWorker') {
return '普工'
} else {
return text
}
},
},
{
title: '学历',
align: 'center',
dataIndex: 'xueli',
... ... @@ -256,7 +268,7 @@ export default {
dataIndex: 'workingPrice',
},
{
title: '全勤奖',
title: '全勤奖',
align: 'center',
dataIndex: 'fullAttendanceAward',
},
... ... @@ -289,12 +301,19 @@ export default {
list: '/salary/base/list',
delete: '/salary/base/del',
deleteBatch: '/salary/base/deleteBatch',
exportXlsUrl: '/salary/base/exportXls',
importExcelUrl: 'salary/base/importExcel',
},
}
},
created() {
this.getSuperFieldList()
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
// handleAddUser() {
// this.$refs.modalFormUser.add()
... ...
... ... @@ -52,6 +52,10 @@
@handleSuperQuery="handleSuperQuery"
></j-super-query>
<a-button type="primary" @click="selectup(salaryMonth)" icon="search">计算</a-button>
<a-button type="primary" @click="downloadFile2('工资导入.xlsx')" download="工资导入.xlsx">导入模版下载</a-button>
<a href="https://feite-1300636907.cos.ap-chongqing.myqcloud.com/工资导入.xlsx" download="工资导入.xlsx"
>下载工资导入文件</a
>
<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>
... ... @@ -59,7 +63,8 @@
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- https://feite-1300636907.cos.ap-chongqing.myqcloud.com/工资导入.xlsx -->
<!-- http://factory.zgftlm.com/mnt/docker/app/factory/工资导入.xlsx -->
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
... ... @@ -117,6 +122,9 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblSalaryCalculationModal from './modules/TblSalaryCalculationModal'
import TblSalaryCalculationBase from './TblSalaryCalculationBase'
import TblSalaryCalculationModalTan from './modules/TblSalaryCalculationModalTan'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Axios from 'axios'
// import TblSalaryCalculationModalTan from './modules/TblSalaryCalculationModalTan.vue'
export default {
name: 'TblSalaryCalculationList',
... ... @@ -198,7 +206,7 @@ export default {
align: 'center',
dataIndex: 'personalTax',
},
{
title: '实发工资',
align: 'center',
... ... @@ -225,6 +233,7 @@ export default {
deleteBatch: '/salary/calculation/deleteBatch',
exportXlsUrl: '/salary/calculation/exportXls',
importExcelUrl: '/salary/calculation/importExcel',
downloadLocal: '/salary/calculation/downloadLocal',
},
dictOptions: {},
superFieldList: [],
... ... @@ -239,12 +248,50 @@ export default {
},
},
methods: {
async downloadFile2(filePath) {
try {
if (!filePath) {
throw new Error('File path is empty.')
}
let token = Vue.ls.get(ACCESS_TOKEN)
console.log(token)
// 发起文件下载请求
const response = await fetch(`http://localhost:8080/jeecg-boot/salary/calculation/download/${filePath}`, {
method: 'GET',
mode: 'cors',
headers: {
'Access-Control-Expose-Headers': 'Content-Disposition',
'X-Access-Token': `${token}`, // 添加身份验证信息
},
credentials: 'include', // 允许发送 Cookie
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
const blob = await response.blob()
const filename = filePath.split('/').pop() // 提取文件名
// 创建临时链接
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.setAttribute('download', filename)
document.body.appendChild(link)
link.click()
// 释放对象 URL
window.URL.revokeObjectURL(url)
document.body.removeChild(link)
} catch (error) {
console.error('Failed to download file:', error)
}
},
// handleAddUser(){
// this.$refs.modalFormUser.add();
// this.$refs.modalFormUser.title = "新增";
// this.$refs.modalFormUser.disableSubmit = false;
// },
handleMonthChange(value) {
this.queryParam.salaryMonth = value ? value.format('YYYY-MM') : null
},
... ...
... ... @@ -176,13 +176,13 @@ export default {
socialPerson: [{ required: true, message: '请输入社保个人!' }],
workingPrice: [{ required: true, message: '请输入工时单价!' }],
xueli: [{ required: true, message: '请输入学历!' }],
ruTime: [{ required: true, message: '请输入入职日期!' }],
// ruTime: [{ required: true, message: '请输入入职日期!' }],
mealAllowancePrice: [{ required: true, message: '请输入餐费津贴标准!' }],
housePrice: [{ required: true, message: '请输入住房津贴标准!' }],
guanliPrice: [{ required: true, message: '请输入管理津贴!' }],
socialTime: [{ required: true, message: '请输入社保起始日期!' }],
// socialTime: [{ required: true, message: '请输入社保起始日期!' }],
notes: [{ required: true, message: '请选择是否在职!' }],
contractTime: [{ required: true, message: '请输入劳动合同周期!' }],
// contractTime: [{ required: true, message: '请输入劳动合同周期!' }],
fullAttendanceAward: [{ required: true, message: '请输入全勤奖!' }],
},
url: {
... ...
<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.danwei"></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.workOrder"></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.productType"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: right; 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>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('tbl_production_plan')">导出</a-button> -->
<!-- <a-upload
name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
@change="handleImportExcel"
>
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query
:fieldList="superFieldList"
ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"
></j-super-query> -->
<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>
<!-- table区域-begin -->
<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="handleDetail2(record)">查看</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">派工</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">验收</a>
</span>
</a-table>
</div>
<tbl-production-plan-modal ref="modalForm" @ok="modalFormOk"></tbl-production-plan-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblProductionPlanModal from './planModules/TblProductionPlanModal'
export default {
name: 'TblProductionPlanList',
mixins: [JeecgListMixin, mixinDevice],
components: {
TblProductionPlanModal,
},
data() {
return {
description: 'tbl_production_plan管理页面',
// 表头
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
},
},
{
title: '订单号',
align: 'center',
dataIndex: 'orderNumber',
},
{
title: '订货单位',
align: 'center',
dataIndex: 'danwei',
},
{
title: '工作令',
align: 'center',
dataIndex: 'workOrder',
},
{
title: '产品名称',
align: 'center',
dataIndex: 'productName',
},
{
title: '产品类型',
align: 'center',
dataIndex: 'productType',
},
{
title: '任务下达时间',
align: 'center',
dataIndex: 'workTime',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
},
{
title: '派工时间',
align: 'center',
dataIndex: 'dispatchTime',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
},
{
title: '交货时间',
align: 'center',
dataIndex: 'deliveryTime',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
},
{
title: '数量(套)',
align: 'center',
dataIndex: 'num',
},
{
title: '总工时',
align: 'center',
dataIndex: 'totalWork',
},
{
title: '已派发工时',
align: 'center',
dataIndex: 'pai',
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 147,
scopedSlots: { customRender: 'action' },
},
],
url: {
list: '/production/tblProductionPlan/list',
delete: '/production/tblProductionPlan/delete',
deleteBatch: '/production/tblProductionPlan/deleteBatch',
exportXlsUrl: '/production/tblProductionPlan/exportXls',
importExcelUrl: 'production/tblProductionPlan/importExcel',
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList()
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
},
methods: {
initDictConfig() {},
getSuperFieldList() {
let fieldList = []
fieldList.push({ type: 'string', value: 'orderNumber', text: '订单号' })
fieldList.push({ type: 'string', value: 'workOrder', text: '工作令' })
fieldList.push({ type: 'string', value: 'productName', text: '产品名称' })
fieldList.push({ type: 'string', value: 'productType', text: '产品类型' })
fieldList.push({ type: 'date', value: 'workTime', text: '任务下达时间' })
fieldList.push({ type: 'date', value: 'dispatchTime', text: '派工时间' })
fieldList.push({ type: 'date', value: 'deliveryTime', text: '交货时间' })
fieldList.push({ type: 'string', value: 'num', text: '数量(套)' })
fieldList.push({ type: 'string', value: 'totalWork', text: '总工时' })
fieldList.push({ type: 'string', value: 'pai', text: '已派发工时' })
this.superFieldList = fieldList
},
},
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
... ...
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<div class="align-colon">
<p style="margin-bottom: 0px;margin-left: 50px;"><span>订单号:</span><a-input v-model="model.orderNumber" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>订货单位:</span><a-input v-model="model.danwei" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>工作令:</span><a-input v-model="model.workOrder" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>产品名称:</span><a-input v-model="model.productName" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>产品类型:</span><a-input v-model="model.productType" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>任务下达时间:</span><a-input v-model="model.workTime" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>派工时间:</span><a-input v-model="model.dispatchTime" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>交货时间:</span><a-input v-model="model.deliveryTime" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>数量(套):</span><a-input v-model="model.num" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-bottom: 0px;margin-left: 50px;"><span>总工时:</span><a-input v-model="model.totalWork" style="width: 200px;border:0px;font-weight: bold;"></a-input></p>
<p style="margin-left: 50px;"><span>已派发工时:</span><a-input v-model="model.pai" style="width: 200px;border:0px"></a-input></p>
<!-- 图片容器 -->
<div class="image-container-wrapper">
<div class="image-container">
<j-image-upload isMultiple v-model="files" class="custom-image"></j-image-upload>
</div>
<div class="image-container">
<j-image-upload isMultiple v-model="imageSrc"></j-image-upload>
</div>
</div>
</div>
<a-table :columns="columns" :data-source="res" style="width: auto" :pagination="false"></a-table>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import Axios from 'axios'
import { queryBynumber, querygx } from '../../../api/manage'
export default {
name: 'TblProductionPlanForm',
components: {},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false,
},
},
data() {
return {
imageSrc: '',
files: '',
model: {},
res:[],
columns: [
{
title: '工序',
align: 'center',
dataIndex: 'workingProcedure',
},
{
title: '承接人',
align: 'center',
dataIndex: 'undertaker',
},
{
title: '工时',
align: 'center',
dataIndex: 'workHours',
},
{
title: '派发时间',
align: 'center',
dataIndex: 'dispatchTime',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
},
{
title: '派发人',
align: 'center',
dataIndex: 'dispatchRen',
},
{
title: '验收时间',
align: 'center',
dataIndex: 'yanTime',
customRender: function (text) {
return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
},
},
{
title: '验收人',
align: 'center',
dataIndex: 'yanRen',
},
{
title: '验收结果',
align: 'center',
dataIndex: 'yanResult',
},
{
title: '备注',
align: 'center',
dataIndex: 'notes',
},
],
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
pai: [{ required: true, message: '请输入已派发工时!' }],
totalWork: [{ required: true, message: '请输入总工时!' }],
deliveryTime: [{ required: true, message: '请输入交货时间!' }],
dispatchTime: [{ required: true, message: '请输入派工时间!' }],
workTime: [{ required: true, message: '请输入任务下达时间!' }],
productType: [{ required: true, message: '请输入产品类型!' }],
productName: [{ required: true, message: '请输入产品名称!' }],
workOrder: [{ required: true, message: '请输入工作令!' }],
danwei: [{ required: true, message: '请输入订货单位!' }],
orderNumber: [{ required: true, message: '请输入订单号!' }],
num: [{ required: true, message: '请输入数量(套)!' }],
},
url: {
add: '/production/tblProductionPlan/add',
edit: '/production/tblProductionPlan/edit',
queryById: '/production/tblProductionPlan/queryById',
queryBynumber: '/production/tblProductionPlan/queryBynumber',
querygx: '/production/tblProductionPlan/querygx',
},
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model))
},
methods: {
querygx(orderNumber,productType) {
querygx(this.url.querygx, this.model).then((res) => {
console.log('工序订单号:', orderNumber)
console.log('工序产品类型:', productType)
console.log("工序查询:",res)
this.res=res.result
})
},
queryBynumber(orderNumber) {
console.log('1订单号:', orderNumber)
queryBynumber(this.url.queryBynumber, this.model).then((res) => {
console.log(res.result)
this.imageSrc = res.result.pics
this.files = res.result.files
console.log('files:', this.files)
console.log(this.imageSrc)
})
},
add() {
this.edit(this.modelDefault)
},
edit(record) {
this.model = Object.assign({}, record)
this.visible = true
},
submitForm() {
const that = this
// 触发表单验证
this.$refs.form.validate((valid) => {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
}
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}
})
},
},
}
</script>
<style scoped>
.align-colon p {
display: flex;
align-items: center;
}
.align-colon p span {
width: 100px; /* 固定文本部分的宽度 */
text-align: right; /* 文本右对齐 */
margin-right: -0px; /* 调整冒号后的空白间距 */
font-weight: bold; /* 将文本加粗 */
}
/* 图片容器及其包裹器的样式 */
.image-container-wrapper {
width: 50%; /* 将图片容器包裹器宽度设置为一半 */
float: right; /* 右浮动 */
margin-top: -300px; /* 调整顶部外边距以与其他内容对齐 */
}
.image-container {
margin-bottom: -10px; /* 图片容器下边距 */
}
.custom-image {
width: 500px; /* 设置图片宽度为200像素 */
height: auto; /* 自动调整高度以保持宽高比 */
}
</style>
\ No newline at end of file
... ...
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tbl-production-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tbl-production-plan-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import TblProductionPlanForm from './TblProductionPlanForm'
export default {
name: 'TblProductionPlanModal',
components: {
TblProductionPlanForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
\ No newline at end of file
... ...
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tbl-production-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tbl-production-plan-form>
</j-modal>
</template>
<script>
import TblProductionPlanForm from './TblProductionPlanForm'
export default {
name: 'TblProductionPlanModal',
components: {
TblProductionPlanForm
},
data () {
return {
title:'',
width:1200,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
queryBynumber(orderNumber){
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.queryBynumber(orderNumber);
})
},
querygx(orderNumber,productType){
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.querygx(orderNumber,productType)
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
\ No newline at end of file
... ...