From d4461e39ce7bda79998febbfa72502b61c743142 Mon Sep 17 00:00:00 2001
From: cuikaidong <ckd2942379034@163.com>
Date: 星期五, 15 八月 2025 14:29:52 +0800
Subject: [PATCH] 修改故障保修,故障简称字段
---
src/views/tms/requirement/modules/ToolsSharpeningModal.vue | 201 +++++++++++++++++++++++++++-----------------------
1 files changed, 109 insertions(+), 92 deletions(-)
diff --git a/src/views/tms/requirement/modules/ToolsSharpeningModal.vue b/src/views/tms/requirement/modules/ToolsSharpeningModal.vue
index 9a903d0..2ed8659 100644
--- a/src/views/tms/requirement/modules/ToolsSharpeningModal.vue
+++ b/src/views/tms/requirement/modules/ToolsSharpeningModal.vue
@@ -11,18 +11,20 @@
@cancel="handleCancel"
cancelText="鍏抽棴">
+
+
<a-spin :spinning="spinning">
<a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row :gutter="24">
<a-col :span="12">
- <a-form-model-item prop="standardCode" label="宸ュ叿缂栧彿">
- <a-input-search v-model="model.toolId" placeholder="璇烽�夋嫨宸ュ叿缂栧彿" :disabled="disableSubmit"
+ <a-form-model-item prop="standardCode" label="宸ュ叿缂栫爜">
+ <a-input-search v-model="model.toolId" placeholder="璇烽�夋嫨宸ュ叿缂栫爜" :disabled="disableSubmit"
@search="selectTools" enter-button
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
- <a-form-model-item prop="classify_id" label="宸ュ叿鍒嗙被缂栫爜">
+ <a-form-model-item prop="classify_id" label="宸ュ叿鍒嗙被鍚嶇О">
<a-input placeholder="璇疯緭鍏ュ伐鍏峰垎绫诲悕绉�" v-model="model.classifyId" readOnly :disabled="disableSubmit" />
</a-form-model-item>
</a-col>
@@ -31,13 +33,13 @@
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item prop="paramaTableName" label="宸ュ叿鍙傛暟鏍囪瘑">
- <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.paramaTableName" readOnly
+ <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.paramaTableName_dictText" readOnly
:disabled="disableSubmit" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="宸ュ叿绫诲瀷">
- <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.applicationType" readOnly
+ <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.applicationType_dictText" readOnly
:disabled="disableSubmit" />
</a-form-model-item>
</a-col>
@@ -45,7 +47,7 @@
<a-row :gutter="24">
<a-col :span="12">
- <a-form-model-item prop="operator" label="璐d换浜�">
+ <a-form-model-item prop="responsiblePerson" label="璐d换浜�">
<j-dict-select-tag type="list" v-model="model.responsiblePerson" dictCode="sys_user,realname,id"
placeholder="璇烽�夋嫨璐d换浜�" :disabled="disableSubmit" />
</a-form-model-item>
@@ -97,10 +99,9 @@
</a-form-model-item>
</a-col>
</a-row>
-
<a-row :gutter="24">
- <a-col :span="24">
- <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:21}" prop="remark">
+ <a-col :span="12">
+ <a-form-model-item label="澶囨敞" prop="remark">
<a-textarea v-model="model.remark" rows="3" placeholder="璇疯緭鍏ュ娉�" :disabled="disableSubmit" />
</a-form-model-item>
</a-col>
@@ -114,21 +115,23 @@
<a-button @click="handleOk()" :disabled="disableSubmit" type="primary" :loading="confirmLoading">纭畾</a-button>
</template>
- <tools-modal ref="toolListModel"></tools-modal>
+ <tools-modal ref="toolListModel" @sendSelectionRows="getRows"></tools-modal>
</j-modal>
</template>
<script>
-import { getAction, httpAction, postAction, requestPut } from '@/api/manage'
+
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import ToolsModal from '@views/tms/requirement/modules/ToolsModal.vue'
-
+import DeviceListModel from '@views/mdc/base/modules/EquipmentList/DeviceListModal.vue'
+import { requestPut, postAction, httpAction } from '@/api/manage'
export default {
name: 'ToolsSharpeningModal',
mixins: [JVxeTableModelMixin],
components: {
+ DeviceListModel,
ToolsModal
},
data() {
@@ -153,47 +156,39 @@
sharpeningTime: [
{ required: true, message: '璇烽�夋嫨鍒冪(鏃ユ湡!' }
],
- responsibleRerson: [
+ responsiblePerson: [
{ required: true, message: '璇烽�夋嫨璐d换浜�!' }
],
sharpeningResult: [
{ required: true, message: '璇疯緭鍏ュ垉纾ㄧ粨鏋滃強寤鸿!' }
- ],
- responsiblePerson: [
- { required: true, message: '璇烽�夋嫨璐d换浜�!' }
]
-
},
+ lastSelectionData: null,
url: {
add: '/tms/toolSharpening/add',
- edit: '/tms/toolSharpening/edit',
- queryDetailList: '/tms/toolSharpening/listToolSharpening'
+ edit: '/tms/toolSharpening/edit'
}
}
},
created() {
},
- mounted() {
- this.$bus.$on('selectionRows', (data) => {
- console.log('selectionRows', data)
- if (data && data.length > 0) {
- const item = data[0]
- // 浣跨敤 $set 纭繚 model 鐨勫睘鎬ф槸鍝嶅簲寮忕殑
- this.$set(this.model, 'toolId', item.toolCode)
- this.$set(this.model, 'toolCode', item.id)
+
+ methods: {
+ getRows(item) {
+ console.log(item)
+ if (item.id) {
+ this.$set(this.model, 'toolId', item.toolId)
+ this.$set(this.model, 'toolCode', item.toolCode)
this.$set(this.model, 'classifyId', item.classifyId)
- this.$set(this.model, 'paramaTableName', item.paramaTableName_dictText)
- this.$set(this.model, 'applicationType', item.applicationType_dictText)
+ this.$set(this.model, 'paramaTableName_dictText', item.paramaTableName_dictText)
+ this.$set(this.model, 'applicationType_dictText', item.applicationType_dictText)
this.$set(this.model, 'toolModel', item.toolModel)
this.$set(this.model, 'provinceCity', item.provinceCity)
this.$set(this.model, 'warehouseId', item.warehouseId)
this.$set(this.model, 'positionCode', item.positionCode)
this.$set(this.model, 'mainUnit', item.mainUnit)
}
- })
-
- },
- methods: {
+ },
selectTools: function() {
this.$refs.toolListModel.showModals()
@@ -202,75 +197,97 @@
},
add() {
- this.addShow = false
- this.edit()
+ this.edit({})
},
-
edit(record) {
- console.log(record)
- this.model = Object.assign({}, record)
- this.visible = true
- getAction(this.url.queryDetailList, {
- id: record.id,
- pageNo: 1,
- pageSize: 99999
- }).then((res) => {
- if (res.success) {
- console.log(res.result.records)
- this.dataSource = res.result.records
- } else {
- this.dataSource = null
- }
- })
- },
- handleOk() {
- const that = this
- that.confirmLoading = true
-
- // 鉁� 瑙﹀彂琛ㄥ崟楠岃瘉
- this.$refs.form.validate(valid => {
- if (valid) {
- let formData = Object.assign(this.model)
-
- let obj
- if (!this.model.id) {
- obj = postAction(this.url.add, formData)
- } else {
- obj = requestPut(this.url.edit, formData, { id: this.model.id })
- }
-
- obj.then((res) => {
- if (res.success) {
- that.$message.success(res.message)
- that.$emit('ok')
- that.close()
- } else {
- that.$message.warning(res.message)
- }
- }).finally(() => {
- that.confirmLoading = false
- })
- } else {
- that.$message.warning('璇峰~鍐欏繀濉瓧娈�')
- that.confirmLoading = false
- return false
- }
- })
- },
-
- handleCancel() {
- this.close()
+ let that = this
+ that.visible = true
+ that.model = Object.assign({}, record)
},
close() {
this.$emit('close')
this.visible = false
- this.$refs.form.clearValidate()
- }
+ },
+ handleOk() {
+ const that = this
+ // 瑙﹀彂琛ㄥ崟楠岃瘉
+ this.$refs.form.validate(valid => {
+ if (valid) {
+ let formData = Object.assign(this.model)
+ that.confirmLoading = true
+ let httpurl = ''
+ let method = ''
+ if (!this.model.id) {
+ httpurl += this.url.add
+ method = 'post'
+ } else {
+ httpurl += this.url.edit
+ method = 'put'
+ }
+ httpAction(httpurl, this.model, method,formData).then((res) => {
+ if (res.success) {
+ that.$message.success(res.message)
+ that.$emit('ok')
+ } else {
+ that.$message.warning(res.message)
+ }
+ }).finally(() => {
+ that.confirmLoading = false
+ that.close()
+ })
+ } else {
+ return false
+ }
+ })
+ },
+ // handleOk() {
+ // const that = this
+ // that.confirmLoading = true
+ //
+ // // 鉁� 瑙﹀彂琛ㄥ崟楠岃瘉
+ // this.$refs.form.validate(valid => {
+ // if (valid) {
+ // let formData = Object.assign(this.model)
+ //
+ // let obj
+ // if (!this.model.id) {
+ // obj = postAction(this.url.add, formData)
+ // } else {
+ // obj = requestPut(this.url.edit, formData, { id: this.model.id })
+ // }
+ //
+ // obj.then((res) => {
+ // if (res.success) {
+ // that.$message.success(res.message)
+ // that.$emit('ok')
+ // that.close()
+ // } else {
+ // that.$message.warning(res.message)
+ // }
+ // }).finally(() => {
+ // that.confirmLoading = false
+ // })
+ // } else {
+ // that.$message.warning('璇峰~鍐欏繀濉瓧娈�')
+ // that.confirmLoading = false
+ // return false
+ // }
+ // })
+ // },
+
+ handleCancel() {
+ this.close()
+ },
+
+
}
}
</script>
<style lang="less" scoped>
-</style>
\ No newline at end of file
+</style>
+
+
+
--
Gitblit v1.9.3