From 2bfc0b2e2917e2d953aefcdb53a796491a51be23 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期一, 20 一月 2025 10:53:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/dnc/base/modules/WorkDone/WorkDoneModal__Style#Drawer.vue |   91 +++++++++++
 src/views/dnc/base/WorkDoneList.vue                                 |    6 
 src/views/dnc/base/modules/WorkDone/WorkDoneModal.vue               |   65 ++++++++
 src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue                |  262 ++++++++++++++++++++++++++++++++
 4 files changed, 421 insertions(+), 3 deletions(-)

diff --git a/src/views/dnc/base/WorkDoneList.vue b/src/views/dnc/base/WorkDoneList.vue
index 6957163..5cb900a 100644
--- a/src/views/dnc/base/WorkDoneList.vue
+++ b/src/views/dnc/base/WorkDoneList.vue
@@ -79,7 +79,7 @@
     </div>
 
 
-    <AssignApproveUserModal ref="modalForm" @ok="modalFormOk"></AssignApproveUserModal>
+    <WorkDoneModal ref="modalForm" @ok="modalFormOk"></WorkDoneModal>
 
   </a-card>
 </template>
@@ -90,14 +90,14 @@
 import { mixinDevice } from '@/utils/mixin'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JDictSelectTag from '@comp/dict/JDictSelectTag.vue'
