作者 雷海东

月工时信息、工资基本信息更改

@@ -9,6 +9,14 @@ export function listSalary(parameter) { @@ -9,6 +9,14 @@ export function listSalary(parameter) {
9 }) 9 })
10 } 10 }
11 11
  12 + export function listSalary2(parameter) {
  13 + return axios({
  14 + url: '/salary/base/listSalary2',
  15 + method: 'get',
  16 + data: parameter
  17 + })
  18 + }
  19 +
12 export function queryDesignByOrderId(orderId) { 20 export function queryDesignByOrderId(orderId) {
13 return axios({ 21 return axios({
14 url: '/product_design/tblProductDesign/queryByOrderId/'+orderId, 22 url: '/product_design/tblProductDesign/queryByOrderId/'+orderId,
@@ -104,6 +104,14 @@ export function queryBynumber(url,parameter){ @@ -104,6 +104,14 @@ export function queryBynumber(url,parameter){
104 params:parameter 104 params:parameter
105 }) 105 })
106 } 106 }
  107 +//根据月份、姓名查看工序
  108 +export function queryGxOne(url,parameter){
  109 + return axios({
  110 + url:url,
  111 + method:'get',
  112 + params:parameter
  113 + })
  114 +}
107 //生产计划验收 115 //生产计划验收
108 export function yanshouList(url,parameter){ 116 export function yanshouList(url,parameter){
109 return axios({ 117 return axios({
@@ -313,6 +313,15 @@ export const JeecgListMixin = { @@ -313,6 +313,15 @@ export const JeecgListMixin = {
313 this.$refs.modalForm.title = "生产订单>详情"; 313 this.$refs.modalForm.title = "生产订单>详情";
314 this.$refs.modalForm.disableSubmit = true; 314 this.$refs.modalForm.disableSubmit = true;
315 }, 315 },
  316 + // 根据月份和姓名查看工序
  317 + querygxone: function (record) {
  318 + console.log("月份:",record.salaryMonth)
  319 + console.log("姓名:",record.name)
  320 + this.$refs.modalForm.edit(record);
  321 + this.$refs.modalForm.queryGxOne(record.salaryMonth,record.name);
  322 + this.$refs.modalForm.title = "工序查看";
  323 + this.$refs.modalForm.disableSubmit = true;
  324 + },
316 /* 导出 */ 325 /* 导出 */
317 handleExportXls2() { 326 handleExportXls2() {
318 let paramsStr = encodeURI(JSON.stringify(this.getQueryParams())); 327 let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
@@ -60,7 +60,7 @@ export default { @@ -60,7 +60,7 @@ export default {
60 data() { 60 data() {
61 return { 61 return {
62 options: [{ 62 options: [{
63 - value: '7', 63 + value: 7,
64 label: '7天内订单', 64 label: '7天内订单',
65 }, { 65 }, {
66 value: '15', 66 value: '15',
@@ -94,7 +94,7 @@ export default { @@ -94,7 +94,7 @@ export default {
94 { 94 {
95 title: '编号', 95 title: '编号',
96 align: 'center', 96 align: 'center',
97 - dataIndex: 'id', 97 + dataIndex: 'partNumber',
98 }, 98 },
99 { 99 {
100 title: '品名', 100 title: '品名',
@@ -132,7 +132,7 @@ export default { @@ -132,7 +132,7 @@ export default {
132 { 132 {
133 title: '编号', 133 title: '编号',
134 align: 'center', 134 align: 'center',
135 - dataIndex: 'id', 135 + dataIndex: 'partNumber',
136 }, 136 },
137 { 137 {
138 title: '品名', 138 title: '品名',
@@ -45,10 +45,10 @@ @@ -45,10 +45,10 @@
45 <!-- 操作按钮区域 --> 45 <!-- 操作按钮区域 -->
46 <div class="table-operator"> 46 <div class="table-operator">
47 <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> 47 <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
48 - <!-- <a-button type="primary" icon="download" @click="handleExportXls('订单表')">导出</a-button> 48 + <!-- <a-button type="primary" icon="download" @click="handleExportXls('订单表')">导出</a-button> -->
49 <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> 49 <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
50 <a-button type="primary" icon="import">导入</a-button> 50 <a-button type="primary" icon="import">导入</a-button>
51 - </a-upload> --> 51 + </a-upload>
52 <!-- 高级查询区域 --> 52 <!-- 高级查询区域 -->
53 <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> --> 53 <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
54 </div> 54 </div>
@@ -188,35 +188,7 @@ export default { @@ -188,35 +188,7 @@ export default {
188 { 188 {
189 title: '岗位', 189 title: '岗位',
190 align: 'center', 190 align: 'center',
191 - dataIndex: 'jobTitle',  
192 -  
193 - customRender: function (text) {  
194 - if (text === 'OfficeAdministrative') {  
195 - return '办公室行政人员'  
196 - } else if (text === 'WorkshopDirector') {  
197 - return '车间管理员'  
198 - } else if (text === 'WorkshopTechnicalManager') {  
199 - return '车间技术总管'  
200 - } else if (text === 'WorkshopTechnician') {  
201 - return '车间技术员'  
202 - } else if (text === 'WorkshopAuxiliaryPersonnel') {  
203 - return '车间辅助人员'  
204 - } else if (text === 'PurchasingOfficer') {  
205 - return '采购员'  
206 - } else if (text === 'ProcurementSupervisor') {  
207 - return '采购主管'  
208 - } else if (text === 'Assembler') {  
209 - return '装配工'  
210 - } else if (text === 'AssemblySupervisor') {  
211 - return '装配主管'  
212 - } else if (text === 'OtherWorker') {  
213 - return '其他'  
214 - } else if (text === 'WorkshopGeneralWorker') {  
215 - return '普工'  
216 - } else {  
217 - return text  
218 - }  
219 - }, 191 + dataIndex: 'jobName',
220 }, 192 },
221 { 193 {
222 title: '学历', 194 title: '学历',
@@ -53,9 +53,11 @@ @@ -53,9 +53,11 @@
53 ></j-super-query> 53 ></j-super-query>
54 <a-button type="primary" @click="selectup(salaryMonth)" icon="search">计算</a-button> 54 <a-button type="primary" @click="selectup(salaryMonth)" icon="search">计算</a-button>
55 <a-button type="primary" @click="downloadFile2('工资导入.xlsx')" download="工资导入.xlsx">导入模板下载</a-button> 55 <a-button type="primary" @click="downloadFile2('工资导入.xlsx')" download="工资导入.xlsx">导入模板下载</a-button>
56 - <!-- <a href="https://feite-1300636907.cos.ap-chongqing.myqcloud.com/工资导入.xlsx" download="工资导入.xlsx" 56 + <!--
  57 + <a href="https://feite-1300636907.cos.ap-chongqing.myqcloud.com/工资导入.xlsx" download="工资导入.xlsx"
57 >下载工资导入文件</a 58 >下载工资导入文件</a
58 - > --> 59 + >
  60 + -->
59 <a-dropdown v-if="selectedRowKeys.length > 0"> 61 <a-dropdown v-if="selectedRowKeys.length > 0">
60 <a-menu slot="overlay"> 62 <a-menu slot="overlay">
61 <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item> 63 <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
@@ -153,6 +155,16 @@ export default { @@ -153,6 +155,16 @@ export default {
153 }, 155 },
154 }, 156 },
155 { 157 {
  158 + title: '月份',
  159 + align: 'center',
  160 + dataIndex: 'salaryMonth',
  161 + fixed: 'left',
  162 + width: 100,
  163 + customRender: function (text) {
  164 + return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
  165 + },
  166 + },
  167 + {
156 title: '工号', 168 title: '工号',
157 align: 'center', 169 align: 'center',
158 dataIndex: 'jobId', 170 dataIndex: 'jobId',
@@ -175,7 +175,7 @@ export default { @@ -175,7 +175,7 @@ export default {
175 socialCompany: [{ required: true, message: '请输入社保公司!' }], 175 socialCompany: [{ required: true, message: '请输入社保公司!' }],
176 socialPerson: [{ required: true, message: '请输入社保个人!' }], 176 socialPerson: [{ required: true, message: '请输入社保个人!' }],
177 workingPrice: [{ required: true, message: '请输入工时单价!' }], 177 workingPrice: [{ required: true, message: '请输入工时单价!' }],
178 - xueli: [{ required: true, message: '请输入学历!' }], 178 + //xueli: [{ required: true, message: '请输入学历!' }],
179 // ruTime: [{ required: true, message: '请输入入职日期!' }], 179 // ruTime: [{ required: true, message: '请输入入职日期!' }],
180 mealAllowancePrice: [{ required: true, message: '请输入餐费津贴标准!' }], 180 mealAllowancePrice: [{ required: true, message: '请输入餐费津贴标准!' }],
181 housePrice: [{ required: true, message: '请输入住房津贴标准!' }], 181 housePrice: [{ required: true, message: '请输入住房津贴标准!' }],
@@ -257,6 +257,29 @@ export default { @@ -257,6 +257,29 @@ export default {
257 httpurl += this.url.edit 257 httpurl += this.url.edit
258 method = 'put' 258 method = 'put'
259 } 259 }
  260 + if (this.model.jobTitle === 'OfficeAdministrative') {
  261 + this.model.jobName= '办公室行政人员'
  262 + } else if (this.model.jobTitle === 'WorkshopDirector') {
  263 + this.model.jobName= '车间管理员'
  264 + } else if (this.model.jobTitle === 'WorkshopTechnicalManager') {
  265 + this.model.jobName= '车间技术总管'
  266 + } else if (this.model.jobTitle === 'WorkshopTechnician') {
  267 + this.model.jobName= '车间技术员'
  268 + } else if (this.model.jobTitle === 'WorkshopAuxiliaryPersonnel') {
  269 + this.model.jobName= '车间辅助人员'
  270 + } else if (this.model.jobTitle === 'PurchasingOfficer') {
  271 + this.model.jobName= '采购员'
  272 + } else if (this.model.jobTitle === 'ProcurementSupervisor') {
  273 + this.model.jobName= '采购主管'
  274 + } else if (this.model.jobTitle === 'Assembler') {
  275 + this.model.jobName= '装配工'
  276 + } else if (this.model.jobTitle === 'AssemblySupervisor') {
  277 + this.model.jobName= '装配主管'
  278 + } else if (this.model.jobTitle === 'OtherWorker') {
  279 + this.model.jobName= '其他'
  280 + } else if (this.model.jobTitle === 'WorkshopGeneralWorker') {
  281 + this.model.jobName= '普工'
  282 + }
260 httpAction(httpurl, this.model, method) 283 httpAction(httpurl, this.model, method)
261 .then((res) => { 284 .then((res) => {
262 if (res.success) { 285 if (res.success) {
@@ -61,7 +61,7 @@ import { validateDuplicateValue } from '@/utils/util' @@ -61,7 +61,7 @@ import { validateDuplicateValue } from '@/utils/util'
61 import Axios from 'axios' 61 import Axios from 'axios'
62 import { addPg, gongxuList, queryBynumber, querygx } from '../../../api/manage' 62 import { addPg, gongxuList, queryBynumber, querygx } from '../../../api/manage'
63 import { JeecgListMixin } from '@/mixins/JeecgListMixin' 63 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
64 -import { listSalary } from '@/api/TblSalaryBase' 64 +import { listSalary2 } from '@/api/TblSalaryBase'
65 import { mapGetters } from 'vuex' 65 import { mapGetters } from 'vuex'
66 export default { 66 export default {
67 name: 'TblProductionAddpgForm', 67 name: 'TblProductionAddpgForm',
@@ -152,7 +152,7 @@ export default { @@ -152,7 +152,7 @@ export default {
152 methods: { 152 methods: {
153 loadUser() { 153 loadUser() {
154 var that = this 154 var that = this
155 - listSalary().then((res) => { 155 + listSalary2().then((res) => {
156 if (res.success) { 156 if (res.success) {
157 // that.treeData = []; 157 // that.treeData = [];
158 that.options = res.result 158 that.options = res.result
@@ -223,8 +223,11 @@ export default { @@ -223,8 +223,11 @@ export default {
223 console.log('res:', this.res) 223 console.log('res:', this.res)
224 // 使用 reduce 方法累加工时字段值 224 // 使用 reduce 方法累加工时字段值
225 const zong = this.res.reduce((acc, current) => { 225 const zong = this.res.reduce((acc, current) => {
  226 + if (current.undertaker !== null && current.undertaker !== undefined && current.undertaker !== '') {
226 console.log('current.workhours:', current.workHours) 227 console.log('current.workhours:', current.workHours)
227 return acc + parseFloat(current.workHours) 228 return acc + parseFloat(current.workHours)
  229 + }
  230 + return acc
228 }, 0) 231 }, 0)
229 console.log(this.panduan.dispatchedWorkingHours) 232 console.log(this.panduan.dispatchedWorkingHours)
230 if (this.panduan.dispatchedWorkingHours === '' || this.panduan.dispatchedWorkingHours === null) { 233 if (this.panduan.dispatchedWorkingHours === '' || this.panduan.dispatchedWorkingHours === null) {
  1 +<template>
  2 + <a-card :bordered="false">
  3 + <!-- 查询区域 -->
  4 + <div class="table-page-search-wrapper">
  5 + <a-form layout="inline" @keyup.enter.native="searchQuery">
  6 + <a-row :gutter="24">
  7 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8 + <a-form-item label="姓名">
  9 + <j-input placeholder="请输入姓名" v-model="queryParam.name"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13 + <a-form-item label="工资月份">
  14 + <a-month-picker
  15 + v-model="queryParam.salaryMonth"
  16 + placeholder="请选择工资月份"
  17 + format="YYYY-MM"
  18 + @change="handleMonthChange"
  19 + />
  20 + </a-form-item>
  21 + </a-col>
  22 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  23 + <span style="float: right; overflow: hidden" class="table-page-search-submitButtons">
  24 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  25 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  26 + </span>
  27 + </a-col>
  28 + </a-row>
  29 + </a-form>
  30 + </div>
  31 + <!-- 查询区域-END -->
  32 +
  33 + <!-- 操作按钮区域 -->
  34 + <div class="table-operator">
  35 + <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
  36 + <a-button type="primary" icon="download" @click="handleExportXls('tbl_work_time')">导出</a-button>
  37 + <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  38 + <a-button type="primary" icon="import">导入</a-button>
  39 + </a-upload> -->
  40 + <!-- 高级查询区域 -->
  41 + <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  42 + <a-dropdown v-if="selectedRowKeys.length > 0">
  43 + <a-menu slot="overlay">
  44 + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  45 + </a-menu>
  46 + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  47 + </a-dropdown> -->
  48 + </div>
  49 +
  50 + <!-- table区域-begin -->
  51 + <div>
  52 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  53 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  54 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  55 + </div>
  56 +
  57 + <a-table
  58 + ref="table"
  59 + size="middle"
  60 + :scroll="{x:true}"
  61 + bordered
  62 + rowKey="id"
  63 + :columns="columns"
  64 + :dataSource="dataSource"
  65 + :pagination="ipagination"
  66 + :loading="loading"
  67 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  68 + class="j-table-force-nowrap"
  69 + @change="handleTableChange">
  70 +
  71 + <template slot="htmlSlot" slot-scope="text">
  72 + <div v-html="text"></div>
  73 + </template>
  74 + <template slot="imgSlot" slot-scope="text,record">
  75 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  76 + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  77 + </template>
  78 + <template slot="fileSlot" slot-scope="text">
  79 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  80 + <a-button
  81 + v-else
  82 + :ghost="true"
  83 + type="primary"
  84 + icon="download"
  85 + size="small"
  86 + @click="downloadFile(text)">
  87 + 下载
  88 + </a-button>
  89 + </template>
  90 +
  91 + <span slot="action" slot-scope="text, record">
  92 + <a @click="querygxone(record)">查看本月工作</a>
  93 +
  94 + <a-divider type="vertical" />
  95 + <!-- <a-dropdown>
  96 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  97 + <a-menu slot="overlay">
  98 + <a-menu-item>
  99 + <a @click="handleDetail(record)">详情</a>
  100 + </a-menu-item>
  101 + <a-menu-item>
  102 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  103 + <a>删除</a>
  104 + </a-popconfirm>
  105 + </a-menu-item>
  106 + </a-menu>
  107 + </a-dropdown> -->
  108 + </span>
  109 +
  110 + </a-table>
  111 + </div>
  112 +
  113 + <tbl-work-time-modal ref="modalForm" @ok="modalFormOk"></tbl-work-time-modal>
  114 + </a-card>
  115 +</template>
  116 +
  117 +<script>
  118 +
  119 + import '@/assets/less/TableExpand.less'
  120 + import { mixinDevice } from '@/utils/mixin'
  121 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  122 + import TblWorkTimeModal from './modules/TblWorkTimeModal'
  123 +
  124 + export default {
  125 + name: 'TblWorkTimeList',
  126 + mixins:[JeecgListMixin, mixinDevice],
  127 + components: {
  128 + TblWorkTimeModal
  129 + },
  130 + data () {
  131 + return {
  132 + description: 'tbl_work_time管理页面',
  133 + // 表头
  134 + columns: [
  135 + {
  136 + title: '序号',
  137 + dataIndex: '',
  138 + key:'rowIndex',
  139 + width:60,
  140 + align:"center",
  141 + customRender:function (t,r,index) {
  142 + return parseInt(index)+1;
  143 + }
  144 + },
  145 + {
  146 + title:'月份',
  147 + align:"center",
  148 + dataIndex: 'salaryMonth',
  149 + customRender:function (text) {
  150 + return !text?"":(text.length>10?text.substr(0,10):text)
  151 + }
  152 + },
  153 + {
  154 + title:'姓名',
  155 + align:"center",
  156 + dataIndex: 'name'
  157 + },
  158 + {
  159 + title:'月总工时',
  160 + align:"center",
  161 + dataIndex: 'workTime'
  162 + },
  163 + {
  164 + title: '操作',
  165 + dataIndex: 'action',
  166 + align:"center",
  167 + fixed:"right",
  168 + width:147,
  169 + scopedSlots: { customRender: 'action' }
  170 + }
  171 + ],
  172 + url: {
  173 + list: "/work_time/tblWorkTime/list",
  174 + delete: "/work_time/tblWorkTime/delete",
  175 + deleteBatch: "/work_time/tblWorkTime/deleteBatch",
  176 + exportXlsUrl: "/work_time/tblWorkTime/exportXls",
  177 + importExcelUrl: "work_time/tblWorkTime/importExcel",
  178 +
  179 + },
  180 + dictOptions:{},
  181 + superFieldList:[],
  182 + }
  183 + },
  184 + created() {
  185 + this.getSuperFieldList();
  186 + },
  187 + computed: {
  188 + importExcelUrl: function(){
  189 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  190 + },
  191 + },
  192 + methods: {
  193 + handleMonthChange(value) {
  194 + this.queryParam.salaryMonth = value ? value.format('YYYY-MM') : null
  195 + },
  196 + initDictConfig(){
  197 + },
  198 + getSuperFieldList(){
  199 + let fieldList=[];
  200 + fieldList.push({type:'date',value:'salaryMonth',text:'月份'})
  201 + fieldList.push({type:'string',value:'name',text:'姓名'})
  202 + fieldList.push({type:'string',value:'workTime',text:'月总工时'})
  203 + this.superFieldList = fieldList
  204 + }
  205 + }
  206 + }
  207 +</script>
  208 +<style scoped>
  209 + @import '~@assets/less/common.less';
  210 +</style>
  1 +<template>
  2 + <a-spin :spinning="confirmLoading">
  3 + <j-form-container :disabled="formDisabled">
  4 + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  5 + <a-table ref="table" size="middle" bordered rowKey="id" class="j-table-force-nowrap" :scroll="{ x: true }"
  6 + :columns="columns" :dataSource="res" :pagination="false">
  7 + </a-table>
  8 + </a-form-model>
  9 + </j-form-container>
  10 + </a-spin>
  11 +</template>
  12 +
  13 +<script>
  14 +
  15 + import { httpAction, getAction } from '@/api/manage'
  16 + import { validateDuplicateValue } from '@/utils/util'
  17 +import { queryGxOne } from '../../../api/manage'
  18 +
  19 + export default {
  20 + name: 'TblWorkTimeForm',
  21 + components: {
  22 + },
  23 + props: {
  24 + //表单禁用
  25 + disabled: {
  26 + type: Boolean,
  27 + default: false,
  28 + required: false
  29 + }
  30 + },
  31 + data () {
  32 + return {
  33 + res:[],
  34 + model:{
  35 + },
  36 + columns: [
  37 + {
  38 + title: '工序',
  39 + align: 'center',
  40 + dataIndex: 'workingProcedure',
  41 + },
  42 + {
  43 + title: '承接人',
  44 + align: 'center',
  45 + dataIndex: 'undertaker',
  46 + },
  47 + {
  48 + title: '工时',
  49 + align: 'center',
  50 + dataIndex: 'workHours',
  51 + },
  52 +
  53 + {
  54 + title: '派发时间',
  55 + align: 'center',
  56 + dataIndex: 'dispatchTime',
  57 + customRender: function (text) {
  58 + return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
  59 + },
  60 + },
  61 + {
  62 + title: '派发人',
  63 + align: 'center',
  64 + dataIndex: 'dispatchRen',
  65 + },
  66 + {
  67 + title: '验收时间',
  68 + align: 'center',
  69 + dataIndex: 'yanTime',
  70 + customRender: function (text) {
  71 + return !text ? '' : text.length > 10 ? text.substr(0, 10) : text
  72 + },
  73 + },
  74 + {
  75 + title: '验收人',
  76 + align: 'center',
  77 + dataIndex: 'yanRen',
  78 + },
  79 + {
  80 + title: '验收结果',
  81 + align: 'center',
  82 + dataIndex: 'yanResult',
  83 + },
  84 + {
  85 + title: '备注',
  86 + align: 'center',
  87 + dataIndex: 'notes',
  88 + },
  89 + ],
  90 + labelCol: {
  91 + xs: { span: 24 },
  92 + sm: { span: 5 },
  93 + },
  94 + wrapperCol: {
  95 + xs: { span: 24 },
  96 + sm: { span: 16 },
  97 + },
  98 + confirmLoading: false,
  99 + validatorRules: {
  100 + },
  101 + url: {
  102 + add: "/work_time/tblWorkTime/add",
  103 + edit: "/work_time/tblWorkTime/edit",
  104 + queryById: "/work_time/tblWorkTime/queryById",
  105 + querygxone:"/production/tblProductionPlan/querygxone"
  106 + }
  107 + }
  108 + },
  109 + computed: {
  110 + formDisabled(){
  111 + return this.disabled
  112 + },
  113 + },
  114 + created () {
  115 + //备份model原始值
  116 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  117 + },
  118 + methods: {
  119 + add () {
  120 + this.edit(this.modelDefault);
  121 + },
  122 + edit (record) {
  123 + this.model = Object.assign({}, record);
  124 + this.visible = true;
  125 + },
  126 + queryGxOne(salaryMonth,name){
  127 + queryGxOne(this.url.querygxone,this.model).then((res) =>{
  128 + this.res=res.result
  129 + })
  130 + },
  131 + submitForm () {
  132 + const that = this;
  133 + // 触发表单验证
  134 + this.$refs.form.validate(valid => {
  135 + if (valid) {
  136 + that.confirmLoading = true;
  137 + let httpurl = '';
  138 + let method = '';
  139 + if(!this.model.id){
  140 + httpurl+=this.url.add;
  141 + method = 'post';
  142 + }else{
  143 + httpurl+=this.url.edit;
  144 + method = 'put';
  145 + }
  146 + httpAction(httpurl,this.model,method).then((res)=>{
  147 + if(res.success){
  148 + that.$message.success(res.message);
  149 + that.$emit('ok');
  150 + }else{
  151 + that.$message.warning(res.message);
  152 + }
  153 + }).finally(() => {
  154 + that.confirmLoading = false;
  155 + })
  156 + }
  157 +
  158 + })
  159 + },
  160 + }
  161 + }
  162 +</script>
  1 +<template>
  2 + <a-drawer
  3 + :title="title"
  4 + :width="width"
  5 + placement="right"
  6 + :closable="false"
  7 + @close="close"
  8 + destroyOnClose
  9 + :visible="visible">
  10 + <tbl-work-time-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tbl-work-time-form>
  11 + <div class="drawer-footer">
  12 + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
  13 + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
  14 + </div>
  15 + </a-drawer>
  16 +</template>
  17 +
  18 +<script>
  19 +
  20 + import TblWorkTimeForm from './TblWorkTimeForm'
  21 +
  22 + export default {
  23 + name: 'TblWorkTimeModal',
  24 + components: {
  25 + TblWorkTimeForm
  26 + },
  27 + data () {
  28 + return {
  29 + title:"操作",
  30 + width:800,
  31 + visible: false,
  32 + disableSubmit: false
  33 + }
  34 + },
  35 + methods: {
  36 + add () {
  37 + this.visible=true
  38 + this.$nextTick(()=>{
  39 + this.$refs.realForm.add();
  40 + })
  41 + },
  42 + edit (record) {
  43 + this.visible=true
  44 + this.$nextTick(()=>{
  45 + this.$refs.realForm.edit(record);
  46 + });
  47 + },
  48 + close () {
  49 + this.$emit('close');
  50 + this.visible = false;
  51 + },
  52 + submitCallback(){
  53 + this.$emit('ok');
  54 + this.visible = false;
  55 + },
  56 + handleOk () {
  57 + this.$refs.realForm.submitForm();
  58 + },
  59 + handleCancel () {
  60 + this.close()
  61 + }
  62 + }
  63 + }
  64 +</script>
  65 +
  66 +<style lang="less" scoped>
  67 +/** Button按钮间距 */
  68 + .ant-btn {
  69 + margin-left: 30px;
  70 + margin-bottom: 30px;
  71 + float: right;
  72 + }
  73 + .drawer-footer{
  74 + position: absolute;
  75 + bottom: -8px;
  76 + width: 100%;
  77 + border-top: 1px solid #e8e8e8;
  78 + padding: 10px 16px;
  79 + text-align: right;
  80 + left: 0;
  81 + background: #fff;
  82 + border-radius: 0 0 2px 2px;
  83 + }
  84 +</style>
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + switchFullscreen
  7 + @ok="handleOk"
  8 + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <tbl-work-time-form ref="realForm" @ok="submitCallback"></tbl-work-time-form>
  12 + </j-modal>
  13 +</template>
  14 +
  15 +<script>
  16 +
  17 + import TblWorkTimeForm from './TblWorkTimeForm'
  18 + export default {
  19 + name: 'TblWorkTimeModal',
  20 + components: {
  21 + TblWorkTimeForm
  22 + },
  23 + data () {
  24 + return {
  25 + title:'',
  26 + width:1200,
  27 + visible: false,
  28 + disableSubmit: false
  29 + }
  30 + },
  31 + methods: {
  32 + add () {
  33 + this.visible=true
  34 + this.$nextTick(()=>{
  35 + this.$refs.realForm.add();
  36 + })
  37 + },
  38 + edit (record) {
  39 + this.visible=true
  40 + this.$nextTick(()=>{
  41 + this.$refs.realForm.edit(record);
  42 + })
  43 + },
  44 + queryGxOne (salaryMonth,name) {
  45 + this.visible=true
  46 + this.$nextTick(()=>{
  47 + this.$refs.realForm.queryGxOne(salaryMonth,name);
  48 + })
  49 + },
  50 + close () {
  51 + this.$emit('close');
  52 + this.visible = false;
  53 + },
  54 + handleOk () {
  55 + this.$refs.realForm.submitForm();
  56 + },
  57 + submitCallback(){
  58 + this.$emit('ok');
  59 + this.visible = false;
  60 + },
  61 + handleCancel () {
  62 + this.close()
  63 + }
  64 + }
  65 + }
  66 +</script>