qushaowei
2023-11-18 eb48d3bada053e26def2a94d46dbe115a5a7bb2f
src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
@@ -106,6 +106,23 @@
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-item
                  label="问题及处理措施描述"
                  :labelCol="{span:3}"
                  :wrapperCol="{span:18}"
                  class="hightColor"
                >
                  <a-textarea
                    allowClear
                    :disabled="this.model.status!='4'"
                    :placeholder="'请输入问题及处理措施描述'"
                    v-model="model.description"
                  />
                </a-form-item>
              </a-col>
            </a-row>
          </div>
          <a-tabs
@@ -129,13 +146,13 @@
                  :loading="loading"
                  @change="handleTableChange"
                  :pagination="ipagination"
                  :scroll="{ x: 'calc(1200px + 50%)', y: 900 }"
                >
                  <!-- :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" -->
                  <!-- :scroll="{x:true}" -->
                  <template
                    v-for="col in columns"
                    :slot="col.dataIndex"
                    slot-scope='text, record'
                    slot-scope='text, record, index'
                  >
                    <div :key="col.dataIndex">
                      <span
@@ -175,11 +192,49 @@
                        预览
                      </a> -->
                      <a-input
                        :value="text"
                        v-if="col.dataIndex == 'maintenanceOrderDetailUda1'"
                        @change="(e)=>handleChange(e, record.key, col, index)"
                        placeholder="请输入保养人"
                        :disabled="record.disabled"
                      />
                      <!-- <a-input
                        :value="text"
                        v-if="col.dataIndex == 'maintenanceOrderDetailUda2'"
                        @change="(e)=>handleChange(e, record.key, col, index)"
                        placeholder="请输入执行情况"
                      /> -->
                      <a-textarea
                        :value="text"
                        v-if="col.dataIndex == 'maintenanceOrderDetailUda2'"
                        :maxLength="500"
                        auto-size
                        placeholder="请输入执行情况"
                        @change="(e)=>handleChange(e, record.key, col, index)"
                        :disabled="record.disabled"
                      />
                    </div>
                  </template>
                </a-table>
                <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
                  <a-row :style="{textAlign:'right'}">
                    <a-button
                      :style="{marginRight: '8px'}"
                      @click="handleCancel"
                    >
                      取消
                    </a-button>
                    <a-button
                      @click="handleOk()"
                      type="primary"
                      :disabled="this.model.status!='4'"
                      :loading="confirmLoading"
                    >保存</a-button>
                  </a-row>
                  <!-- v-has="'dailyMaintenanceOrder:actualWorkHoursSave'" -->
                  <!-- :disabled="false" -->
                </div>
              </div>
            </a-tab-pane>
@@ -280,7 +335,7 @@
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { requestPut, getAction, downFile } from '@/api/manage'
import { requestPut, getAction, downFile, postAction } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
import { preview } from 'vue-photo-preview'
@@ -310,7 +365,7 @@
  },
  data() {
    return {
      title: "日常保养工单执行",
      title: "二级保养工单执行",
      visible: false,
      maskClosable: true,
      confirmLoading: false,
@@ -322,6 +377,7 @@
      maintenanceStandardId: '-1',
      dataSource: [],
      model: {},
      form: this.$form.createForm(this),
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
@@ -329,6 +385,13 @@
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      validatorRules: {
        // description: {
        //   rules: [
        //     { required: true, message: '请输入描述!' },
        //   ]
        // }
      },
      columns: [
        {
@@ -348,12 +411,12 @@
          dataIndex: 'location',
        },
        // class: "notshow"
        {
          title: '示意图',
          align: 'center',
          dataIndex: 'photo',
          scopedSlots: { customRender: 'photo' },
        },
        // {
        //   title: '示意图',
        //   align: 'center',
        //   dataIndex: 'photo',
        //   scopedSlots: { customRender: 'photo' },
        // },
        // class: "notshow"
        {
          title: '保养项目',
@@ -365,35 +428,49 @@
          align: 'center',
          dataIndex: 'standard',
        },
        {
          title: '方法',
          align: 'center',
          dataIndex: 'maintenanceMethodName',
        },
        {
          title: '工具',
          align: 'center',
          dataIndex: 'maintenanceTool',
        },
        {
          title: '安全要求',
          align: 'center',
          dataIndex: 'maintenanceRequire',
        },
        {
          title: '工时定额(小时)',
          align: 'center',
          dataIndex: 'workingHourQuota',
        },
        // {
        //   title: '方法',
        //   align: 'center',
        //   dataIndex: 'maintenanceMethodName',
        // },
        // {
        //   title: '工具',
        //   align: 'center',
        //   dataIndex: 'maintenanceTool',
        // },
        // {
        //   title: '安全要求',
        //   align: 'center',
        //   dataIndex: 'maintenanceRequire',
        // },
        // {
        //   title: '工时定额(小时)',
        //   align: 'center',
        //   dataIndex: 'workingHourQuota',
        // },
        {
          title: '保养周期',
          align: 'center',
          dataIndex: 'maintenanceCycleName',
        },
        // {
        //   title: '维保专业',
        //   align: 'center',
        //   dataIndex: 'maintenanceSpecialtyName',
        // },
        {
          title: '维保专业',
          title: '执行情况',
          align: 'center',
          dataIndex: 'maintenanceSpecialtyName',
          dataIndex: 'maintenanceOrderDetailUda2',
          width: 200,
          scopedSlots: { customRender: 'maintenanceOrderDetailUda2' },
        },
        {
          title: '保养人',
          align: 'center',
          dataIndex: 'maintenanceOrderDetailUda1',
          width: 200,
          scopedSlots: { customRender: 'maintenanceOrderDetailUda1' },
        },
      ],
      url: {
@@ -403,6 +480,7 @@
        editStatus: "/eam/dailyMaintenanceOrder/editStatus",
        revocation: "/eam/dailyMaintenanceOrder/revocation",
        report: "/eam/dailyMaintenanceOrder/report",
        edit: "/eam/dailyMaintenanceOrderDetail/edit"
      },
    }
  },
@@ -494,6 +572,7 @@
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
              that.loadData1(1)
            } else {
              that.$message.warning("工单开工失败!")
            }
@@ -514,7 +593,7 @@
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.report, { id: that.model.id, status: '5' }).then((res) => {
          requestPut(that.url.report, { id: that.model.id, status: '5', description: that.model.description }).then((res) => {
            if (res.success) {
              that.model.status = '5'
              that.$message.success(res.message)
@@ -551,6 +630,7 @@
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
              that.loadData1(1)
            } else {
              that.$message.warning(res.message)
            }
@@ -563,7 +643,45 @@
    },
    //保存
    handleOk() {
      const that = this
      this.loading = true;
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = {}
          formData.dailyMaintenanceOrderDetails = that.dataSource;
          let obj = obj = postAction(this.url.edit, formData)
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
            that.loadData1();
            this.loading = false;
          })
        }
      })
    },
    handleChange(value, key, column, index) {
      let that = this;
      const temp = [...that.dataSource];
      const target = temp[index];
      if (target) {
        target[column.dataIndex] = value;
        if ('maintenanceOrderDetailUda1' == column.dataIndex) {
          target['maintenanceOrderDetailUda1'] = value.target.value;
        }
        if ('maintenanceOrderDetailUda2' == column.dataIndex) {
          target['maintenanceOrderDetailUda2'] = value.target.value;
        }
        that.dataSource = temp;
      }
    },
    view(record) {