Compare commits
	
		
			No commits in common. "f5d7d1bf499eaeb7d19308acbe2b5c2e19c3e847" and "087614ead63448c61f14068ee46a104b24dc12b8" have entirely different histories.
		
	
	
		
			f5d7d1bf49
			...
			087614ead6
		
	
		
| @ -1,86 +0,0 @@ | ||||
| import { axios } from '@/utils/request' | ||||
| 
 | ||||
| /** | ||||
|  * 查询分厂炉号对应关系 | ||||
|  * | ||||
|  * @author zhangyn | ||||
|  * @date 2025-10-14 15:21:44 | ||||
|  */ | ||||
| export function scrFactoryHeatPage (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrFactoryHeat/page', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 分厂炉号对应关系列表 | ||||
|  * | ||||
|  * @author zhangyn | ||||
|  * @date 2025-10-14 15:21:44 | ||||
|  */ | ||||
| export function scrFactoryHeatList (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrFactoryHeat/list', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 添加分厂炉号对应关系 | ||||
|  * | ||||
|  * @author zhangyn | ||||
|  * @date 2025-10-14 15:21:44 | ||||
|  */ | ||||
| export function scrFactoryHeatAdd (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrFactoryHeat/add', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 编辑分厂炉号对应关系 | ||||
|  * | ||||
|  * @author zhangyn | ||||
|  * @date 2025-10-14 15:21:44 | ||||
|  */ | ||||
| export function scrFactoryHeatEdit (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrFactoryHeat/edit', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 删除分厂炉号对应关系 | ||||
|  * | ||||
|  * @author zhangyn | ||||
|  * @date 2025-10-14 15:21:44 | ||||
|  */ | ||||
| export function scrFactoryHeatDelete (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrFactoryHeat/delete', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 导出分厂炉号对应关系 | ||||
|  * | ||||
|  * @author zhangyn | ||||
|  * @date 2025-10-14 15:21:44 | ||||
|  */ | ||||
| export function scrFactoryHeatExport (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrFactoryHeat/export', | ||||
|     method: 'get', | ||||
|     params: parameter, | ||||
|     responseType: 'blob' | ||||
|   }) | ||||
| } | ||||
| @ -1,86 +0,0 @@ | ||||
| import { axios } from '@/utils/request' | ||||
| 
 | ||||
| /** | ||||
|  * 查询产量 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:23:48 | ||||
|  */ | ||||
| export function scrProductionPage (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrProduction/page', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 产量列表 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:23:48 | ||||
|  */ | ||||
| export function scrProductionList (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrProduction/list', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 添加产量 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:23:48 | ||||
|  */ | ||||
| export function scrProductionAdd (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrProduction/add', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 编辑产量 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:23:48 | ||||
|  */ | ||||
| export function scrProductionEdit (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrProduction/edit', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 删除产量 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:23:48 | ||||
|  */ | ||||
| export function scrProductionDelete (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrProduction/delete', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 导出产量 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:23:48 | ||||
|  */ | ||||
| export function scrProductionExport (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrProduction/export', | ||||
|     method: 'get', | ||||
|     params: parameter, | ||||
|     responseType: 'blob' | ||||
|   }) | ||||
| } | ||||
| @ -1,86 +0,0 @@ | ||||
| import { axios } from '@/utils/request' | ||||
| 
 | ||||
| /** | ||||
|  * 查询原材料 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:26:34 | ||||
|  */ | ||||
| export function scrRawMaterialsPage (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrRawMaterials/page', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 原材料列表 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:26:34 | ||||
|  */ | ||||
| export function scrRawMaterialsList (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrRawMaterials/list', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 添加原材料 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:26:34 | ||||
|  */ | ||||
| export function scrRawMaterialsAdd (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrRawMaterials/add', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 编辑原材料 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:26:34 | ||||
|  */ | ||||
| export function scrRawMaterialsEdit (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrRawMaterials/edit', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 删除原材料 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:26:34 | ||||
|  */ | ||||
| export function scrRawMaterialsDelete (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrRawMaterials/delete', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 导出原材料 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:26:34 | ||||
|  */ | ||||
| export function scrRawMaterialsExport (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrRawMaterials/export', | ||||
|     method: 'get', | ||||
|     params: parameter, | ||||
|     responseType: 'blob' | ||||
|   }) | ||||
| } | ||||
| @ -1,86 +0,0 @@ | ||||
| import { axios } from '@/utils/request' | ||||
| 
 | ||||
| /** | ||||
|  * 查询安全异常事件 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:27:08 | ||||
|  */ | ||||
| export function scrSecurityPage (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrSecurity/page', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 安全异常事件列表 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:27:08 | ||||
|  */ | ||||
| export function scrSecurityList (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrSecurity/list', | ||||
|     method: 'get', | ||||
|     params: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 添加安全异常事件 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:27:08 | ||||
|  */ | ||||
| export function scrSecurityAdd (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrSecurity/add', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 编辑安全异常事件 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:27:08 | ||||
|  */ | ||||
| export function scrSecurityEdit (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrSecurity/edit', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 删除安全异常事件 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:27:08 | ||||
|  */ | ||||
| export function scrSecurityDelete (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrSecurity/delete', | ||||
|     method: 'post', | ||||
|     data: parameter | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 导出安全异常事件 | ||||
|  * | ||||
|  * @author zyn | ||||
|  * @date 2025-10-14 15:27:08 | ||||
|  */ | ||||
| export function scrSecurityExport (parameter) { | ||||
|   return axios({ | ||||
|     url: '/scrSecurity/export', | ||||
|     method: 'get', | ||||
|     params: parameter, | ||||
|     responseType: 'blob' | ||||
|   }) | ||||
| } | ||||
| @ -18,19 +18,19 @@ | ||||
|               <span>切换应用</span> | ||||
|             </a> | ||||
|           </a-menu-item> | ||||
|           <!-- <a-menu-item key="0"> | ||||
|           <a-menu-item key="0"> | ||||
|             <router-link :to="{ name: 'center' }"> | ||||
|               <a-icon type="user"/> | ||||
|               <span>个人中心</span> | ||||
|             </router-link> | ||||
|           </a-menu-item> --> | ||||
|           <!-- <a-menu-item key="1"> | ||||
|           </a-menu-item> | ||||
|           <a-menu-item key="1"> | ||||
|             <router-link :to="{ name: 'settings' }"> | ||||
|               <a-icon type="setting"/> | ||||
|               <span>账户设置</span> | ||||
|             </router-link> | ||||
|           </a-menu-item> --> | ||||
|           <!-- <a-menu-divider/> --> | ||||
|           </a-menu-item> | ||||
|           <a-menu-divider/> | ||||
|           <a-menu-item key="3"> | ||||
|             <a href="javascript:;" @click="handleLogout"> | ||||
|               <a-icon type="logout"/> | ||||
|  | ||||
| @ -20,11 +20,11 @@ export default { | ||||
|   navTheme: 'dark', // theme for nav menu
 | ||||
|   layout: 'sidemenu', // nav menu position: sidemenu or topmenu
 | ||||
|   contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu
 | ||||
|   fixedHeader: true, // sticky header
 | ||||
|   fixSiderbar: true, // sticky siderbar
 | ||||
|   fixedHeader: false, // sticky header
 | ||||
|   fixSiderbar: false, // sticky siderbar
 | ||||
|   autoHideHeader: false, //  auto hide header
 | ||||
|   colorWeak: false, | ||||
|   multiTab: true, | ||||
|   multiTab: false, | ||||
|   production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true', | ||||
|   // vue-ls options
 | ||||
|   storageOptions: { | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| <template> | ||||
|   <div :style="!$route.meta.hiddenHeaderContent ? 'margin: -24px -24px 0px;' : null"> | ||||
|     <!-- pageHeader , route meta :true on hide --> | ||||
|     <!-- <page-header v-if="!$route.meta.hiddenHeaderContent" :title="pageTitle" :logo="logo" :avatar="avatar"> | ||||
|     <page-header v-if="!$route.meta.hiddenHeaderContent" :title="pageTitle" :logo="logo" :avatar="avatar"> | ||||
|       <slot slot="action" name="action"></slot> | ||||
|       <slot slot="content" name="headerContent"></slot> | ||||
|       <div slot="content" v-if="!this.$slots.headerContent && description"> | ||||
| @ -24,12 +24,13 @@ | ||||
|           /> | ||||
|         </div> | ||||
|         <div class="page-menu-tabs" v-if="tabs && tabs.items"> | ||||
|           <!-- @change="callback" :activeKey="activeKey" --> | ||||
|           <a-tabs :tabBarStyle="{margin: 0}" :activeKey="tabs.active()" @change="tabs.callback"> | ||||
|             <a-tab-pane v-for="item in tabs.items" :tab="item.title" :key="item.key"></a-tab-pane> | ||||
|           </a-tabs> | ||||
|         </div> | ||||
|       </div> | ||||
|     </page-header> --> | ||||
|     </page-header> | ||||
|     <div class="content"> | ||||
|       <div class="page-header-index-wide"> | ||||
|         <slot> | ||||
|  | ||||
| @ -16,4 +16,4 @@ export const setDocumentTitle = function (title) { | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export const domTitle = '雄伟光大' | ||||
| export const domTitle = 'Snowy' | ||||
|  | ||||
| @ -1,92 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item | ||||
|           label="分厂" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入分厂" v-decorator="['branchPlant', {rules: [{required: true, message: '请输入分厂!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉号" v-decorator="['furnaceNumber', {rules: [{required: true, message: '请输入炉号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import { scrFactoryHeatAdd } from '@/api/modular/main/scrfactoryheat/scrFactoryHeatManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
|       }, | ||||
|       /** | ||||
|        * 提交表单 | ||||
|        */ | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             scrFactoryHeatAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败:' + res.message)// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,99 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||
|         <a-form-item | ||||
|           label="分厂" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入分厂" v-decorator="['branchPlant', {rules: [{required: true, message: '请输入分厂!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉号" v-decorator="['furnaceNumber', {rules: [{required: true, message: '请输入炉号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import { scrFactoryHeatEdit } from '@/api/modular/main/scrfactoryheat/scrFactoryHeatManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       // 初始化方法 | ||||
|       edit (record) { | ||||
|         this.visible = true | ||||
|         setTimeout(() => { | ||||
|           this.form.setFieldsValue( | ||||
|             { | ||||
|               id: record.id, | ||||
|               branchPlant: record.branchPlant, | ||||
|               furnaceNumber: record.furnaceNumber | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             scrFactoryHeatEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,167 +0,0 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <a-card :bordered="false" :bodyStyle="tstyle"> | ||||
|       <div class="table-page-search-wrapper"> | ||||
|         <a-form layout="inline"> | ||||
|           <a-row :gutter="48"> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="分厂"> | ||||
|                 <a-input v-model="queryParam.branchPlant" allow-clear placeholder="请输入分厂"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="炉号"> | ||||
|                 <a-input v-model="queryParam.furnaceNumber" allow-clear placeholder="请输入炉号"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <span class="table-page-search-submitButtons"> | ||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> | ||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> | ||||
|               </span> | ||||
|             </a-col> | ||||
|           </a-row> | ||||
|         </a-form> | ||||
|       </div> | ||||
|     </a-card> | ||||
|     <a-card :bordered="false"> | ||||
|       <s-table | ||||
|         ref="table" | ||||
|         :columns="columns" | ||||
|         :data="loadData" | ||||
|         :alert="options.alert" | ||||
|         :rowKey="(record) => record.id" | ||||
|         :rowSelection="options.rowSelection" | ||||
|       > | ||||
|         <template class="table-operator" slot="operator"> | ||||
|           <a-button type="primary" icon="plus" @click="$refs.addForm.add()">新增</a-button> | ||||
|           <a-button type="danger" :disabled="selectedRowKeys.length < 1" @click="batchDelete"><a-icon type="delete"/>批量删除</a-button> | ||||
|           <x-down | ||||
|             ref="batchExport" | ||||
|             @batchExport="batchExport" | ||||
|           /> | ||||
|         </template> | ||||
|         <span slot="action" slot-scope="text, record"> | ||||
|           <a @click="$refs.editForm.edit(record)">编辑</a> | ||||
|           <a-divider type="vertical"/> | ||||
|           <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => singleDelete(record)"> | ||||
|             <a>删除</a> | ||||
|           </a-popconfirm> | ||||
|         </span> | ||||
|       </s-table> | ||||
|       <add-form ref="addForm" @ok="handleOk" /> | ||||
|       <edit-form ref="editForm" @ok="handleOk" /> | ||||
|     </a-card> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown } from '@/components' | ||||
|   import { scrFactoryHeatPage, scrFactoryHeatDelete, scrFactoryHeatExport } from '@/api/modular/main/scrfactoryheat/scrFactoryHeatManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
|   export default { | ||||
|     components: { | ||||
|       STable, | ||||
|       addForm, | ||||
|       editForm, | ||||
|       XDown | ||||
|     }, | ||||
|     data () { | ||||
|       return { | ||||
|         // 查询参数 | ||||
|         queryParam: {}, | ||||
|         // 表头 | ||||
|         columns: [ | ||||
|           { | ||||
|             title: '分厂', | ||||
|             align: 'center', | ||||
|             dataIndex: 'branchPlant' | ||||
|           }, | ||||
|           { | ||||
|             title: '炉号', | ||||
|             align: 'center', | ||||
|             dataIndex: 'furnaceNumber' | ||||
|           } | ||||
|         ], | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrFactoryHeatPage(Object.assign(parameter, this.queryParam)).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
|         selectedRowKeys: [], | ||||
|         selectedRows: [], | ||||
|         options: { | ||||
|           alert: { show: true, clear: () => { this.selectedRowKeys = [] } }, | ||||
|           rowSelection: { | ||||
|             selectedRowKeys: this.selectedRowKeys, | ||||
|             onChange: this.onSelectChange | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     created () { | ||||
|       this.columns.push({ | ||||
|           title: '操作', | ||||
|           width: '150px', | ||||
|           dataIndex: 'action', | ||||
|           scopedSlots: { customRender: 'action' } | ||||
|         }) | ||||
|     }, | ||||
|     methods: { | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|       singleDelete (record) { | ||||
|         const param = [{ 'id': record.id }] | ||||
|         this.scrFactoryHeatDelete(param) | ||||
|       }, | ||||
|       /** | ||||
|        * 批量删除 | ||||
|        */ | ||||
|       batchDelete () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         this.scrFactoryHeatDelete(paramIds) | ||||
|       }, | ||||
|       scrFactoryHeatDelete (record) { | ||||
|         scrFactoryHeatDelete(record).then((res) => { | ||||
|           if (res.success) { | ||||
|             this.$message.success('删除成功') | ||||
|             this.$refs.table.clearRefreshSelected() | ||||
|           } else { | ||||
|             this.$message.error('删除失败') // + res.message | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       /** | ||||
|        * 批量导出 | ||||
|        */ | ||||
|       batchExport () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         scrFactoryHeatExport(paramIds).then((res) => { | ||||
|             this.$refs.batchExport.downloadfile(res) | ||||
|         }) | ||||
|       }, | ||||
|       handleOk () { | ||||
|         this.$refs.table.refresh() | ||||
|       }, | ||||
|       onSelectChange (selectedRowKeys, selectedRows) { | ||||
|         this.selectedRowKeys = selectedRowKeys | ||||
|         this.selectedRows = selectedRows | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| <style lang="less"> | ||||
|   .table-operator { | ||||
|     margin-bottom: 18px; | ||||
|   } | ||||
|   button { | ||||
|     margin-right: 8px; | ||||
|   } | ||||
| </style> | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     title="新增隐患整改" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -9,13 +9,21 @@ | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item | ||||
|           label="年份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年份" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="隐患数量" | ||||
| @ -48,7 +56,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrHideDataAdd } from '@/api/modular/main/scrhidedata/scrHideDataManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -66,7 +73,6 @@ | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
| @ -84,7 +90,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrHideDataAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
| @ -92,7 +97,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败:' + res.message)// + res.message | ||||
|                 this.$message.error('新增失败')// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -102,12 +107,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     title="编辑隐患整改" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -10,13 +10,21 @@ | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||
|         <a-form-item | ||||
|           label="年份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年份" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="隐患数量" | ||||
| @ -49,7 +57,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrHideDataEdit } from '@/api/modular/main/scrhidedata/scrHideDataManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -67,7 +74,6 @@ | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       edit (record) { | ||||
|         this.visible = true | ||||
| @ -75,17 +81,14 @@ | ||||
|           this.form.setFieldsValue( | ||||
|             { | ||||
|               id: record.id, | ||||
|               year: record.year, | ||||
|               month: record.month, | ||||
|               yhsl: record.yhsl, | ||||
|               yzg: record.yzg, | ||||
|               wzg: record.wzg | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|          // 时间单独处理 | ||||
|         if (record.happenTime) { | ||||
|             this.form.getFieldDecorator('happenTime', { initialValue: moment(record.happenTime, 'YYYY-MM-DD') }) | ||||
|             this.happenTimeDateString = moment(record.happenTime).format('YYYY-MM-DD') | ||||
|         } | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
| @ -97,7 +100,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrHideDataEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
| @ -105,7 +107,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||
|                 this.$message.error('编辑失败')//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -115,12 +117,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -4,9 +4,14 @@ | ||||
|       <div class="table-page-search-wrapper"> | ||||
|         <a-form layout="inline"> | ||||
|           <a-row :gutter="48"> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="年份"> | ||||
|                 <a-input-number v-model="queryParam.year" style="width: 100%" allow-clear placeholder="请输入年份"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="月份"> | ||||
|                 <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||
|                 <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
| @ -51,7 +56,6 @@ | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown } from '@/components' | ||||
|   import moment from 'moment' | ||||
|   import { scrHideDataPage, scrHideDataDelete, scrHideDataExport } from '@/api/modular/main/scrhidedata/scrHideDataManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
| @ -68,13 +72,15 @@ | ||||
|         queryParam: {}, | ||||
|         // 表头 | ||||
|         columns: [ | ||||
|           { | ||||
|             title: '年份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'year' | ||||
|           }, | ||||
|           { | ||||
|             title: '月份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'happenTime', | ||||
|             customRender: (text, record) => { | ||||
|               return moment(text).format('YYYY-MM') | ||||
|             } | ||||
|             dataIndex: 'month' | ||||
|           }, | ||||
|           { | ||||
|             title: '隐患数量', | ||||
| @ -95,7 +101,7 @@ | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrHideDataPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||
|           return scrHideDataPage(Object.assign(parameter, this.queryParam)).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
| @ -119,24 +125,6 @@ | ||||
|         }) | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|          /** | ||||
|        * 查询参数组装 | ||||
|        */ | ||||
|       switchingDate () { | ||||
|         const queryParamhappenTime = this.queryParam.happenTimeDate | ||||
|         if (queryParamhappenTime != null) { | ||||
|             this.queryParam.happenTime = moment(queryParamhappenTime).format('YYYY-MM-DD') | ||||
|             if (queryParamhappenTime.length < 1) { | ||||
|                 delete this.queryParam.happenTime | ||||
|             } | ||||
|         } | ||||
|         const obj = JSON.parse(JSON.stringify(this.queryParam)) | ||||
|         return obj | ||||
|       }, | ||||
|       onChangehappenTime(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     title="新增电表" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -17,13 +17,21 @@ | ||||
|         > | ||||
|           <a-input placeholder="请输入电表" v-decorator="['name', {rules: [{required: true, message: '请输入电表!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="年份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年份" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|            <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="累计电量" | ||||
| @ -48,7 +56,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrMeterDataAdd } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -66,7 +73,6 @@ | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
| @ -84,7 +90,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrMeterDataAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
| @ -92,7 +97,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败:' + res.message)// + res.message | ||||
|                 this.$message.error('新增失败')// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -102,12 +107,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     title="编辑电表" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -18,13 +18,21 @@ | ||||
|         > | ||||
|           <a-input placeholder="请输入电表" v-decorator="['name', {rules: [{required: true, message: '请输入电表!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="年份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年份" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="累计电量" | ||||
| @ -49,7 +57,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrMeterDataEdit } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -75,15 +82,13 @@ | ||||
|             { | ||||
|               id: record.id, | ||||
|               name: record.name, | ||||
|               year: record.year, | ||||
|               month: record.month, | ||||
|               totalEcnum: record.totalEcnum, | ||||
|               avgPower: record.avgPower | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|        if (record.happenTime) { | ||||
|             this.form.getFieldDecorator('happenTime', { initialValue: moment(record.happenTime, 'YYYY-MM-DD') }) | ||||
|             this.happenTimeDateString = moment(record.happenTime).format('YYYY-MM-DD') | ||||
|         } | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
| @ -95,7 +100,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrMeterDataEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
| @ -103,7 +107,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||
|                 this.$message.error('编辑失败')//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -113,12 +117,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -10,14 +10,25 @@ | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="月份"> | ||||
|                   <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||
|                 </a-form-item> | ||||
|               <a-form-item label="年份"> | ||||
|                 <a-input-number v-model="queryParam.year" style="width: 100%" allow-clear placeholder="请输入年份"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <template v-if="advanced"> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="月份"> | ||||
|                   <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|             </template> | ||||
|             <a-col :md="8" :sm="24" > | ||||
|               <span class="table-page-search-submitButtons"> | ||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> | ||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> | ||||
|                 <a @click="toggleAdvanced" style="margin-left: 8px"> | ||||
|                   {{ advanced ? '收起' : '展开' }} | ||||
|                   <a-icon :type="advanced ? 'up' : 'down'"/> | ||||
|                 </a> | ||||
|               </span> | ||||
|             </a-col> | ||||
|           </a-row> | ||||
| @ -56,7 +67,6 @@ | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown } from '@/components' | ||||
|   import moment from 'moment' | ||||
|   import { scrMeterDataPage, scrMeterDataDelete, scrMeterDataExport } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
| @ -80,13 +90,15 @@ | ||||
|             align: 'center', | ||||
|             dataIndex: 'name' | ||||
|           }, | ||||
|           { | ||||
|             title: '年份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'year' | ||||
|           }, | ||||
|           { | ||||
|             title: '月份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'happenTime', | ||||
|             customRender: (text, record) => { | ||||
|               return moment(text).format('YYYY-MM') | ||||
|             } | ||||
|             dataIndex: 'month' | ||||
|           }, | ||||
|           { | ||||
|             title: '累计电量', | ||||
| @ -102,7 +114,7 @@ | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrMeterDataPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||
|           return scrMeterDataPage(Object.assign(parameter, this.queryParam)).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
| @ -126,24 +138,6 @@ | ||||
|         }) | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       /** | ||||
|        * 查询参数组装 | ||||
|        */ | ||||
|       switchingDate () { | ||||
|         const queryParamhappenTime = this.queryParam.happenTimeDate | ||||
|         if (queryParamhappenTime != null) { | ||||
|             this.queryParam.happenTime = moment(queryParamhappenTime).format('YYYY-MM-DD') | ||||
|             if (queryParamhappenTime.length < 1) { | ||||
|                 delete this.queryParam.happenTime | ||||
|             } | ||||
|         } | ||||
|         const obj = JSON.parse(JSON.stringify(this.queryParam)) | ||||
|         return obj | ||||
|       }, | ||||
|       onChangehappenTime(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|  | ||||
| @ -1,163 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item | ||||
|           label="日期" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-date-picker style="width: 100%" placeholder="请选择日期" v-decorator="['productionDay',{rules: [{ required: true, message: '请选择日期!' }]}]" @change="productionDayOnChange"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉号" v-decorator="['furnaceNumber', {rules: [{required: true, message: '请输入炉号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="产品" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入产品" v-decorator="['product', {rules: [{required: true, message: '请输入产品!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="产量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入产量" style="width: 100%" v-decorator="['production', {rules: [{required: true, message: '请输入产量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="回收率" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入回收率" style="width: 100%" v-decorator="['passRate', {rules: [{required: true, message: '请输入回收率!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="扣铁粉渣用量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入扣铁粉渣用量" style="width: 100%" v-decorator="['conts', {rules: [{required: true, message: '请输入扣铁粉渣用量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="耗电量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入耗电量" style="width: 100%" v-decorator="['power', {rules: [{required: true, message: '请输入耗电量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="渣Mn" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入渣Mn" style="width: 100%" v-decorator="['slagMn', {rules: [{required: true, message: '请输入渣Mn!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉编号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉编号" v-decorator="['furnaceCode', {rules: [{required: true, message: '请输入炉编号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="单耗" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入单耗" style="width: 100%" v-decorator="['units', {rules: [{required: true, message: '请输入单耗!'}]}]" /> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import { scrProductionAdd } from '@/api/modular/main/scrproduction/scrProductionManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         productionDayDateString: '', | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
|       }, | ||||
|       /** | ||||
|        * 提交表单 | ||||
|        */ | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.productionDay = this.productionDayDateString || null | ||||
|             scrProductionAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败')// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       productionDayOnChange(date, dateString) { | ||||
|         this.productionDayDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.productionDayDateString = '' | ||||
|         this.form.getFieldDecorator('productionDay', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,184 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||
|         <a-form-item | ||||
|           label="日期" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-date-picker style="width: 100%" placeholder="请选择日期" v-decorator="['productionDay',{rules: [{ required: true, message: '请选择日期!' }]}]" @change="productionDayOnChange"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉号" v-decorator="['furnaceNumber', {rules: [{required: true, message: '请输入炉号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="产品" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入产品" v-decorator="['product', {rules: [{required: true, message: '请输入产品!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="产量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入产量" style="width: 100%" v-decorator="['production', {rules: [{required: true, message: '请输入产量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="回收率" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入回收率" style="width: 100%" v-decorator="['passRate', {rules: [{required: true, message: '请输入回收率!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="扣铁粉渣用量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入扣铁粉渣用量" style="width: 100%" v-decorator="['conts', {rules: [{required: true, message: '请输入扣铁粉渣用量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="耗电量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入耗电量" style="width: 100%" v-decorator="['power', {rules: [{required: true, message: '请输入耗电量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="渣Mn" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入渣Mn" style="width: 100%" v-decorator="['slagMn', {rules: [{required: true, message: '请输入渣Mn!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉编号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉编号" v-decorator="['furnaceCode', {rules: [{required: true, message: '请输入炉编号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="单耗" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入单耗" style="width: 100%" v-decorator="['units', {rules: [{required: true, message: '请输入单耗!'}]}]" /> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import moment from 'moment' | ||||
|   import { scrProductionEdit } from '@/api/modular/main/scrproduction/scrProductionManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         productionDayDateString: '', | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       edit (record) { | ||||
|         this.visible = true | ||||
|         setTimeout(() => { | ||||
|           this.form.setFieldsValue( | ||||
|             { | ||||
|               id: record.id, | ||||
|               furnaceNumber: record.furnaceNumber, | ||||
|               product: record.product, | ||||
|               production: record.production, | ||||
|               passRate: record.passRate, | ||||
|               conts: record.conts, | ||||
|               power: record.power, | ||||
|               slagMn: record.slagMn, | ||||
|               furnaceCode: record.furnaceCode, | ||||
|               units: record.units | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|         // 时间单独处理 | ||||
|         if (record.productionDay) { | ||||
|             this.form.getFieldDecorator('productionDay', { initialValue: moment(record.productionDay, 'YYYY-MM-DD') }) | ||||
|             this.productionDayDateString = moment(record.productionDay).format('YYYY-MM-DD') | ||||
|         } | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.productionDay = this.productionDayDateString || null | ||||
|             scrProductionEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败')//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       productionDayOnChange(date, dateString) { | ||||
|         this.productionDayDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.productionDayDateString = '' | ||||
|         this.form.getFieldDecorator('productionDay', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,247 +0,0 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <a-card :bordered="false" :bodyStyle="tstyle"> | ||||
|       <div class="table-page-search-wrapper"> | ||||
|         <a-form layout="inline"> | ||||
|           <a-row :gutter="48"> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="日期"> | ||||
|                 <a-date-picker style="width: 100%" placeholder="请选择日期" v-model="queryParam.productionDayDate" @change="onChangeproductionDay"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="炉号"> | ||||
|                 <a-input v-model="queryParam.furnaceNumber" allow-clear placeholder="请输入炉号"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <template v-if="advanced"> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="产品"> | ||||
|                   <a-input v-model="queryParam.product" allow-clear placeholder="请输入产品"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|             </template> | ||||
|             <a-col :md="8" :sm="24" > | ||||
|               <span class="table-page-search-submitButtons"> | ||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> | ||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> | ||||
|                 <a @click="toggleAdvanced" style="margin-left: 8px"> | ||||
|                   {{ advanced ? '收起' : '展开' }} | ||||
|                   <a-icon :type="advanced ? 'up' : 'down'"/> | ||||
|                 </a> | ||||
|               </span> | ||||
|             </a-col> | ||||
|           </a-row> | ||||
|         </a-form> | ||||
|       </div> | ||||
|     </a-card> | ||||
|     <a-card :bordered="false"> | ||||
|       <s-table | ||||
|         ref="table" | ||||
|         :columns="columns" | ||||
|         :data="loadData" | ||||
|         :alert="options.alert" | ||||
|         :rowKey="(record) => record.id" | ||||
|         :rowSelection="options.rowSelection" | ||||
|       > | ||||
|         <template class="table-operator" slot="operator" > | ||||
|           <a-button type="primary" icon="plus" @click="$refs.addForm.add()">新增</a-button> | ||||
|           <a-button type="danger" :disabled="selectedRowKeys.length < 1" @click="batchDelete"><a-icon type="delete"/>批量删除</a-button> | ||||
|           <x-down | ||||
|             ref="batchExport" | ||||
|             @batchExport="batchExport" | ||||
|           /> | ||||
|         </template> | ||||
|         <span slot="action" slot-scope="text, record"> | ||||
|           <a @click="$refs.editForm.edit(record)">编辑</a> | ||||
|           <a-divider type="vertical" /> | ||||
|           <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => singleDelete(record)"> | ||||
|             <a>删除</a> | ||||
|           </a-popconfirm> | ||||
|         </span> | ||||
|       </s-table> | ||||
|       <add-form ref="addForm" @ok="handleOk" /> | ||||
|       <edit-form ref="editForm" @ok="handleOk" /> | ||||
|     </a-card> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown } from '@/components' | ||||
|   import moment from 'moment' | ||||
|   import { scrProductionPage, scrProductionDelete, scrProductionExport } from '@/api/modular/main/scrproduction/scrProductionManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
|   export default { | ||||
|     components: { | ||||
|       STable, | ||||
|       addForm, | ||||
|       editForm, | ||||
|       XDown | ||||
|     }, | ||||
|     data () { | ||||
|       return { | ||||
|         // 高级搜索 展开/关闭 | ||||
|         advanced: false, | ||||
|         // 查询参数 | ||||
|         queryParam: {}, | ||||
|         // 表头 | ||||
|         columns: [ | ||||
|           { | ||||
|             title: '日期', | ||||
|             align: 'center', | ||||
|             dataIndex: 'productionDay', | ||||
|             customRender: (text) => { | ||||
|               return moment(text).format('YYYY-MM-DD') | ||||
|             } | ||||
|           }, | ||||
|           { | ||||
|             title: '炉号', | ||||
|             align: 'center', | ||||
|             dataIndex: 'furnaceNumber' | ||||
|           }, | ||||
|           { | ||||
|             title: '产品', | ||||
|             align: 'center', | ||||
|             dataIndex: 'product' | ||||
|           }, | ||||
|           { | ||||
|             title: '产量', | ||||
|             align: 'center', | ||||
|             dataIndex: 'production' | ||||
|           }, | ||||
|           { | ||||
|             title: '回收率', | ||||
|             align: 'center', | ||||
|             dataIndex: 'passRate' | ||||
|           }, | ||||
|           { | ||||
|             title: '扣铁粉渣用量', | ||||
|             align: 'center', | ||||
|             dataIndex: 'conts' | ||||
|           }, | ||||
|           { | ||||
|             title: '耗电量', | ||||
|             align: 'center', | ||||
|             dataIndex: 'power' | ||||
|           }, | ||||
|           { | ||||
|             title: '渣Mn', | ||||
|             align: 'center', | ||||
|             dataIndex: 'slagMn' | ||||
|           }, | ||||
|           { | ||||
|             title: '炉编号', | ||||
|             align: 'center', | ||||
|             dataIndex: 'furnaceCode' | ||||
|           }, | ||||
|           { | ||||
|             title: '单耗', | ||||
|             align: 'center', | ||||
|             dataIndex: 'units' | ||||
|           } | ||||
|         ], | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrProductionPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
|         selectedRowKeys: [], | ||||
|         selectedRows: [], | ||||
|         options: { | ||||
|           alert: { show: true, clear: () => { this.selectedRowKeys = [] } }, | ||||
|           rowSelection: { | ||||
|             selectedRowKeys: this.selectedRowKeys, | ||||
|             onChange: this.onSelectChange | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     created () { | ||||
|       if (this.hasPerm('scrProduction:edit') || this.hasPerm('scrProduction:delete')) { | ||||
|         this.columns.push({ | ||||
|           title: '操作', | ||||
|           width: '150px', | ||||
|           dataIndex: 'action', | ||||
|           scopedSlots: { customRender: 'action' } | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       /** | ||||
|        * 查询参数组装 | ||||
|        */ | ||||
|       switchingDate () { | ||||
|         const queryParamproductionDay = this.queryParam.productionDayDate | ||||
|         if (queryParamproductionDay != null) { | ||||
|             this.queryParam.productionDay = moment(queryParamproductionDay).format('YYYY-MM-DD') | ||||
|             if (queryParamproductionDay.length < 1) { | ||||
|                 delete this.queryParam.productionDay | ||||
|             } | ||||
|         } | ||||
|         const obj = JSON.parse(JSON.stringify(this.queryParam)) | ||||
|         return obj | ||||
|       }, | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|       singleDelete (record) { | ||||
|         const param = [{ 'id': record.id }] | ||||
|         this.scrProductionDelete(param) | ||||
|       }, | ||||
|       /** | ||||
|        * 批量删除 | ||||
|        */ | ||||
|       batchDelete () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         this.scrProductionDelete(paramIds) | ||||
|       }, | ||||
|       scrProductionDelete (record) { | ||||
|         scrProductionDelete(record).then((res) => { | ||||
|           if (res.success) { | ||||
|             this.$message.success('删除成功') | ||||
|             this.$refs.table.clearRefreshSelected() | ||||
|           } else { | ||||
|             this.$message.error('删除失败') // + res.message | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       toggleAdvanced () { | ||||
|         this.advanced = !this.advanced | ||||
|       }, | ||||
|       onChangeproductionDay(date, dateString) { | ||||
|         this.productionDayDateString = dateString | ||||
|       }, | ||||
|       /** | ||||
|        * 批量导出 | ||||
|        */ | ||||
|       batchExport () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         scrProductionExport(paramIds).then((res) => { | ||||
|             this.$refs.batchExport.downloadfile(res) | ||||
|         }) | ||||
|       }, | ||||
|       handleOk () { | ||||
|         this.$refs.table.refresh() | ||||
|       }, | ||||
|       onSelectChange (selectedRowKeys, selectedRows) { | ||||
|         this.selectedRowKeys = selectedRowKeys | ||||
|         this.selectedRows = selectedRows | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| <style lang="less"> | ||||
|   .table-operator { | ||||
|     margin-bottom: 18px; | ||||
|   } | ||||
|   button { | ||||
|     margin-right: 8px; | ||||
|   } | ||||
| </style> | ||||
| @ -1,115 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item | ||||
|           label="日期" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-date-picker style="width: 100%" placeholder="请选择日期" v-decorator="['consumptionDay',{rules: [{ required: true, message: '请选择日期!' }]}]" @change="consumptionDayOnChange"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉号" v-decorator="['furnaceNumber', {rules: [{required: true, message: '请输入炉号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="原材料" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入原材料" v-decorator="['rawMaterials', {rules: [{required: true, message: '请输入原材料!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="用量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入用量" style="width: 100%" v-decorator="['consumption', {rules: [{required: true, message: '请输入用量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import { scrRawMaterialsAdd } from '@/api/modular/main/scrrawmaterials/scrRawMaterialsManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         consumptionDayDateString: '', | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
|       }, | ||||
|       /** | ||||
|        * 提交表单 | ||||
|        */ | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.consumptionDay = this.consumptionDayDateString || null | ||||
|             scrRawMaterialsAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败')// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       consumptionDayOnChange(date, dateString) { | ||||
|         this.consumptionDayDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.consumptionDayDateString = '' | ||||
|         this.form.getFieldDecorator('consumptionDay', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,130 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||
|         <a-form-item | ||||
|           label="日期" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-date-picker style="width: 100%" placeholder="请选择日期" v-decorator="['consumptionDay',{rules: [{ required: true, message: '请选择日期!' }]}]" @change="consumptionDayOnChange"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="炉号" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入炉号" v-decorator="['furnaceNumber', {rules: [{required: true, message: '请输入炉号!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="原材料" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入原材料" v-decorator="['rawMaterials', {rules: [{required: true, message: '请输入原材料!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="用量" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入用量" style="width: 100%" v-decorator="['consumption', {rules: [{required: true, message: '请输入用量!'}]}]" /> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import moment from 'moment' | ||||
|   import { scrRawMaterialsEdit } from '@/api/modular/main/scrrawmaterials/scrRawMaterialsManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         consumptionDayDateString: '', | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       edit (record) { | ||||
|         this.visible = true | ||||
|         setTimeout(() => { | ||||
|           this.form.setFieldsValue( | ||||
|             { | ||||
|               id: record.id, | ||||
|               furnaceNumber: record.furnaceNumber, | ||||
|               rawMaterials: record.rawMaterials, | ||||
|               consumption: record.consumption | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|         // 时间单独处理 | ||||
|         if (record.consumptionDay) { | ||||
|             this.form.getFieldDecorator('consumptionDay', { initialValue: moment(record.consumptionDay, 'YYYY-MM-DD') }) | ||||
|             this.consumptionDayDateString = moment(record.consumptionDay).format('YYYY-MM-DD') | ||||
|         } | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.consumptionDay = this.consumptionDayDateString || null | ||||
|             scrRawMaterialsEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败')//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       consumptionDayOnChange(date, dateString) { | ||||
|         this.consumptionDayDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.consumptionDayDateString = '' | ||||
|         this.form.getFieldDecorator('consumptionDay', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,215 +0,0 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <a-card :bordered="false" :bodyStyle="tstyle"> | ||||
|       <div class="table-page-search-wrapper"> | ||||
|         <a-form layout="inline"> | ||||
|           <a-row :gutter="48"> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="日期"> | ||||
|                 <a-date-picker style="width: 100%" placeholder="请选择日期" v-model="queryParam.consumptionDayDate" @change="onChangeconsumptionDay"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="炉号"> | ||||
|                 <a-input v-model="queryParam.furnaceNumber" allow-clear placeholder="请输入炉号"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <template v-if="advanced"> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="原材料"> | ||||
|                   <a-input v-model="queryParam.rawMaterials" allow-clear placeholder="请输入原材料"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|             </template> | ||||
|             <a-col :md="8" :sm="24" > | ||||
|               <span class="table-page-search-submitButtons"> | ||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> | ||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> | ||||
|                 <a @click="toggleAdvanced" style="margin-left: 8px"> | ||||
|                   {{ advanced ? '收起' : '展开' }} | ||||
|                   <a-icon :type="advanced ? 'up' : 'down'"/> | ||||
|                 </a> | ||||
|               </span> | ||||
|             </a-col> | ||||
|           </a-row> | ||||
|         </a-form> | ||||
|       </div> | ||||
|     </a-card> | ||||
|     <a-card :bordered="false"> | ||||
|       <s-table | ||||
|         ref="table" | ||||
|         :columns="columns" | ||||
|         :data="loadData" | ||||
|         :alert="options.alert" | ||||
|         :rowKey="(record) => record.id" | ||||
|         :rowSelection="options.rowSelection" | ||||
|       > | ||||
|         <template class="table-operator" slot="operator"> | ||||
|           <a-button type="primary" icon="plus" @click="$refs.addForm.add()">新增</a-button> | ||||
|           <a-button type="danger" :disabled="selectedRowKeys.length < 1" @click="batchDelete"><a-icon type="delete"/>批量删除</a-button> | ||||
|           <x-down | ||||
|             ref="batchExport" | ||||
|             @batchExport="batchExport" | ||||
|           /> | ||||
|         </template> | ||||
|         <span slot="action" slot-scope="text, record"> | ||||
|           <a @click="$refs.editForm.edit(record)">编辑</a> | ||||
|           <a-divider type="vertical"/> | ||||
|           <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => singleDelete(record)"> | ||||
|             <a>删除</a> | ||||
|           </a-popconfirm> | ||||
|         </span> | ||||
|       </s-table> | ||||
|       <add-form ref="addForm" @ok="handleOk" /> | ||||
|       <edit-form ref="editForm" @ok="handleOk" /> | ||||
|     </a-card> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown } from '@/components' | ||||
|   import moment from 'moment' | ||||
|   import { scrRawMaterialsPage, scrRawMaterialsDelete, scrRawMaterialsExport } from '@/api/modular/main/scrrawmaterials/scrRawMaterialsManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
|   export default { | ||||
|     components: { | ||||
|       STable, | ||||
|       addForm, | ||||
|       editForm, | ||||
|       XDown | ||||
|     }, | ||||
|     data () { | ||||
|       return { | ||||
|         // 高级搜索 展开/关闭 | ||||
|         advanced: false, | ||||
|         // 查询参数 | ||||
|         queryParam: {}, | ||||
|         // 表头 | ||||
|         columns: [ | ||||
|           { | ||||
|             title: '日期', | ||||
|             align: 'center', | ||||
|             dataIndex: 'consumptionDay', | ||||
|             customRender: (text, record) => { | ||||
|               return moment(text).format('YYYY-MM-DD') | ||||
|             } | ||||
|           }, | ||||
|           { | ||||
|             title: '炉号', | ||||
|             align: 'center', | ||||
|             dataIndex: 'furnaceNumber' | ||||
|           }, | ||||
|           { | ||||
|             title: '原材料', | ||||
|             align: 'center', | ||||
|             dataIndex: 'rawMaterials' | ||||
|           }, | ||||
|           { | ||||
|             title: '用量', | ||||
|             align: 'center', | ||||
|             dataIndex: 'consumption' | ||||
|           } | ||||
|         ], | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrRawMaterialsPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
|         selectedRowKeys: [], | ||||
|         selectedRows: [], | ||||
|         options: { | ||||
|           alert: { show: true, clear: () => { this.selectedRowKeys = [] } }, | ||||
|           rowSelection: { | ||||
|             selectedRowKeys: this.selectedRowKeys, | ||||
|             onChange: this.onSelectChange | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     created () { | ||||
|       this.columns.push({ | ||||
|           title: '操作', | ||||
|           width: '150px', | ||||
|           dataIndex: 'action', | ||||
|           scopedSlots: { customRender: 'action' } | ||||
|         }) | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       /** | ||||
|        * 查询参数组装 | ||||
|        */ | ||||
|       switchingDate () { | ||||
|         const queryParamconsumptionDay = this.queryParam.consumptionDayDate | ||||
|         if (queryParamconsumptionDay != null) { | ||||
|             this.queryParam.consumptionDay = moment(queryParamconsumptionDay).format('YYYY-MM-DD') | ||||
|             if (queryParamconsumptionDay.length < 1) { | ||||
|                 delete this.queryParam.consumptionDay | ||||
|             } | ||||
|         } | ||||
|         const obj = JSON.parse(JSON.stringify(this.queryParam)) | ||||
|         return obj | ||||
|       }, | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|       singleDelete (record) { | ||||
|         const param = [{ 'id': record.id }] | ||||
|         this.scrRawMaterialsDelete(param) | ||||
|       }, | ||||
|       /** | ||||
|        * 批量删除 | ||||
|        */ | ||||
|       batchDelete () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         this.scrRawMaterialsDelete(paramIds) | ||||
|       }, | ||||
|       scrRawMaterialsDelete (record) { | ||||
|         scrRawMaterialsDelete(record).then((res) => { | ||||
|           if (res.success) { | ||||
|             this.$message.success('删除成功') | ||||
|             this.$refs.table.clearRefreshSelected() | ||||
|           } else { | ||||
|             this.$message.error('删除失败') // + res.message | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       toggleAdvanced () { | ||||
|         this.advanced = !this.advanced | ||||
|       }, | ||||
|       onChangeconsumptionDay(date, dateString) { | ||||
|         this.consumptionDayDateString = dateString | ||||
|       }, | ||||
|       /** | ||||
|        * 批量导出 | ||||
|        */ | ||||
|       batchExport () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         scrRawMaterialsExport(paramIds).then((res) => { | ||||
|             this.$refs.batchExport.downloadfile(res) | ||||
|         }) | ||||
|       }, | ||||
|       handleOk () { | ||||
|         this.$refs.table.refresh() | ||||
|       }, | ||||
|       onSelectChange (selectedRowKeys, selectedRows) { | ||||
|         this.selectedRowKeys = selectedRowKeys | ||||
|         this.selectedRows = selectedRows | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| <style lang="less"> | ||||
|   .table-operator { | ||||
|     margin-bottom: 18px; | ||||
|   } | ||||
|   button { | ||||
|     margin-right: 8px; | ||||
|   } | ||||
| </style> | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     title="新增风险排查" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -9,13 +9,21 @@ | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item | ||||
|           label="年份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年份" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="已排查" | ||||
| @ -48,7 +56,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrRiskDataAdd } from '@/api/modular/main/scrriskdata/scrRiskDataManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -66,7 +73,6 @@ | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
| @ -84,7 +90,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrRiskDataAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
| @ -92,7 +97,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败:' + res.message)// + res.message | ||||
|                 this.$message.error('新增失败')// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -102,12 +107,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     title="编辑风险排查" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -10,13 +10,21 @@ | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||
|         <a-form-item | ||||
|           label="年份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年份" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="已排查" | ||||
| @ -49,7 +57,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrRiskDataEdit } from '@/api/modular/main/scrriskdata/scrRiskDataManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -67,7 +74,6 @@ | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       edit (record) { | ||||
|         this.visible = true | ||||
| @ -75,16 +81,14 @@ | ||||
|           this.form.setFieldsValue( | ||||
|             { | ||||
|               id: record.id, | ||||
|               year: record.year, | ||||
|               month: record.month, | ||||
|               ypc: record.ypc, | ||||
|               wpc: record.wpc, | ||||
|               cqwpc: record.cqwpc | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|         if (record.happenTime) { | ||||
|             this.form.getFieldDecorator('happenTime', { initialValue: moment(record.happenTime, 'YYYY-MM-DD') }) | ||||
|             this.happenTimeDateString = moment(record.happenTime).format('YYYY-MM-DD') | ||||
|         } | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
| @ -96,7 +100,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrRiskDataEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
| @ -104,7 +107,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||
|                 this.$message.error('编辑失败')//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -114,12 +117,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -4,9 +4,14 @@ | ||||
|       <div class="table-page-search-wrapper" > | ||||
|         <a-form layout="inline"> | ||||
|           <a-row :gutter="48"> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="年份"> | ||||
|                 <a-input-number v-model="queryParam.year" style="width: 100%" allow-clear placeholder="请输入年份"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="月份"> | ||||
|                 <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||
|                 <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
| @ -51,7 +56,6 @@ | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown } from '@/components' | ||||
|   import moment from 'moment' | ||||
|   import { scrRiskDataPage, scrRiskDataDelete, scrRiskDataExport } from '@/api/modular/main/scrriskdata/scrRiskDataManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
| @ -68,13 +72,15 @@ | ||||
|         queryParam: {}, | ||||
|         // 表头 | ||||
|         columns: [ | ||||
|           { | ||||
|             title: '年份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'year' | ||||
|           }, | ||||
|           { | ||||
|             title: '月份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'happenTime', | ||||
|             customRender: (text, record) => { | ||||
|               return moment(text).format('YYYY-MM') | ||||
|             } | ||||
|             dataIndex: 'month' | ||||
|           }, | ||||
|           { | ||||
|             title: '已排查', | ||||
| @ -95,7 +101,7 @@ | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrRiskDataPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||
|           return scrRiskDataPage(Object.assign(parameter, this.queryParam)).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
| @ -119,24 +125,6 @@ | ||||
|         }) | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|          /** | ||||
|        * 查询参数组装 | ||||
|        */ | ||||
|       switchingDate () { | ||||
|         const queryParamhappenTime = this.queryParam.happenTimeDate | ||||
|         if (queryParamhappenTime != null) { | ||||
|             this.queryParam.happenTime = moment(queryParamhappenTime).format('YYYY-MM-DD') | ||||
|             if (queryParamhappenTime.length < 1) { | ||||
|                 delete this.queryParam.happenTime | ||||
|             } | ||||
|         } | ||||
|         const obj = JSON.parse(JSON.stringify(this.queryParam)) | ||||
|         return obj | ||||
|       }, | ||||
|       onChangehappenTime(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|  | ||||
| @ -1,131 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item | ||||
|           label="发生时间" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-date-picker show-time style="width: 100%" placeholder="请选择发生时间" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择发生时间!' }]}]" @change="happenTimeOnChange"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="事件类型" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入事件类型" v-decorator="['eventType', {rules: [{required: true, message: '请输入事件类型!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="标题" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入标题" v-decorator="['title', {rules: [{required: true, message: '请输入标题!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="内容" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-textarea placeholder="请输入内容" v-decorator="['content', {rules: [{required: true, message: '请输入内容!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="应对处理" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-textarea placeholder="请输入应对处理" v-decorator="['cope', {rules: [{required: true, message: '请输入应对处理!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="责任主体" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-textarea placeholder="请输入责任主体" v-decorator="['responsible', {rules: [{required: true, message: '请输入责任主体!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import { scrSecurityAdd } from '@/api/modular/main/scrsecurity/scrSecurityManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         happenTimeDateString: '', | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
|       }, | ||||
|       /** | ||||
|        * 提交表单 | ||||
|        */ | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = this.happenTimeDateString || null | ||||
|             scrSecurityAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败')// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,148 +0,0 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
|     @ok="handleSubmit" | ||||
|     @cancel="handleCancel" | ||||
|   > | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||
|         <a-form-item | ||||
|           label="发生时间" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-date-picker show-time style="width: 100%" placeholder="请选择发生时间" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择发生时间!' }]}]" @change="happenTimeOnChange"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="事件类型" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入事件类型" v-decorator="['eventType', {rules: [{required: true, message: '请输入事件类型!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="标题" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input placeholder="请输入标题" v-decorator="['title', {rules: [{required: true, message: '请输入标题!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="内容" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-textarea placeholder="请输入内容" v-decorator="['content', {rules: [{required: true, message: '请输入内容!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="应对处理" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-textarea placeholder="请输入应对处理" v-decorator="['cope', {rules: [{required: true, message: '请输入应对处理!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="责任主体" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-textarea placeholder="请输入责任主体" v-decorator="['responsible', {rules: [{required: true, message: '请输入责任主体!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/> | ||||
|         </a-form-item> | ||||
|       </a-form> | ||||
|     </a-spin> | ||||
|   </a-modal> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
|   import moment from 'moment' | ||||
|   import { scrSecurityEdit } from '@/api/modular/main/scrsecurity/scrSecurityManage' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
|         labelCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 5 } | ||||
|         }, | ||||
|         wrapperCol: { | ||||
|           xs: { span: 24 }, | ||||
|           sm: { span: 15 } | ||||
|         }, | ||||
|         happenTimeDateString: '', | ||||
|         visible: false, | ||||
|         confirmLoading: false, | ||||
|         form: this.$form.createForm(this) | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       edit (record) { | ||||
|         this.visible = true | ||||
|         setTimeout(() => { | ||||
|           this.form.setFieldsValue( | ||||
|             { | ||||
|               id: record.id, | ||||
|               eventType: record.eventType, | ||||
|               title: record.title, | ||||
|               content: record.content, | ||||
|               cope: record.cope, | ||||
|               responsible: record.responsible | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|         // 时间单独处理 | ||||
|         if (record.happenTime) { | ||||
|             this.form.getFieldDecorator('happenTime', { initialValue: moment(record.happenTime, 'YYYY-MM-DD HH:mm:ss') }) | ||||
|             this.happenTimeDateString = moment(record.happenTime).format('YYYY-MM-DD HH:mm:ss') | ||||
|         } | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
|         this.confirmLoading = true | ||||
|         validateFields((errors, values) => { | ||||
|           if (!errors) { | ||||
|             for (const key in values) { | ||||
|               if (typeof (values[key]) === 'object' && values[key] != null) { | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = this.happenTimeDateString || null | ||||
|             scrSecurityEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
|                 this.confirmLoading = false | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败')//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
|             }) | ||||
|           } else { | ||||
|             this.confirmLoading = false | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| @ -1,253 +0,0 @@ | ||||
| <template> | ||||
|   <div> | ||||
|     <a-card :bordered="false" :bodyStyle="tstyle"> | ||||
|       <div class="table-page-search-wrapper"> | ||||
|         <a-form layout="inline"> | ||||
|           <a-row :gutter="48"> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="发生时间"> | ||||
|                 <a-date-picker style="width: 100%" placeholder="请选择发生时间" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|               <a-form-item label="事件类型"> | ||||
|                 <a-input v-model="queryParam.eventType" allow-clear placeholder="请输入事件类型"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <template v-if="advanced"> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="标题"> | ||||
|                   <a-input v-model="queryParam.title" allow-clear placeholder="请输入标题"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="内容"> | ||||
|                   <a-input v-model="queryParam.content" allow-clear placeholder="请输入内容"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="应对处理"> | ||||
|                   <a-input v-model="queryParam.cope" allow-clear placeholder="请输入应对处理"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="责任主体"> | ||||
|                   <a-input v-model="queryParam.responsible" allow-clear placeholder="请输入责任主体"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|             </template> | ||||
|             <a-col :md="8" :sm="24" > | ||||
|               <span class="table-page-search-submitButtons"> | ||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> | ||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> | ||||
|                 <a @click="toggleAdvanced" style="margin-left: 8px"> | ||||
|                   {{ advanced ? '收起' : '展开' }} | ||||
|                   <a-icon :type="advanced ? 'up' : 'down'"/> | ||||
|                 </a> | ||||
|               </span> | ||||
|             </a-col> | ||||
|           </a-row> | ||||
|         </a-form> | ||||
|       </div> | ||||
|     </a-card> | ||||
|     <a-card :bordered="false"> | ||||
|       <s-table | ||||
|         ref="table" | ||||
|         :columns="columns" | ||||
|         :data="loadData" | ||||
|         :alert="options.alert" | ||||
|         :rowKey="(record) => record.id" | ||||
|         :rowSelection="options.rowSelection" | ||||
|       > | ||||
|         <template class="table-operator" slot="operator"> | ||||
|           <a-button type="primary" icon="plus" @click="$refs.addForm.add()">新增</a-button> | ||||
|           <a-button type="danger" :disabled="selectedRowKeys.length < 1" @click="batchDelete"><a-icon type="delete"/>批量删除</a-button> | ||||
|           <x-down | ||||
|             ref="batchExport" | ||||
|             @batchExport="batchExport" | ||||
|           /> | ||||
|         </template> | ||||
|         <span slot="contentScopedSlots" slot-scope="text"> | ||||
|           <ellipsis :length="10" tooltip>{{ text }}</ellipsis> | ||||
|         </span> | ||||
|         <span slot="copeScopedSlots" slot-scope="text"> | ||||
|           <ellipsis :length="10" tooltip>{{ text }}</ellipsis> | ||||
|         </span> | ||||
|         <span slot="responsibleScopedSlots" slot-scope="text"> | ||||
|           <ellipsis :length="10" tooltip>{{ text }}</ellipsis> | ||||
|         </span> | ||||
|         <span slot="action" slot-scope="text, record"> | ||||
|           <a @click="$refs.editForm.edit(record)">编辑</a> | ||||
|           <a-divider type="vertical" /> | ||||
|           <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => singleDelete(record)"> | ||||
|             <a>删除</a> | ||||
|           </a-popconfirm> | ||||
|         </span> | ||||
|       </s-table> | ||||
|       <add-form ref="addForm" @ok="handleOk" /> | ||||
|       <edit-form ref="editForm" @ok="handleOk" /> | ||||
|     </a-card> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown, Ellipsis } from '@/components' | ||||
|   import moment from 'moment' | ||||
|   import { scrSecurityPage, scrSecurityDelete, scrSecurityExport } from '@/api/modular/main/scrsecurity/scrSecurityManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
|   export default { | ||||
|     components: { | ||||
|       Ellipsis, | ||||
|       STable, | ||||
|       addForm, | ||||
|       editForm, | ||||
|       XDown | ||||
|     }, | ||||
|     data () { | ||||
|       return { | ||||
|         // 高级搜索 展开/关闭 | ||||
|         advanced: false, | ||||
|         // 查询参数 | ||||
|         queryParam: {}, | ||||
|         // 表头 | ||||
|         columns: [ | ||||
|           { | ||||
|             title: '发生时间', | ||||
|             align: 'center', | ||||
|             dataIndex: 'happenTime', | ||||
|             customRender: (text, record) => { | ||||
|               return moment(text).format('YYYY-MM-DD HH:mm:ss') | ||||
|             } | ||||
|           }, | ||||
|           { | ||||
|             title: '事件类型', | ||||
|             align: 'center', | ||||
|             dataIndex: 'eventType' | ||||
|           }, | ||||
|           { | ||||
|             title: '标题', | ||||
|             align: 'center', | ||||
|             dataIndex: 'title' | ||||
|           }, | ||||
|           { | ||||
|             title: '内容', | ||||
|             align: 'center', | ||||
|             dataIndex: 'content', | ||||
|             scopedSlots: { customRender: 'contentScopedSlots' } | ||||
|           }, | ||||
|           { | ||||
|             title: '应对处理', | ||||
|             align: 'center', | ||||
|             dataIndex: 'cope', | ||||
|             scopedSlots: { customRender: 'copeScopedSlots' } | ||||
|           }, | ||||
|           { | ||||
|             title: '责任主体', | ||||
|             align: 'center', | ||||
|             dataIndex: 'responsible', | ||||
|             scopedSlots: { customRender: 'responsibleScopedSlots' } | ||||
|           } | ||||
|         ], | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrSecurityPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
|         selectedRowKeys: [], | ||||
|         selectedRows: [], | ||||
|         options: { | ||||
|           alert: { show: true, clear: () => { this.selectedRowKeys = [] } }, | ||||
|           rowSelection: { | ||||
|             selectedRowKeys: this.selectedRowKeys, | ||||
|             onChange: this.onSelectChange | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     created () { | ||||
|       this.columns.push({ | ||||
|           title: '操作', | ||||
|           width: '150px', | ||||
|           dataIndex: 'action', | ||||
|           scopedSlots: { customRender: 'action' } | ||||
|         }) | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       /** | ||||
|        * 查询参数组装 | ||||
|        */ | ||||
|       switchingDate () { | ||||
|         const queryParamhappenTime = this.queryParam.happenTimeDate | ||||
|         if (queryParamhappenTime != null) { | ||||
|             this.queryParam.happenTime = moment(queryParamhappenTime).format('YYYY-MM-DD') | ||||
|             if (queryParamhappenTime.length < 1) { | ||||
|                 delete this.queryParam.happenTime | ||||
|             } | ||||
|         } | ||||
|         const obj = JSON.parse(JSON.stringify(this.queryParam)) | ||||
|         return obj | ||||
|       }, | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|       singleDelete (record) { | ||||
|         const param = [{ 'id': record.id }] | ||||
|         this.scrSecurityDelete(param) | ||||
|       }, | ||||
|       /** | ||||
|        * 批量删除 | ||||
|        */ | ||||
|       batchDelete () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         this.scrSecurityDelete(paramIds) | ||||
|       }, | ||||
|       scrSecurityDelete (record) { | ||||
|         scrSecurityDelete(record).then((res) => { | ||||
|           if (res.success) { | ||||
|             this.$message.success('删除成功') | ||||
|             this.$refs.table.clearRefreshSelected() | ||||
|           } else { | ||||
|             this.$message.error('删除失败') // + res.message | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       toggleAdvanced () { | ||||
|         this.advanced = !this.advanced | ||||
|       }, | ||||
|       onChangehappenTime(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       /** | ||||
|        * 批量导出 | ||||
|        */ | ||||
|       batchExport () { | ||||
|         const paramIds = this.selectedRowKeys.map((d) => { | ||||
|             return { 'id': d } | ||||
|         }) | ||||
|         scrSecurityExport(paramIds).then((res) => { | ||||
|             this.$refs.batchExport.downloadfile(res) | ||||
|         }) | ||||
|       }, | ||||
|       handleOk () { | ||||
|         this.$refs.table.refresh() | ||||
|       }, | ||||
|       onSelectChange (selectedRowKeys, selectedRows) { | ||||
|         this.selectedRowKeys = selectedRowKeys | ||||
|         this.selectedRows = selectedRows | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
| <style lang="less"> | ||||
|   .table-operator { | ||||
|     margin-bottom: 18px; | ||||
|   } | ||||
|   button { | ||||
|     margin-right: 8px; | ||||
|   } | ||||
| </style> | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="新增" | ||||
|     title="新增作业票" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -10,21 +10,29 @@ | ||||
|     <a-spin :spinning="confirmLoading"> | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item | ||||
|           label="作业票" | ||||
|           label="8大作业票" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|         > | ||||
|           <a-select style="width: 100%" placeholder="请选择作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择作业票!' }]}]"> | ||||
|           <a-select style="width: 100%" placeholder="请选择8大作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择8大作业票!' }]}]"> | ||||
|             <a-select-option v-for="(item,index) in nameData" :key="index" :value="item.code">{{ item.name }}</a-select-option> | ||||
|           </a-select> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="年" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="数量" | ||||
| @ -41,7 +49,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrWorkTaskAdd } from '@/api/modular/main/scrworktask/scrWorkTaskManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -60,7 +67,6 @@ | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       add (record) { | ||||
|         this.visible = true | ||||
| @ -80,7 +86,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrWorkTaskAdd(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('新增成功') | ||||
| @ -88,7 +93,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('新增失败:' + res.message)// + res.message | ||||
|                 this.$message.error('新增失败')// + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -98,12 +103,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <template> | ||||
|   <a-modal | ||||
|     title="编辑" | ||||
|     title="编辑作业票" | ||||
|     :width="900" | ||||
|     :visible="visible" | ||||
|     :confirmLoading="confirmLoading" | ||||
| @ -11,21 +11,29 @@ | ||||
|       <a-form :form="form"> | ||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||
|         <a-form-item | ||||
|           label="作业票" | ||||
|           label="8大作业票" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|         > | ||||
|           <a-select style="width: 100%" placeholder="请选择作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择作业票!' }]}]"> | ||||
|           <a-select style="width: 100%" placeholder="请选择8大作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择8大作业票!' }]}]"> | ||||
|             <a-select-option v-for="(item,index) in nameData" :key="index" :value="item.code">{{ item.name }}</a-select-option> | ||||
|           </a-select> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="年" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-input-number placeholder="请输入年" style="width: 100%" v-decorator="['year', {rules: [{required: true, message: '请输入年!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="月份" | ||||
|           :labelCol="labelCol" | ||||
|           :wrapperCol="wrapperCol" | ||||
|           has-feedback | ||||
|         > | ||||
|           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> | ||||
|         </a-form-item> | ||||
|         <a-form-item | ||||
|           label="数量" | ||||
| @ -42,7 +50,6 @@ | ||||
| 
 | ||||
| <script> | ||||
|   import { scrWorkTaskEdit } from '@/api/modular/main/scrworktask/scrWorkTaskManage' | ||||
|   import moment from 'moment' | ||||
|   export default { | ||||
|     data () { | ||||
|       return { | ||||
| @ -61,7 +68,6 @@ | ||||
|       } | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|       // 初始化方法 | ||||
|       edit (record) { | ||||
|         this.visible = true | ||||
| @ -72,14 +78,12 @@ | ||||
|             { | ||||
|               id: record.id, | ||||
|               name: record.name, | ||||
|               year: record.year, | ||||
|               month: record.month, | ||||
|               totalNum: record.totalNum | ||||
|             } | ||||
|           ) | ||||
|         }, 100) | ||||
|         if (record.happenTime) { | ||||
|             this.form.getFieldDecorator('happenTime', { initialValue: moment(record.happenTime, 'YYYY-MM-DD') }) | ||||
|             this.happenTimeDateString = moment(record.happenTime).format('YYYY-MM-DD') | ||||
|         } | ||||
|       }, | ||||
|       handleSubmit () { | ||||
|         const { form: { validateFields } } = this | ||||
| @ -91,7 +95,6 @@ | ||||
|                 values[key] = JSON.stringify(values[key]) | ||||
|               } | ||||
|             } | ||||
|             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||
|             scrWorkTaskEdit(values).then((res) => { | ||||
|               if (res.success) { | ||||
|                 this.$message.success('编辑成功') | ||||
| @ -99,7 +102,7 @@ | ||||
|                 this.$emit('ok', values) | ||||
|                 this.handleCancel() | ||||
|               } else { | ||||
|                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||
|                 this.$message.error('编辑失败')//  + res.message | ||||
|               } | ||||
|             }).finally((res) => { | ||||
|               this.confirmLoading = false | ||||
| @ -109,12 +112,7 @@ | ||||
|           } | ||||
|         }) | ||||
|       }, | ||||
|       happenTimeOnChange(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       handleCancel () { | ||||
|         this.happenTimeDateString = '' | ||||
|         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||
|         this.form.resetFields() | ||||
|         this.visible = false | ||||
|       } | ||||
|  | ||||
| @ -12,14 +12,25 @@ | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="月份"> | ||||
|                   <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||
|                 </a-form-item> | ||||
|               <a-form-item label="年"> | ||||
|                 <a-input-number v-model="queryParam.year" style="width: 100%" allow-clear placeholder="请输入年"/> | ||||
|               </a-form-item> | ||||
|             </a-col> | ||||
|             <template v-if="advanced"> | ||||
|               <a-col :md="8" :sm="24"> | ||||
|                 <a-form-item label="月份"> | ||||
|                   <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> | ||||
|                 </a-form-item> | ||||
|               </a-col> | ||||
|             </template> | ||||
|             <a-col :md="8" :sm="24" > | ||||
|               <span class="table-page-search-submitButtons"> | ||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> | ||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> | ||||
|                 <a @click="toggleAdvanced" style="margin-left: 8px"> | ||||
|                   {{ advanced ? '收起' : '展开' }} | ||||
|                   <a-icon :type="advanced ? 'up' : 'down'"/> | ||||
|                 </a> | ||||
|               </span> | ||||
|             </a-col> | ||||
|           </a-row> | ||||
| @ -61,7 +72,6 @@ | ||||
| </template> | ||||
| <script> | ||||
|   import { STable, XDown } from '@/components' | ||||
|   import moment from 'moment' | ||||
|   import { scrWorkTaskPage, scrWorkTaskDelete, scrWorkTaskExport } from '@/api/modular/main/scrworktask/scrWorkTaskManage' | ||||
|   import addForm from './addForm.vue' | ||||
|   import editForm from './editForm.vue' | ||||
| @ -86,13 +96,15 @@ | ||||
|             dataIndex: 'name', | ||||
|             scopedSlots: { customRender: 'nameScopedSlots' } | ||||
|           }, | ||||
|           { | ||||
|             title: '年份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'year' | ||||
|           }, | ||||
|           { | ||||
|             title: '月份', | ||||
|             align: 'center', | ||||
|             dataIndex: 'happenTime', | ||||
|             customRender: (text, record) => { | ||||
|               return moment(text).format('YYYY-MM') | ||||
|             } | ||||
|             dataIndex: 'month' | ||||
|           }, | ||||
|           { | ||||
|             title: '数量', | ||||
| @ -103,7 +115,7 @@ | ||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||
|         // 加载数据方法 必须为 Promise 对象 | ||||
|         loadData: parameter => { | ||||
|           return scrWorkTaskPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||
|           return scrWorkTaskPage(Object.assign(parameter, this.queryParam)).then((res) => { | ||||
|             return res.data | ||||
|           }) | ||||
|         }, | ||||
| @ -130,24 +142,6 @@ | ||||
|       this.nameData = nameOption.filters['dictData']('work_task_type') | ||||
|     }, | ||||
|     methods: { | ||||
|       moment, | ||||
|          /** | ||||
|        * 查询参数组装 | ||||
|        */ | ||||
|       switchingDate () { | ||||
|         const queryParamhappenTime = this.queryParam.happenTimeDate | ||||
|         if (queryParamhappenTime != null) { | ||||
|             this.queryParam.happenTime = moment(queryParamhappenTime).format('YYYY-MM-DD') | ||||
|             if (queryParamhappenTime.length < 1) { | ||||
|                 delete this.queryParam.happenTime | ||||
|             } | ||||
|         } | ||||
|         const obj = JSON.parse(JSON.stringify(this.queryParam)) | ||||
|         return obj | ||||
|       }, | ||||
|       onChangehappenTime(date, dateString) { | ||||
|         this.happenTimeDateString = dateString | ||||
|       }, | ||||
|       /** | ||||
|        * 单个删除 | ||||
|        */ | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user