Compare commits
	
		
			2 Commits
		
	
	
		
			087614ead6
			...
			f5d7d1bf49
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | f5d7d1bf49 | ||
|   | 9414356df1 | 
							
								
								
									
										86
									
								
								src/api/modular/main/scrfactoryheat/scrFactoryHeatManage.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								src/api/modular/main/scrfactoryheat/scrFactoryHeatManage.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,86 @@ | |||||||
|  | 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' | ||||||
|  |   }) | ||||||
|  | } | ||||||
							
								
								
									
										86
									
								
								src/api/modular/main/scrproduction/scrProductionManage.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								src/api/modular/main/scrproduction/scrProductionManage.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,86 @@ | |||||||
|  | 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' | ||||||
|  |   }) | ||||||
|  | } | ||||||
| @ -0,0 +1,86 @@ | |||||||
|  | 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' | ||||||
|  |   }) | ||||||
|  | } | ||||||
							
								
								
									
										86
									
								
								src/api/modular/main/scrsecurity/scrSecurityManage.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								src/api/modular/main/scrsecurity/scrSecurityManage.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,86 @@ | |||||||
|  | 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> |               <span>切换应用</span> | ||||||
|             </a> |             </a> | ||||||
|           </a-menu-item> |           </a-menu-item> | ||||||
|           <a-menu-item key="0"> |           <!-- <a-menu-item key="0"> | ||||||
|             <router-link :to="{ name: 'center' }"> |             <router-link :to="{ name: 'center' }"> | ||||||
|               <a-icon type="user"/> |               <a-icon type="user"/> | ||||||
|               <span>个人中心</span> |               <span>个人中心</span> | ||||||
|             </router-link> |             </router-link> | ||||||
|           </a-menu-item> |           </a-menu-item> --> | ||||||
|           <a-menu-item key="1"> |           <!-- <a-menu-item key="1"> | ||||||
|             <router-link :to="{ name: 'settings' }"> |             <router-link :to="{ name: 'settings' }"> | ||||||
|               <a-icon type="setting"/> |               <a-icon type="setting"/> | ||||||
|               <span>账户设置</span> |               <span>账户设置</span> | ||||||
|             </router-link> |             </router-link> | ||||||
|           </a-menu-item> |           </a-menu-item> --> | ||||||
|           <a-menu-divider/> |           <!-- <a-menu-divider/> --> | ||||||
|           <a-menu-item key="3"> |           <a-menu-item key="3"> | ||||||
|             <a href="javascript:;" @click="handleLogout"> |             <a href="javascript:;" @click="handleLogout"> | ||||||
|               <a-icon type="logout"/> |               <a-icon type="logout"/> | ||||||
|  | |||||||
| @ -20,11 +20,11 @@ export default { | |||||||
|   navTheme: 'dark', // theme for nav menu
 |   navTheme: 'dark', // theme for nav menu
 | ||||||
|   layout: 'sidemenu', // nav menu position: sidemenu or topmenu
 |   layout: 'sidemenu', // nav menu position: sidemenu or topmenu
 | ||||||
|   contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu
 |   contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu
 | ||||||
|   fixedHeader: false, // sticky header
 |   fixedHeader: true, // sticky header
 | ||||||
|   fixSiderbar: false, // sticky siderbar
 |   fixSiderbar: true, // sticky siderbar
 | ||||||
|   autoHideHeader: false, //  auto hide header
 |   autoHideHeader: false, //  auto hide header
 | ||||||
|   colorWeak: false, |   colorWeak: false, | ||||||
|   multiTab: false, |   multiTab: true, | ||||||
|   production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true', |   production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true', | ||||||
|   // vue-ls options
 |   // vue-ls options
 | ||||||
|   storageOptions: { |   storageOptions: { | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| <template> | <template> | ||||||
|   <div :style="!$route.meta.hiddenHeaderContent ? 'margin: -24px -24px 0px;' : null"> |   <div :style="!$route.meta.hiddenHeaderContent ? 'margin: -24px -24px 0px;' : null"> | ||||||
|     <!-- pageHeader , route meta :true on hide --> |     <!-- 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="action" name="action"></slot> | ||||||
|       <slot slot="content" name="headerContent"></slot> |       <slot slot="content" name="headerContent"></slot> | ||||||
|       <div slot="content" v-if="!this.$slots.headerContent && description"> |       <div slot="content" v-if="!this.$slots.headerContent && description"> | ||||||
| @ -24,13 +24,12 @@ | |||||||
|           /> |           /> | ||||||
|         </div> |         </div> | ||||||
|         <div class="page-menu-tabs" v-if="tabs && tabs.items"> |         <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-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-tab-pane v-for="item in tabs.items" :tab="item.title" :key="item.key"></a-tab-pane> | ||||||
|           </a-tabs> |           </a-tabs> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|     </page-header> |     </page-header> --> | ||||||
|     <div class="content"> |     <div class="content"> | ||||||
|       <div class="page-header-index-wide"> |       <div class="page-header-index-wide"> | ||||||
|         <slot> |         <slot> | ||||||
|  | |||||||
| @ -16,4 +16,4 @@ export const setDocumentTitle = function (title) { | |||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export const domTitle = 'Snowy' | export const domTitle = '雄伟光大' | ||||||
|  | |||||||
							
								
								
									
										92
									
								
								src/views/main/scrfactoryheat/addForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								src/views/main/scrfactoryheat/addForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,92 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										99
									
								
								src/views/main/scrfactoryheat/editForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								src/views/main/scrfactoryheat/editForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,99 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										167
									
								
								src/views/main/scrfactoryheat/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										167
									
								
								src/views/main/scrfactoryheat/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,167 @@ | |||||||
|  | <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> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="新增隐患整改" |     title="新增" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -9,21 +9,13 @@ | |||||||
|   > |   > | ||||||
|     <a-spin :spinning="confirmLoading"> |     <a-spin :spinning="confirmLoading"> | ||||||
|       <a-form :form="form"> |       <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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="隐患数量" |           label="隐患数量" | ||||||
| @ -56,6 +48,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrHideDataAdd } from '@/api/modular/main/scrhidedata/scrHideDataManage' |   import { scrHideDataAdd } from '@/api/modular/main/scrhidedata/scrHideDataManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -73,6 +66,7 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|  |       moment, | ||||||
|       // 初始化方法 |       // 初始化方法 | ||||||
|       add (record) { |       add (record) { | ||||||
|         this.visible = true |         this.visible = true | ||||||
| @ -90,6 +84,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrHideDataAdd(values).then((res) => { |             scrHideDataAdd(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('新增成功') |                 this.$message.success('新增成功') | ||||||
| @ -97,7 +92,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('新增失败')// + res.message |                 this.$message.error('新增失败:' + res.message)// + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -107,7 +102,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| <template> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="编辑隐患整改" |     title="编辑" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -10,21 +10,13 @@ | |||||||
|     <a-spin :spinning="confirmLoading"> |     <a-spin :spinning="confirmLoading"> | ||||||
|       <a-form :form="form"> |       <a-form :form="form"> | ||||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> |         <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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="隐患数量" |           label="隐患数量" | ||||||
| @ -57,6 +49,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrHideDataEdit } from '@/api/modular/main/scrhidedata/scrHideDataManage' |   import { scrHideDataEdit } from '@/api/modular/main/scrhidedata/scrHideDataManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -74,6 +67,7 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|  |       moment, | ||||||
|       // 初始化方法 |       // 初始化方法 | ||||||
|       edit (record) { |       edit (record) { | ||||||
|         this.visible = true |         this.visible = true | ||||||
| @ -81,14 +75,17 @@ | |||||||
|           this.form.setFieldsValue( |           this.form.setFieldsValue( | ||||||
|             { |             { | ||||||
|               id: record.id, |               id: record.id, | ||||||
|               year: record.year, |  | ||||||
|               month: record.month, |  | ||||||
|               yhsl: record.yhsl, |               yhsl: record.yhsl, | ||||||
|               yzg: record.yzg, |               yzg: record.yzg, | ||||||
|               wzg: record.wzg |               wzg: record.wzg | ||||||
|             } |             } | ||||||
|           ) |           ) | ||||||
|         }, 100) |         }, 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 () { |       handleSubmit () { | ||||||
|         const { form: { validateFields } } = this |         const { form: { validateFields } } = this | ||||||
| @ -100,6 +97,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrHideDataEdit(values).then((res) => { |             scrHideDataEdit(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('编辑成功') |                 this.$message.success('编辑成功') | ||||||
| @ -107,7 +105,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('编辑失败')//  + res.message |                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -117,7 +115,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -4,14 +4,9 @@ | |||||||
|       <div class="table-page-search-wrapper"> |       <div class="table-page-search-wrapper"> | ||||||
|         <a-form layout="inline"> |         <a-form layout="inline"> | ||||||
|           <a-row :gutter="48"> |           <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-col :md="8" :sm="24"> | ||||||
|               <a-form-item label="月份"> |               <a-form-item label="月份"> | ||||||
|                 <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> |                 <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||||
|               </a-form-item> |               </a-form-item> | ||||||
|             </a-col> |             </a-col> | ||||||
|             <a-col :md="8" :sm="24"> |             <a-col :md="8" :sm="24"> | ||||||
| @ -56,6 +51,7 @@ | |||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
|   import { STable, XDown } from '@/components' |   import { STable, XDown } from '@/components' | ||||||
|  |   import moment from 'moment' | ||||||
|   import { scrHideDataPage, scrHideDataDelete, scrHideDataExport } from '@/api/modular/main/scrhidedata/scrHideDataManage' |   import { scrHideDataPage, scrHideDataDelete, scrHideDataExport } from '@/api/modular/main/scrhidedata/scrHideDataManage' | ||||||
|   import addForm from './addForm.vue' |   import addForm from './addForm.vue' | ||||||
|   import editForm from './editForm.vue' |   import editForm from './editForm.vue' | ||||||
| @ -72,15 +68,13 @@ | |||||||
|         queryParam: {}, |         queryParam: {}, | ||||||
|         // 表头 |         // 表头 | ||||||
|         columns: [ |         columns: [ | ||||||
|           { |  | ||||||
|             title: '年份', |  | ||||||
|             align: 'center', |  | ||||||
|             dataIndex: 'year' |  | ||||||
|           }, |  | ||||||
|           { |           { | ||||||
|             title: '月份', |             title: '月份', | ||||||
|             align: 'center', |             align: 'center', | ||||||
|             dataIndex: 'month' |             dataIndex: 'happenTime', | ||||||
|  |             customRender: (text, record) => { | ||||||
|  |               return moment(text).format('YYYY-MM') | ||||||
|  |             } | ||||||
|           }, |           }, | ||||||
|           { |           { | ||||||
|             title: '隐患数量', |             title: '隐患数量', | ||||||
| @ -101,7 +95,7 @@ | |||||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||||
|         // 加载数据方法 必须为 Promise 对象 |         // 加载数据方法 必须为 Promise 对象 | ||||||
|         loadData: parameter => { |         loadData: parameter => { | ||||||
|           return scrHideDataPage(Object.assign(parameter, this.queryParam)).then((res) => { |           return scrHideDataPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||||
|             return res.data |             return res.data | ||||||
|           }) |           }) | ||||||
|         }, |         }, | ||||||
| @ -125,6 +119,24 @@ | |||||||
|         }) |         }) | ||||||
|     }, |     }, | ||||||
|     methods: { |     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> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="新增电表" |     title="新增" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -17,21 +17,13 @@ | |||||||
|         > |         > | ||||||
|           <a-input placeholder="请输入电表" v-decorator="['name', {rules: [{required: true, message: '请输入电表!'}]}]" /> |           <a-input placeholder="请输入电表" v-decorator="['name', {rules: [{required: true, message: '请输入电表!'}]}]" /> | ||||||
|         </a-form-item> |         </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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |            <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="累计电量" |           label="累计电量" | ||||||
| @ -56,6 +48,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrMeterDataAdd } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' |   import { scrMeterDataAdd } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -73,6 +66,7 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|  |       moment, | ||||||
|       // 初始化方法 |       // 初始化方法 | ||||||
|       add (record) { |       add (record) { | ||||||
|         this.visible = true |         this.visible = true | ||||||
| @ -90,6 +84,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrMeterDataAdd(values).then((res) => { |             scrMeterDataAdd(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('新增成功') |                 this.$message.success('新增成功') | ||||||
| @ -97,7 +92,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('新增失败')// + res.message |                 this.$message.error('新增失败:' + res.message)// + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -107,7 +102,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| <template> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="编辑电表" |     title="编辑" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -18,21 +18,13 @@ | |||||||
|         > |         > | ||||||
|           <a-input placeholder="请输入电表" v-decorator="['name', {rules: [{required: true, message: '请输入电表!'}]}]" /> |           <a-input placeholder="请输入电表" v-decorator="['name', {rules: [{required: true, message: '请输入电表!'}]}]" /> | ||||||
|         </a-form-item> |         </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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="累计电量" |           label="累计电量" | ||||||
| @ -57,6 +49,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrMeterDataEdit } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' |   import { scrMeterDataEdit } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -82,13 +75,15 @@ | |||||||
|             { |             { | ||||||
|               id: record.id, |               id: record.id, | ||||||
|               name: record.name, |               name: record.name, | ||||||
|               year: record.year, |  | ||||||
|               month: record.month, |  | ||||||
|               totalEcnum: record.totalEcnum, |               totalEcnum: record.totalEcnum, | ||||||
|               avgPower: record.avgPower |               avgPower: record.avgPower | ||||||
|             } |             } | ||||||
|           ) |           ) | ||||||
|         }, 100) |         }, 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 () { |       handleSubmit () { | ||||||
|         const { form: { validateFields } } = this |         const { form: { validateFields } } = this | ||||||
| @ -100,6 +95,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrMeterDataEdit(values).then((res) => { |             scrMeterDataEdit(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('编辑成功') |                 this.$message.success('编辑成功') | ||||||
| @ -107,7 +103,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('编辑失败')//  + res.message |                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -117,7 +113,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -10,25 +10,14 @@ | |||||||
|               </a-form-item> |               </a-form-item> | ||||||
|             </a-col> |             </a-col> | ||||||
|             <a-col :md="8" :sm="24"> |             <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> |  | ||||||
|             <template v-if="advanced"> |  | ||||||
|               <a-col :md="8" :sm="24"> |  | ||||||
|                 <a-form-item label="月份"> |                 <a-form-item label="月份"> | ||||||
|                   <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> |                   <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||||
|                 </a-form-item> |                 </a-form-item> | ||||||
|               </a-col> |             </a-col> | ||||||
|             </template> |  | ||||||
|             <a-col :md="8" :sm="24" > |             <a-col :md="8" :sm="24" > | ||||||
|               <span class="table-page-search-submitButtons"> |               <span class="table-page-search-submitButtons"> | ||||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> |                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> | ||||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</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> |               </span> | ||||||
|             </a-col> |             </a-col> | ||||||
|           </a-row> |           </a-row> | ||||||
| @ -67,6 +56,7 @@ | |||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
|   import { STable, XDown } from '@/components' |   import { STable, XDown } from '@/components' | ||||||
|  |   import moment from 'moment' | ||||||
|   import { scrMeterDataPage, scrMeterDataDelete, scrMeterDataExport } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' |   import { scrMeterDataPage, scrMeterDataDelete, scrMeterDataExport } from '@/api/modular/main/scrmeterdata/scrMeterDataManage' | ||||||
|   import addForm from './addForm.vue' |   import addForm from './addForm.vue' | ||||||
|   import editForm from './editForm.vue' |   import editForm from './editForm.vue' | ||||||
| @ -90,15 +80,13 @@ | |||||||
|             align: 'center', |             align: 'center', | ||||||
|             dataIndex: 'name' |             dataIndex: 'name' | ||||||
|           }, |           }, | ||||||
|           { |  | ||||||
|             title: '年份', |  | ||||||
|             align: 'center', |  | ||||||
|             dataIndex: 'year' |  | ||||||
|           }, |  | ||||||
|           { |           { | ||||||
|             title: '月份', |             title: '月份', | ||||||
|             align: 'center', |             align: 'center', | ||||||
|             dataIndex: 'month' |             dataIndex: 'happenTime', | ||||||
|  |             customRender: (text, record) => { | ||||||
|  |               return moment(text).format('YYYY-MM') | ||||||
|  |             } | ||||||
|           }, |           }, | ||||||
|           { |           { | ||||||
|             title: '累计电量', |             title: '累计电量', | ||||||
| @ -114,7 +102,7 @@ | |||||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||||
|         // 加载数据方法 必须为 Promise 对象 |         // 加载数据方法 必须为 Promise 对象 | ||||||
|         loadData: parameter => { |         loadData: parameter => { | ||||||
|           return scrMeterDataPage(Object.assign(parameter, this.queryParam)).then((res) => { |           return scrMeterDataPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||||
|             return res.data |             return res.data | ||||||
|           }) |           }) | ||||||
|         }, |         }, | ||||||
| @ -138,6 +126,24 @@ | |||||||
|         }) |         }) | ||||||
|     }, |     }, | ||||||
|     methods: { |     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 | ||||||
|  |       }, | ||||||
|       /** |       /** | ||||||
|        * 单个删除 |        * 单个删除 | ||||||
|        */ |        */ | ||||||
|  | |||||||
							
								
								
									
										163
									
								
								src/views/main/scrproduction/addForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										163
									
								
								src/views/main/scrproduction/addForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,163 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										184
									
								
								src/views/main/scrproduction/editForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										184
									
								
								src/views/main/scrproduction/editForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,184 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										247
									
								
								src/views/main/scrproduction/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										247
									
								
								src/views/main/scrproduction/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,247 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										115
									
								
								src/views/main/scrrawmaterials/addForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								src/views/main/scrrawmaterials/addForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,115 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										130
									
								
								src/views/main/scrrawmaterials/editForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										130
									
								
								src/views/main/scrrawmaterials/editForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,130 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										215
									
								
								src/views/main/scrrawmaterials/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										215
									
								
								src/views/main/scrrawmaterials/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,215 @@ | |||||||
|  | <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> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="新增风险排查" |     title="新增" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -9,21 +9,13 @@ | |||||||
|   > |   > | ||||||
|     <a-spin :spinning="confirmLoading"> |     <a-spin :spinning="confirmLoading"> | ||||||
|       <a-form :form="form"> |       <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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="已排查" |           label="已排查" | ||||||
| @ -56,6 +48,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrRiskDataAdd } from '@/api/modular/main/scrriskdata/scrRiskDataManage' |   import { scrRiskDataAdd } from '@/api/modular/main/scrriskdata/scrRiskDataManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -73,6 +66,7 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|  |       moment, | ||||||
|       // 初始化方法 |       // 初始化方法 | ||||||
|       add (record) { |       add (record) { | ||||||
|         this.visible = true |         this.visible = true | ||||||
| @ -90,6 +84,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrRiskDataAdd(values).then((res) => { |             scrRiskDataAdd(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('新增成功') |                 this.$message.success('新增成功') | ||||||
| @ -97,7 +92,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('新增失败')// + res.message |                 this.$message.error('新增失败:' + res.message)// + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -107,7 +102,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| <template> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="编辑风险排查" |     title="编辑" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -10,21 +10,13 @@ | |||||||
|     <a-spin :spinning="confirmLoading"> |     <a-spin :spinning="confirmLoading"> | ||||||
|       <a-form :form="form"> |       <a-form :form="form"> | ||||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> |         <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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="已排查" |           label="已排查" | ||||||
| @ -57,6 +49,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrRiskDataEdit } from '@/api/modular/main/scrriskdata/scrRiskDataManage' |   import { scrRiskDataEdit } from '@/api/modular/main/scrriskdata/scrRiskDataManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -74,6 +67,7 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|  |       moment, | ||||||
|       // 初始化方法 |       // 初始化方法 | ||||||
|       edit (record) { |       edit (record) { | ||||||
|         this.visible = true |         this.visible = true | ||||||
| @ -81,14 +75,16 @@ | |||||||
|           this.form.setFieldsValue( |           this.form.setFieldsValue( | ||||||
|             { |             { | ||||||
|               id: record.id, |               id: record.id, | ||||||
|               year: record.year, |  | ||||||
|               month: record.month, |  | ||||||
|               ypc: record.ypc, |               ypc: record.ypc, | ||||||
|               wpc: record.wpc, |               wpc: record.wpc, | ||||||
|               cqwpc: record.cqwpc |               cqwpc: record.cqwpc | ||||||
|             } |             } | ||||||
|           ) |           ) | ||||||
|         }, 100) |         }, 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 () { |       handleSubmit () { | ||||||
|         const { form: { validateFields } } = this |         const { form: { validateFields } } = this | ||||||
| @ -100,6 +96,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrRiskDataEdit(values).then((res) => { |             scrRiskDataEdit(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('编辑成功') |                 this.$message.success('编辑成功') | ||||||
| @ -107,7 +104,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('编辑失败')//  + res.message |                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -117,7 +114,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -4,14 +4,9 @@ | |||||||
|       <div class="table-page-search-wrapper" > |       <div class="table-page-search-wrapper" > | ||||||
|         <a-form layout="inline"> |         <a-form layout="inline"> | ||||||
|           <a-row :gutter="48"> |           <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-col :md="8" :sm="24"> | ||||||
|               <a-form-item label="月份"> |               <a-form-item label="月份"> | ||||||
|                 <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> |                 <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||||
|               </a-form-item> |               </a-form-item> | ||||||
|             </a-col> |             </a-col> | ||||||
|             <a-col :md="8" :sm="24"> |             <a-col :md="8" :sm="24"> | ||||||
| @ -56,6 +51,7 @@ | |||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
|   import { STable, XDown } from '@/components' |   import { STable, XDown } from '@/components' | ||||||
|  |   import moment from 'moment' | ||||||
|   import { scrRiskDataPage, scrRiskDataDelete, scrRiskDataExport } from '@/api/modular/main/scrriskdata/scrRiskDataManage' |   import { scrRiskDataPage, scrRiskDataDelete, scrRiskDataExport } from '@/api/modular/main/scrriskdata/scrRiskDataManage' | ||||||
|   import addForm from './addForm.vue' |   import addForm from './addForm.vue' | ||||||
|   import editForm from './editForm.vue' |   import editForm from './editForm.vue' | ||||||
| @ -72,15 +68,13 @@ | |||||||
|         queryParam: {}, |         queryParam: {}, | ||||||
|         // 表头 |         // 表头 | ||||||
|         columns: [ |         columns: [ | ||||||
|           { |  | ||||||
|             title: '年份', |  | ||||||
|             align: 'center', |  | ||||||
|             dataIndex: 'year' |  | ||||||
|           }, |  | ||||||
|           { |           { | ||||||
|             title: '月份', |             title: '月份', | ||||||
|             align: 'center', |             align: 'center', | ||||||
|             dataIndex: 'month' |             dataIndex: 'happenTime', | ||||||
|  |             customRender: (text, record) => { | ||||||
|  |               return moment(text).format('YYYY-MM') | ||||||
|  |             } | ||||||
|           }, |           }, | ||||||
|           { |           { | ||||||
|             title: '已排查', |             title: '已排查', | ||||||
| @ -101,7 +95,7 @@ | |||||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||||
|         // 加载数据方法 必须为 Promise 对象 |         // 加载数据方法 必须为 Promise 对象 | ||||||
|         loadData: parameter => { |         loadData: parameter => { | ||||||
|           return scrRiskDataPage(Object.assign(parameter, this.queryParam)).then((res) => { |           return scrRiskDataPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||||
|             return res.data |             return res.data | ||||||
|           }) |           }) | ||||||
|         }, |         }, | ||||||
| @ -125,6 +119,24 @@ | |||||||
|         }) |         }) | ||||||
|     }, |     }, | ||||||
|     methods: { |     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 | ||||||
|  |       }, | ||||||
|       /** |       /** | ||||||
|        * 单个删除 |        * 单个删除 | ||||||
|        */ |        */ | ||||||
|  | |||||||
							
								
								
									
										131
									
								
								src/views/main/scrsecurity/addForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										131
									
								
								src/views/main/scrsecurity/addForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,131 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										148
									
								
								src/views/main/scrsecurity/editForm.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										148
									
								
								src/views/main/scrsecurity/editForm.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,148 @@ | |||||||
|  | <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> | ||||||
							
								
								
									
										253
									
								
								src/views/main/scrsecurity/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										253
									
								
								src/views/main/scrsecurity/index.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,253 @@ | |||||||
|  | <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> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="新增作业票" |     title="新增" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -10,29 +10,21 @@ | |||||||
|     <a-spin :spinning="confirmLoading"> |     <a-spin :spinning="confirmLoading"> | ||||||
|       <a-form :form="form"> |       <a-form :form="form"> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="8大作业票" |           label="作业票" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|         > |         > | ||||||
|           <a-select style="width: 100%" placeholder="请选择8大作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择8大作业票!' }]}]"> |           <a-select style="width: 100%" placeholder="请选择作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择作业票!' }]}]"> | ||||||
|             <a-select-option v-for="(item,index) in nameData" :key="index" :value="item.code">{{ item.name }}</a-select-option> |             <a-select-option v-for="(item,index) in nameData" :key="index" :value="item.code">{{ item.name }}</a-select-option> | ||||||
|           </a-select> |           </a-select> | ||||||
|         </a-form-item> |         </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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="数量" |           label="数量" | ||||||
| @ -49,6 +41,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrWorkTaskAdd } from '@/api/modular/main/scrworktask/scrWorkTaskManage' |   import { scrWorkTaskAdd } from '@/api/modular/main/scrworktask/scrWorkTaskManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -67,6 +60,7 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|  |       moment, | ||||||
|       // 初始化方法 |       // 初始化方法 | ||||||
|       add (record) { |       add (record) { | ||||||
|         this.visible = true |         this.visible = true | ||||||
| @ -86,6 +80,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrWorkTaskAdd(values).then((res) => { |             scrWorkTaskAdd(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('新增成功') |                 this.$message.success('新增成功') | ||||||
| @ -93,7 +88,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('新增失败')// + res.message |                 this.$message.error('新增失败:' + res.message)// + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -103,7 +98,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| <template> | <template> | ||||||
|   <a-modal |   <a-modal | ||||||
|     title="编辑作业票" |     title="编辑" | ||||||
|     :width="900" |     :width="900" | ||||||
|     :visible="visible" |     :visible="visible" | ||||||
|     :confirmLoading="confirmLoading" |     :confirmLoading="confirmLoading" | ||||||
| @ -11,29 +11,21 @@ | |||||||
|       <a-form :form="form"> |       <a-form :form="form"> | ||||||
|         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> |         <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="8大作业票" |           label="作业票" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|         > |         > | ||||||
|           <a-select style="width: 100%" placeholder="请选择8大作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择8大作业票!' }]}]"> |           <a-select style="width: 100%" placeholder="请选择作业票" v-decorator="['name', {rules: [{ required: true, message: '请选择作业票!' }]}]"> | ||||||
|             <a-select-option v-for="(item,index) in nameData" :key="index" :value="item.code">{{ item.name }}</a-select-option> |             <a-select-option v-for="(item,index) in nameData" :key="index" :value="item.code">{{ item.name }}</a-select-option> | ||||||
|           </a-select> |           </a-select> | ||||||
|         </a-form-item> |         </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 |         <a-form-item | ||||||
|           label="月份" |           label="月份" | ||||||
|           :labelCol="labelCol" |           :labelCol="labelCol" | ||||||
|           :wrapperCol="wrapperCol" |           :wrapperCol="wrapperCol" | ||||||
|           has-feedback |           has-feedback | ||||||
|         > |         > | ||||||
|           <a-input-number placeholder="请输入月份" style="width: 100%" v-decorator="['month', {rules: [{required: true, message: '请输入月份!'}]}]" /> |           <a-month-picker show-time style="width: 100%" placeholder="请选择月份" v-decorator="['happenTime',{rules: [{ required: true, message: '请选择月份!' }]}]" @change="happenTimeOnChange"/> | ||||||
|         </a-form-item> |         </a-form-item> | ||||||
|         <a-form-item |         <a-form-item | ||||||
|           label="数量" |           label="数量" | ||||||
| @ -50,6 +42,7 @@ | |||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|   import { scrWorkTaskEdit } from '@/api/modular/main/scrworktask/scrWorkTaskManage' |   import { scrWorkTaskEdit } from '@/api/modular/main/scrworktask/scrWorkTaskManage' | ||||||
|  |   import moment from 'moment' | ||||||
|   export default { |   export default { | ||||||
|     data () { |     data () { | ||||||
|       return { |       return { | ||||||
| @ -68,6 +61,7 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|  |       moment, | ||||||
|       // 初始化方法 |       // 初始化方法 | ||||||
|       edit (record) { |       edit (record) { | ||||||
|         this.visible = true |         this.visible = true | ||||||
| @ -78,12 +72,14 @@ | |||||||
|             { |             { | ||||||
|               id: record.id, |               id: record.id, | ||||||
|               name: record.name, |               name: record.name, | ||||||
|               year: record.year, |  | ||||||
|               month: record.month, |  | ||||||
|               totalNum: record.totalNum |               totalNum: record.totalNum | ||||||
|             } |             } | ||||||
|           ) |           ) | ||||||
|         }, 100) |         }, 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 () { |       handleSubmit () { | ||||||
|         const { form: { validateFields } } = this |         const { form: { validateFields } } = this | ||||||
| @ -95,6 +91,7 @@ | |||||||
|                 values[key] = JSON.stringify(values[key]) |                 values[key] = JSON.stringify(values[key]) | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
|  |             values.happenTime = moment(this.happenTimeDateString).format('YYYY-MM-DD') || null | ||||||
|             scrWorkTaskEdit(values).then((res) => { |             scrWorkTaskEdit(values).then((res) => { | ||||||
|               if (res.success) { |               if (res.success) { | ||||||
|                 this.$message.success('编辑成功') |                 this.$message.success('编辑成功') | ||||||
| @ -102,7 +99,7 @@ | |||||||
|                 this.$emit('ok', values) |                 this.$emit('ok', values) | ||||||
|                 this.handleCancel() |                 this.handleCancel() | ||||||
|               } else { |               } else { | ||||||
|                 this.$message.error('编辑失败')//  + res.message |                 this.$message.error('编辑失败:' + res.message)//  + res.message | ||||||
|               } |               } | ||||||
|             }).finally((res) => { |             }).finally((res) => { | ||||||
|               this.confirmLoading = false |               this.confirmLoading = false | ||||||
| @ -112,7 +109,12 @@ | |||||||
|           } |           } | ||||||
|         }) |         }) | ||||||
|       }, |       }, | ||||||
|  |       happenTimeOnChange(date, dateString) { | ||||||
|  |         this.happenTimeDateString = dateString | ||||||
|  |       }, | ||||||
|       handleCancel () { |       handleCancel () { | ||||||
|  |         this.happenTimeDateString = '' | ||||||
|  |         this.form.getFieldDecorator('happenTime', { initialValue: null }) | ||||||
|         this.form.resetFields() |         this.form.resetFields() | ||||||
|         this.visible = false |         this.visible = false | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -12,25 +12,14 @@ | |||||||
|               </a-form-item> |               </a-form-item> | ||||||
|             </a-col> |             </a-col> | ||||||
|             <a-col :md="8" :sm="24"> |             <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> |  | ||||||
|             <template v-if="advanced"> |  | ||||||
|               <a-col :md="8" :sm="24"> |  | ||||||
|                 <a-form-item label="月份"> |                 <a-form-item label="月份"> | ||||||
|                   <a-input-number v-model="queryParam.month" style="width: 100%" allow-clear placeholder="请输入月份"/> |                   <a-month-picker style="width: 100%" placeholder="请选择月份" v-model="queryParam.happenTimeDate" @change="onChangehappenTime"/> | ||||||
|                 </a-form-item> |                 </a-form-item> | ||||||
|               </a-col> |             </a-col> | ||||||
|             </template> |  | ||||||
|             <a-col :md="8" :sm="24" > |             <a-col :md="8" :sm="24" > | ||||||
|               <span class="table-page-search-submitButtons"> |               <span class="table-page-search-submitButtons"> | ||||||
|                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> |                 <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button> | ||||||
|                 <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</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> |               </span> | ||||||
|             </a-col> |             </a-col> | ||||||
|           </a-row> |           </a-row> | ||||||
| @ -72,6 +61,7 @@ | |||||||
| </template> | </template> | ||||||
| <script> | <script> | ||||||
|   import { STable, XDown } from '@/components' |   import { STable, XDown } from '@/components' | ||||||
|  |   import moment from 'moment' | ||||||
|   import { scrWorkTaskPage, scrWorkTaskDelete, scrWorkTaskExport } from '@/api/modular/main/scrworktask/scrWorkTaskManage' |   import { scrWorkTaskPage, scrWorkTaskDelete, scrWorkTaskExport } from '@/api/modular/main/scrworktask/scrWorkTaskManage' | ||||||
|   import addForm from './addForm.vue' |   import addForm from './addForm.vue' | ||||||
|   import editForm from './editForm.vue' |   import editForm from './editForm.vue' | ||||||
| @ -96,15 +86,13 @@ | |||||||
|             dataIndex: 'name', |             dataIndex: 'name', | ||||||
|             scopedSlots: { customRender: 'nameScopedSlots' } |             scopedSlots: { customRender: 'nameScopedSlots' } | ||||||
|           }, |           }, | ||||||
|           { |  | ||||||
|             title: '年份', |  | ||||||
|             align: 'center', |  | ||||||
|             dataIndex: 'year' |  | ||||||
|           }, |  | ||||||
|           { |           { | ||||||
|             title: '月份', |             title: '月份', | ||||||
|             align: 'center', |             align: 'center', | ||||||
|             dataIndex: 'month' |             dataIndex: 'happenTime', | ||||||
|  |             customRender: (text, record) => { | ||||||
|  |               return moment(text).format('YYYY-MM') | ||||||
|  |             } | ||||||
|           }, |           }, | ||||||
|           { |           { | ||||||
|             title: '数量', |             title: '数量', | ||||||
| @ -115,7 +103,7 @@ | |||||||
|         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |         tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, | ||||||
|         // 加载数据方法 必须为 Promise 对象 |         // 加载数据方法 必须为 Promise 对象 | ||||||
|         loadData: parameter => { |         loadData: parameter => { | ||||||
|           return scrWorkTaskPage(Object.assign(parameter, this.queryParam)).then((res) => { |           return scrWorkTaskPage(Object.assign(parameter, this.switchingDate())).then((res) => { | ||||||
|             return res.data |             return res.data | ||||||
|           }) |           }) | ||||||
|         }, |         }, | ||||||
| @ -142,6 +130,24 @@ | |||||||
|       this.nameData = nameOption.filters['dictData']('work_task_type') |       this.nameData = nameOption.filters['dictData']('work_task_type') | ||||||
|     }, |     }, | ||||||
|     methods: { |     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