-import AssignApproveUserModal from './modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue'
+import WorkDoneModal from './modules/WorkDone/WorkDoneModal__Style#Drawer.vue'
 
 export default {
   name: 'AssignApproveUser',
   mixins:[JeecgListMixin, mixinDevice],
   components: {
     JDictSelectTag,
-    AssignApproveUserModal
+    WorkDoneModal
   },
   data () {
     return {
diff --git a/src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue b/src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue
new file mode 100644
index 0000000..2d11626
--- /dev/null
+++ b/src/views/dnc/base/modules/WorkDone/WorkDoneForm.vue
@@ -0,0 +1,262 @@
+<!--
+ Description: 娴佺▼閰嶇疆绠$悊椤甸潰 Form
+ Author: 浣滆�� liuyh
+ Date:   2025-01-15
+-->
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form :form="form" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-item label="浜у搧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['productName', validatorRules.productName]" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="閮ㄤ欢鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['componentName', validatorRules.componentName]" placeholder="璇疯緭鍏ラ儴浠跺悕绉�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="闆朵欢鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['partsName', validatorRules.partsName]" placeholder="璇疯緭鍏ラ浂浠跺悕绉�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鏂囨。鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['docName', validatorRules.docName]" placeholder="璇疯緭鍏ユ枃妗e悕绉�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['deviceName', validatorRules.deviceName]" placeholder="璇疯緭鍏ヨ澶囧悕绉�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鏂囨。鐗堟湰" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['version', validatorRules.version]" placeholder="璇疯緭鍏ユ枃妗g増鏈�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鐢宠浜�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['applyUser', validatorRules.applyUser]" placeholder="璇疯緭鍏ョ敵璇蜂汉"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鐢宠鍘熷洜" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['applyReason', validatorRules.applyReason]" placeholder="璇疯緭鍏ョ敵璇峰師鍥�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="鐢宠鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['applyTime', validatorRules.applyTime]" placeholder="璇疯緭鍏ョ敵璇锋椂闂�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="瀹℃壒浜�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['approveUser', validatorRules.approveUser]" placeholder="璇疯緭鍏ュ鎵逛汉"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="瀹℃壒鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  v-decorator="['approveTime', validatorRules.approveTime]" placeholder="璇疯緭鍏ュ鎵规椂闂�"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="瀹℃壒鎰忚" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-textarea v-decorator="['approveContent']" rows="4" placeholder="璇疯緭鍏ュ鎵规剰瑙�"/>
+            </a-form-item>
+          </a-col>
+          <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
+            <a-button @click="submitForm">鎻� 浜�</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import pick from 'lodash.pick'
+  import JFormContainer from '@/components/jeecg/JFormContainer'
+  import JDictSelectTag from "@/components/dict/JDictSelectTag"
+
+  export default {
+    name: 'AssignApproveUserForm',
+    components: {
+      JFormContainer,
+      JDictSelectTag,
+    },
+    props: {
+      //娴佺▼琛ㄥ崟data
+      formData: {
+        type: Object,
+        default: ()=>{},
+        required: false
+      },
+      //琛ㄥ崟妯″紡锛歵rue娴佺▼琛ㄥ崟 false鏅�氳〃鍗�
+      formBpm: {
+        type: Boolean,
+        default: false,
+        required: false
+      },
+      //琛ㄥ崟绂佺敤
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        form: this.$form.createForm(this),
+        users:"",
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+          actName: {
+            productName: [
+              { required: true, message: '璇疯緭鍏ユ祦绋嬪悕绉�!'},
+            ]
+          },
+          componentName: {
+            rules: [
+              { required: true, message: '璇烽�夋嫨閮ㄩ棬鍒嗙粍!'},
+            ]
+          },
+          partsName: {
+            rules: [
+              { required: true, message: '璇烽�夋嫨瀹℃壒浜�!'},
+            ]
+          },
+          docName: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ョ壒娈婂瓧绗�!'},
+            ]
+          },
+          deviceName: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ョ壒娈婂瓧绗�!'},
+            ]
+          },
+          version: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ョ壒娈婂瓧绗�!'},
+            ]
+          },
+          applyUser: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ョ壒娈婂瓧绗�!'},
+            ]
+          },
+          applyReason: {
+            rules: [
+              { required: true, message: '璇疯緭鍏ョ壒娈婂瓧绗�!'},
+            ]
+          },
+        },
+        url: {
+          add: "/nc/definition/add",
+          edit: "/nc/definition/edit",
+          // queryById: "/zhshj/wglltwh/query/by/id"
+        },
+        userOptions:[]
+      }
+    },
+    computed: {
+      formDisabled(){
+        if(this.formBpm===true){
+          if(this.formData.disabled===false){
+            return false
+          }
+          return true
+        }
+        return this.disabled
+      },
+      showFlowSubmitButton(){
+        if(this.formBpm===true){
+          if(this.formData.disabled===false){
+            return true
+          }
+        }
+        return false
+      }
+    },
+    created () {
+      //濡傛灉鏄祦绋嬩腑琛ㄥ崟锛屽垯闇�瑕佸姞杞芥祦绋嬭〃鍗昫ata
+      this.showFlowData();
+    },
+    methods: {
+      add () {
+        this.edit({});
+      },
+      edit (record) {
+        this.form.resetFields();
+        this.model = Object.assign({}, record);
+        this.visible = true;
+        this.$nextTick(() => {
+          this.form.setFieldsValue(pick(this.model,'productName','componentName','partsName','docName','deviceName','version','applyUser','applyReason','applyTime','approveUser','approveTime','approveContent'))
+        })
+      },
+      getFormFieldValue(field){
+        return this.form.getFieldValue(field)
+      },
+      //娓叉煋娴佺▼琛ㄥ崟鏁版嵁
+      showFlowData(){
+        if(this.formBpm === true){
+          let params = {id:this.formData.dataId};
+          getAction(this.url.queryById,params).then((res)=>{
+            if(res.success){
+              this.edit (res.result);
+            }
+          });
+        }
+      },
+      submitForm () {
+        const that = this;
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            let formData = Object.assign(this.model, values);
+            console.log("琛ㄥ崟鎻愪氦鏁版嵁",formData)
+            httpAction(httpurl,formData,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+      popupCallback(row){
+        this.form.setFieldsValue(pick(row,'productName','componentName','partsName','docName','deviceName','version','applyUser','applyReason','applyTime','approveUser','approveTime','approveContent'))
+      },
+    }
+  }
+</script>
\ No newline at end of file
diff --git a/src/views/dnc/base/modules/WorkDone/WorkDoneModal.vue b/src/views/dnc/base/modules/WorkDone/WorkDoneModal.vue
new file mode 100644
index 0000000..6ddaf3b
--- /dev/null
+++ b/src/views/dnc/base/modules/WorkDone/WorkDoneModal.vue
@@ -0,0 +1,65 @@
+<!--
+ Description: 娴佺▼閰嶇疆绠$悊椤甸潰 Modal
+ Author: 浣滆�� liuyh
+ Date:   2025-01-15
+-->
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="鍏抽棴">
+    <WorkDoneForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></WorkDoneForm>
+  </j-modal>
+</template>
+
+<script>
+
+  import WorkDoneForm from './WorkDoneForm.vue'
+  export default {
+    name: 'AssignApproveUserModal',
+    components: {
+      WorkDoneForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
\ No newline at end of file
diff --git "a/src/views/dnc/base/modules/WorkDone/WorkDoneModal__Style\043Drawer.vue" "b/src/views/dnc/base/modules/WorkDone/WorkDoneModal__Style\043Drawer.vue"
new file mode 100644
index 0000000..c87a15d
--- /dev/null
+++ "b/src/views/dnc/base/modules/WorkDone/WorkDoneModal__Style\043Drawer.vue"
@@ -0,0 +1,91 @@
+<!--
+ Description: 娴佺▼閰嶇疆绠$悊椤甸潰 Modal-Drawer
+ Author: 浣滆�� liuyh
+ Date:   2025-01-15
+-->
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <WorkDoneForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></WorkDoneForm>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">鍏抽棴</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">鎻愪氦</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+
+
+import WorkDoneForm from './WorkDoneForm.vue'
+
+export default {
+  name: 'AssignApproveUserModal',
+  components: {
+    WorkDoneForm,
+  },
+  data() {
+    return {
+      title: "鎿嶄綔",
+      width: 800,
+      visible: false,
+      disableSubmit: false
+    }
+  },
+  methods: {
+    add() {
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.realForm.add();
+      })
+    },
+    edit(record) {
+      this.visible = true
+      this.$nextTick(() => {
+        this.$refs.realForm.edit(record);
+      });
+    },
+    close() {
+      this.$emit('close');
+      this.visible = false;
+    },
+    submitCallback() {
+      this.$emit('ok');
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm();
+    },
+    handleCancel() {
+      this.close()
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+/** Button鎸夐挳闂磋窛 */
+.ant-btn {
+  margin-left: 30px;
+  margin-bottom: 30px;
+  float: right;
+}
+.drawer-footer{
+  position: absolute;
+  bottom: -8px;
+  width: 100%;
+  border-top: 1px solid #e8e8e8;
+  padding: 10px 16px;
+  text-align: right;
+  left: 0;
+  background: #fff;
+  border-radius: 0 0 2px 2px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3