Преглед изворни кода

Merge remote-tracking branch 'origin/linwenxin_dev' into pengyouhao_dev

pengyh пре 1 година
родитељ
комит
c24f0ab32b
18 измењених фајлова са 2733 додато и 441 уклоњено
  1. 77 0
      src/api/auxiliaryMaterialBasicInfo.js
  2. 21 0
      src/api/partsListInfo.js
  3. 69 0
      src/api/projectCollectionManagement.js
  4. 7 0
      src/api/workOrderPool.js
  5. 109 0
      src/components/template/editTable.js
  6. 397 0
      src/views/engineeringAuxiliaryParts/auxiliaryMaterialBasicInfo/index.vue
  7. 386 0
      src/views/engineeringAuxiliaryParts/partsListInfo/index.vue
  8. 46 0
      src/views/engineeringAuxiliaryParts/projectCollectionManagement/index.vue
  9. 152 0
      src/views/engineeringAuxiliaryParts/projectCollectionManagement/pages/collect.vue
  10. 70 0
      src/views/engineeringAuxiliaryParts/projectCollectionManagement/pages/offline.vue
  11. 333 0
      src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/index.vue
  12. 281 0
      src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/basicInfo.js
  13. 194 0
      src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/productColumns.js
  14. 171 0
      src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/serviceInfo.js
  15. 359 436
      src/views/setting/menus/index.vue
  16. 52 0
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/activateOrder.vue
  17. 7 3
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue
  18. 2 2
      src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

+ 77 - 0
src/api/auxiliaryMaterialBasicInfo.js

@@ -0,0 +1,77 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+export function websitGoodsAloneMList(data) {
+  return request({
+    url: `/websit/goods/alone/m/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function websitGoodsAloneMListExport(data, name) {
+  return postBlob({
+    url: '/websit/goods/alone/m/list/export',
+    data,
+    name
+  })
+}
+
+export function websitGoodsAloneMImport(data) {
+  return handleImport('/websit/goods/alone/m/import', data.formdata, data.id || '')
+}
+
+// --------------------------------------------------
+
+export function websitGoodsAlonePList(data) {
+  return request({
+    url: `/websit/goods/alone/p/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function websitGoodsAlonePListExport(data, name) {
+  return postBlob({
+    url: '/websit/goods/alone/p/list/export',
+    data,
+    name
+  })
+}
+
+export function websitGoodsAlonePImport(data) {
+  return handleImport('/websit/goods/alone/p/import', data.formdata, data.id || '')
+}
+
+// ----------------------------------------------
+
+export function websitGoodsAloneDetail(params) {
+  return request({
+    url: '/websit/goods/alone/detail',
+    method: 'post',
+    params
+  })
+}
+
+export function websitGoodsAloneEdit(data) {
+  return request({
+    url: '/websit/goods/alone/edit',
+    method: 'post',
+    data: data
+  })
+}
+
+export function websitGoodsAloneAdd(data) {
+  return request({
+    url: '/websit/goods/alone/add',
+    method: 'post',
+    data: data
+  })
+}
+
+export function websitGoodsAloneBatchUpdateStatus(params) {
+  return request({
+    url: '/websit/goods/alone/batch/update/status',
+    method: 'post',
+    params
+  })
+}

+ 21 - 0
src/api/partsListInfo.js

@@ -0,0 +1,21 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+export function websitGoodsAlonePList(data) {
+  return request({
+    url: `/websit/goods/alone/p/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function websitGoodsAlonePListExport(data, name) {
+  return postBlob({
+    url: '/websit/goods/alone/p/list/export',
+    data,
+    name
+  })
+}
+
+export function websitGoodsAlonePImport(data) {
+  return handleImport('/websit/goods/alone/p/import', data.formdata, data.id || '')
+}

+ 69 - 0
src/api/projectCollectionManagement.js

@@ -0,0 +1,69 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+export function enginPayList(data) {
+  return request({
+    url: `/engin/pay/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginPayListExport(data, name) {
+  return postBlob({
+    url: '/engin/pay/list/export',
+    data,
+    name
+  })
+}
+
+export function enginPayImport(data) {
+  return handleImport('/engin/pay/import', data.formdata, data.id || '')
+}
+
+export function enginPayGatherList(data) {
+  return request({
+    url: `/engin/pay/gather/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginPayGatherListExport(data, name) {
+  return postBlob({
+    url: '/engin/pay/gather/list/export',
+    data,
+    name
+  })
+}
+
+export function enginPaySave(data) {
+  return request({
+    url: `/engin/pay/save`,
+    method: 'post',
+    data
+  })
+}
+
+export function enginPayConfirm(params) {
+  return request({
+    url: `/engin/pay/confirm`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginPayPay(params) {
+  return request({
+    url: `/engin/pay/pay`,
+    method: 'post',
+    params
+  })
+}
+
+export function enginPayDetail(params) {
+  return request({
+    url: `/engin/pay/detail`,
+    method: 'post',
+    params
+  })
+}

+ 7 - 0
src/api/workOrderPool.js

@@ -236,3 +236,10 @@ export function orderBaseSettleNormDetail2(params) {
   })
 }
 
+export function orderBaseActive(params) {
+  return request({
+    url: `/order/base/active`,
+    method: 'post',
+    params
+  })
+}

+ 109 - 0
src/components/template/editTable.js

@@ -0,0 +1,109 @@
+function setShowElement(name, row) {
+  if (typeof name == 'function') {
+    return name(row || {})
+  } else {
+    return !!name
+  }
+}
+
+export default {
+  data() {
+    return {
+      isEditTableIndex: -1
+    }
+  },
+  methods: {
+    convertTableJson(tableData, list, attributes = {
+      isAdd: true,
+      isDel: true,
+      isUpdate: true,
+      isConfirm: true,
+      isEdit: true,
+      isTemElm: true,
+      confirmText: "",
+      editText: "",
+      delText: "",
+    }, funs = {
+      add: function () { },
+      confirm: function () { },
+      delete: function () { },
+      update: function () { },
+      verify: function () { },
+    }) {
+      var newList = list.map(item => {
+        if (item.editRender && item.viewRender) {
+          item.render = (h, { row, column, index }) => {
+            if (attributes?.isTemElm !== undefined ? setShowElement(attributes?.isTemElm, { row, column, index }) : index == this.isEditTableIndex) {
+              return item.editRender(h, { row, column, index })
+            } else {
+              return item.viewRender(h, { row, column, index })
+            }
+          }
+        }
+        return item
+      });
+      if (setShowElement(attributes?.isEdit)) {
+        newList.push({
+          columnAttributes: {
+            label: '操作',
+            width: 100
+          },
+          render: (h, { row, column, index }) => {
+            return <div style="padding-left:10px">
+              {(attributes?.isConfirm !== undefined ? setShowElement(attributes?.isConfirm, { row, column, index }) : this.isEditTableIndex == index) && <el-button type="text" onClick={async () => {
+                if (funs.verify && !await funs.verify({ row, column, index }, this.isEditTableIndex)) {
+                  return;
+                }
+                if (funs.confirm) {
+                  funs.confirm({ row, column, index })
+                } else {
+                  this.isEditTableIndex = -1
+                }
+              }}>{attributes?.confirmText || '确定'}</el-button>}
+              {(attributes?.isUpdate !== undefined ? setShowElement(attributes?.isUpdate, { row, column, index }) : this.isEditTableIndex == -1) && <el-button type="text" onClick={async () => {
+                if (funs.verify && !await funs.verify({ row, column, index }, this.isEditTableIndex)) {
+                  return;
+                }
+                if (funs.update) {
+                  funs.update({ row, column, index })
+                } else {
+                  this.isEditTableIndex = index
+                }
+              }}>{attributes?.editText || '编辑'}</el-button>}
+              {setShowElement(attributes?.isDel, { row, column, index }) && <el-button type="text" onClick={async () => {
+                if (this.isEditTableIndex > -1) {
+                  if (this.isEditTableIndex === index) {
+                    this.isEditTableIndex = -1
+                  } else if (this.isEditTableIndex > index) {
+                    this.isEditTableIndex -= 1
+                  }
+                }
+                if (funs.delete) {
+                  funs.delete({ row, column, index })
+                } else {
+                  tableData.splice(index, 1)
+                }
+              }}>{attributes?.delText || '删除'}</el-button>}
+            </div>
+          }
+        })
+      };
+      return <div>
+        {setShowElement(attributes?.isAdd) ? <div>
+          <el-button size="mini" type="primary" onClick={async () => {
+            if (funs.verify && !await funs.verify({}, this.isEditTableIndex)) {
+              return;
+            }
+            if (funs.add) {
+              funs.add()
+            }
+          }}>新增</el-button>
+        </div> : null}
+        <zj-table
+          columns={newList}
+          table-data={tableData}
+        />
+      </div>
+    }
+  }
+}

+ 397 - 0
src/views/engineeringAuxiliaryParts/auxiliaryMaterialBasicInfo/index.vue

@@ -0,0 +1,397 @@
+<template>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+        :operationColumnWidth="80"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="120px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
+import {
+  websitGoodsAloneMList,
+  websitGoodsAloneMListExport,
+  websitGoodsAloneDetail,
+  websitGoodsAloneAdd,
+  websitGoodsAloneEdit,
+  websitGoodsAloneMImport,
+  websitGoodsAloneBatchUpdateStatus
+} from '@/api/auxiliaryMaterialBasicInfo.js'
+import { getTypeList } from '@/api/auxiliaryFittings/attachmentProfile'
+import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑'],
+      formDialog: false,
+      formData: {
+        companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        convertBitScale: '',
+        cost: '',
+        createBy: '',
+        createTime: '',
+        goodsBarcodeId: '',
+        categoryName: '',
+        goodsCode: '',
+        goodsId: '',
+        goodsImage: '',
+        goodsName: '',
+        goodsSalesConvertQty: '',
+        goodsSalesUnit: '',
+        goodsSpecification: '',
+        goodsSpell: '',
+        goodsStockUnit: '',
+        goodsType: 'M',
+        manageWorkerStock: '',
+        marketPrice: '',
+        normAmount: '',
+        normType: '',
+        outWebsitAmount: '',
+        outWorkerAmount: '',
+        parentCategoryId: '',
+        remark: '',
+        selfWebsitAmount: '',
+        selfWorkerAmount: '',
+        status: 'ON'
+      },
+      partsUnitList: [],
+      formType: 'add',
+      formVisible: false
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth(['imp', 'template'], {
+              name: '导入辅材',
+              click: () => {}
+            }),
+            this.optionsEvensAuth('imp', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(websitGoodsAloneMImport, moduleName)
+                }
+              }
+            }),
+            this.optionsEvensAuth('template', {
+              click: () => {
+                commonTemplateDownload({ name: '开单辅材模板.xlsx' }, `开单辅材模板`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('batchLaunch', {
+              click: () => {
+                if (this.recordSelected.length) {
+                  this.setRowStatus('ON')
+                } else {
+                  this.$message({
+                    type: 'warning',
+                    message: `请先勾选需要设置的数据!`
+                  })
+                }
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth('batchRemoval', {
+              click: () => {
+                if (this.recordSelected.length) {
+                  this.setRowStatus('OFF')
+                } else {
+                  this.$message({
+                    type: 'warning',
+                    message: `请先勾选需要设置的数据!`
+                  })
+                }
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyWechatName',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-radio',
+          options: [
+            { label: '上架', value: 'ON' },
+            { label: '下架', value: 'OFF' }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '状态',
+            prop: 'status',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '选择分类',
+            prop: 'categoryName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '辅材名称',
+            prop: 'goodsName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select-add',
+          labelKey: 'dictValue',
+          valueKey: 'dictValue',
+          options: this.partsUnitList,
+          attributes: { placeholder: '请选择单位', filterable: true, clearable: true },
+          formItemAttributes: {
+            label: '单位',
+            prop: 'goodsStockUnit',
+            rules: [...required]
+          },
+          events: {
+            change: val => {
+              this.$refs.formRef.validateField(['goodsStockUnit'], (valid, invalidFields, errLabels) => {})
+            }
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '商品代码',
+            prop: 'goodsCode',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '规格型号',
+            prop: 'goodsSpecification',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '销售价格',
+            prop: 'marketPrice',
+            rules: [...required]
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'textarea' },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: websitGoodsAloneMList,
+    // 列表导出函数
+    exportList: websitGoodsAloneMListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
+            this.openForm('edit', row.goodsId)
+          }
+        }
+      })
+    },
+    openForm(type, id) {
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            getTypeList({
+              pageNum: 1,
+              pageSize: -1,
+              params: [
+                { param: 'a.dict_type', compare: '=', value: `ASSIST_UNIT` },
+                { param: 'a.status', compare: '=', value: 'ON' }
+              ]
+            }).then(res1 => {
+              this.partsUnitList = res1.data.records
+              this.formDialog = true
+            })
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else if (type == 'edit') {
+              this.formDialogType = 1
+              websitGoodsAloneDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data)
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.formCancel()
+        }
+      })
+    },
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    formConfirm(cancel) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          ;[websitGoodsAloneAdd, websitGoodsAloneEdit]
+            [this.formDialogType]({ ...this.formData, goodsType: 'M' })
+            .then(res => {
+              this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+              cancel('list')
+              this.$refs.pageRef.refreshList()
+            })
+        }
+      })
+    },
+    setRowStatus(type) {
+      websitGoodsAloneBatchUpdateStatus({
+        ids: this.recordSelected.map(item => item.goodsId).join(','),
+        stateEnum: type
+      }).then(res => {
+        this.$message({ type: 'success', message: `设置成功!` })
+        this.$refs.pageRef.refreshList()
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 386 - 0
src/views/engineeringAuxiliaryParts/partsListInfo/index.vue

@@ -0,0 +1,386 @@
+<template>
+  <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
+    <template slot-scope="{ activeKey, data }">
+      <template-page
+        v-if="activeKey == 'list'"
+        ref="pageRef"
+        :get-list="getList"
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :options-evens-group="optionsEvensGroup"
+        :moreParameters="moreParameters"
+        :column-parsing="columnParsing"
+        :operation="operation()"
+        :exportList="exportList"
+        :operationColumnWidth="80"
+      >
+      </template-page>
+      <div v-if="~['add', 'edit'].indexOf(activeKey)">
+        <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+          <zj-form-module
+            title=""
+            label-width="120px"
+            :showPackUp="false"
+            :form-data="formData"
+            :form-items="formItems"
+          >
+          </zj-form-module>
+        </zj-form-container>
+        <div slot="footer" class="dialog-footer">
+          <el-button size="mini" @click="data.removeTab()">取 消</el-button>
+          <el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
+        </div>
+      </div>
+    </template>
+  </zj-tab-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import { required, mobileRequired, mobile } from '@/components/template/rules_verify.js'
+import {
+  websitGoodsAlonePList,
+  websitGoodsAlonePListExport,
+  websitGoodsAloneDetail,
+  websitGoodsAloneAdd,
+  websitGoodsAloneEdit,
+  websitGoodsAlonePImport,
+  websitGoodsAloneBatchUpdateStatus
+} from '@/api/auxiliaryMaterialBasicInfo.js'
+import { getTypeList } from '@/api/auxiliaryFittings/attachmentProfile'
+import { commonTemplateDownload } from '@/api/common.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      // 勾选选中行
+      recordSelected: [],
+      /** 表单变量 */
+      formDialogType: 0,
+      formDialogTitles: ['新增', '编辑'],
+      formDialog: false,
+      formData: {
+        companyWechatName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
+        convertBitScale: '',
+        cost: '',
+        createBy: '',
+        createTime: '',
+        goodsBarcodeId: '',
+        categoryName: '',
+        goodsCode: '',
+        goodsId: '',
+        goodsImage: '',
+        goodsName: '',
+        goodsSalesConvertQty: '',
+        goodsSalesUnit: '',
+        goodsSpecification: '',
+        goodsSpell: '',
+        goodsStockUnit: '',
+        goodsType: 'P',
+        manageWorkerStock: '',
+        marketPrice: '',
+        normAmount: '',
+        normType: '',
+        outWebsitAmount: '',
+        outWorkerAmount: '',
+        parentCategoryId: '',
+        remark: '',
+        selfWebsitAmount: '',
+        selfWorkerAmount: '',
+        status: 'ON'
+      },
+      partsUnitList: [],
+      formType: 'add',
+      formVisible: false
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.openForm('add')
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth(['imp', 'template'], {
+              name: '导入',
+              click: () => {}
+            }),
+            this.optionsEvensAuth('imp', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(websitGoodsAlonePImport, moduleName)
+                }
+              }
+            }),
+            this.optionsEvensAuth('template', {
+              click: () => {
+                commonTemplateDownload({ name: '开单配件模板.xlsx' }, `开单配件模板`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            })
+          ]
+        ],
+        [
+          [
+            this.optionsEvensAuth('batchLaunch', {
+              click: () => {
+                if (this.recordSelected.length) {
+                  this.setRowStatus('ON')
+                } else {
+                  this.$message({
+                    type: 'warning',
+                    message: `请先勾选需要设置的数据!`
+                  })
+                }
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth('batchRemoval', {
+              click: () => {
+                if (this.recordSelected.length) {
+                  this.setRowStatus('OFF')
+                } else {
+                  this.$message({
+                    type: 'warning',
+                    message: `请先勾选需要设置的数据!`
+                  })
+                }
+              }
+            })
+          ]
+        ]
+      ]
+    },
+    // 更多参数
+    moreParameters() {
+      return []
+    },
+    formItems() {
+      return [
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyWechatName',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-radio',
+          options: [
+            { label: '上架', value: 'ON' },
+            { label: '下架', value: 'OFF' }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '状态',
+            prop: 'status',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '配件名称',
+            prop: 'goodsName',
+            rules: [...required]
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-select-add',
+          labelKey: 'dictValue',
+          valueKey: 'dictValue',
+          options: this.partsUnitList,
+          attributes: { placeholder: '请选择单位', filterable: true, clearable: true },
+          formItemAttributes: {
+            label: '单位',
+            prop: 'goodsStockUnit',
+            rules: [...required]
+          },
+          events: {
+            change: val => {
+              this.$refs.formRef.validateField(['goodsStockUnit'], (valid, invalidFields, errLabels) => {})
+            }
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '配件编码',
+            prop: 'goodsCode',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入' },
+          formItemAttributes: {
+            label: '规格型号',
+            prop: 'goodsSpecification',
+            rules: []
+          }
+        },
+        {
+          md: 6,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'number' },
+          formItemAttributes: {
+            label: '销售价格',
+            prop: 'marketPrice',
+            rules: [...required]
+          }
+        },
+        {
+          md: 24,
+          isShow: true,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', type: 'textarea' },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
+        }
+      ]
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: websitGoodsAlonePList,
+    // 列表导出函数
+    exportList: websitGoodsAlonePListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        edit: {
+          click: ({ row, index, column }) => {
+            this.openForm('edit', row.goodsId)
+          }
+        }
+      })
+    },
+    openForm(type, id) {
+      this.$refs.tabPage.addTab({
+        // 对应显示的模块
+        activeKey: type,
+        // 唯一标识
+        key: type,
+        // 页签名称
+        label: { edit: '编辑', add: '新增' }[type],
+        // 打开时事件
+        triggerEvent: () => {
+          this.formCancel()
+          this.$nextTick(() => {
+            this.formType = type
+            this.formVisible = true
+            getTypeList({
+              pageNum: 1,
+              pageSize: -1,
+              params: [
+                { param: 'a.dict_type', compare: '=', value: `ASSIST_UNIT` },
+                { param: 'a.status', compare: '=', value: 'ON' }
+              ]
+            }).then(res1 => {
+              this.partsUnitList = res1.data.records
+              this.formDialog = true
+            })
+            if (type == 'add') {
+              this.formDialogType = 0
+            } else if (type == 'edit') {
+              this.formDialogType = 1
+              websitGoodsAloneDetail({ id }).then(res => {
+                Object.assign(this.formData, res.data)
+              })
+            }
+          })
+        },
+        // 关闭时事件
+        closeEvent: () => {
+          this.formCancel()
+        }
+      })
+    },
+    formCancel() {
+      this.formVisible = false
+      this.$refs?.formRef?.resetFields()
+      this.$data.formData = this.$options.data().formData
+    },
+    formConfirm(cancel) {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          ;[websitGoodsAloneAdd, websitGoodsAloneEdit]
+            [this.formDialogType]({ ...this.formData, goodsType: 'P' })
+            .then(res => {
+              this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+              cancel('list')
+              this.$refs.pageRef.refreshList()
+            })
+        }
+      })
+    },
+    setRowStatus(type) {
+      websitGoodsAloneBatchUpdateStatus({
+        ids: this.recordSelected.map(item => item.goodsId).join(','),
+        stateEnum: type
+      }).then(res => {
+        this.$message({ type: 'success', message: `设置成功!` })
+        this.$refs.pageRef.refreshList()
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 46 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <zj-page-container>
+    <div class="tab">
+      <el-radio-group v-model="tabType" size="small" @change="tabTypeChange">
+        <el-radio-button label="collect">工程收款单明细</el-radio-button>
+        <el-radio-button label="offline">工程收款汇总</el-radio-button>
+      </el-radio-group>
+    </div>
+    <zj-page-fill>
+      <collect v-if="tabTypeCk == 'collect'" key="collect" />
+      <offline v-if="tabTypeCk == 'offline'" key="offline" />
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { EventBus } from '@/utils/eventBus'
+import collect from './pages/collect.vue'
+import offline from './pages/offline.vue'
+export default {
+  components: { collect, offline },
+  data() {
+    return {
+      tabType: 'collect',
+      tabTypeCk: 'collect',
+    }
+  },
+  methods: {
+    tabTypeChange() {
+      this.$nextTick(() => {
+        this.tabTypeCk = this.tabType
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.tab {
+  padding: 20px 20px 0 20px;
+}
+
+::v-deep .zj-page-fill {
+  position: static
+}
+</style>

+ 152 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/pages/collect.vue

@@ -0,0 +1,152 @@
+<template>
+  <div style="width: 100%;height:100%">
+    <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+      :columnParsing="columnParsing" :tableAttributes="tableAttributes" :tableEvents="tableEvents"
+      :optionsEvensGroup="optionsEvensGroup">
+      <div slot="moreSearch">
+        <el-radio-group v-model="examineStatus" size="mini" @change="changeType">
+          <el-radio-button label="">全部</el-radio-button>
+          <el-radio-button label="WAIT">待审核</el-radio-button>
+          <el-radio-button label="WAIT_PAY">待收款</el-radio-button>
+          <el-radio-button label="PART_PAY">部分收款</el-radio-button>
+          <el-radio-button label="PAY">收款完成</el-radio-button>
+        </el-radio-group>
+        <br /><br />
+      </div>
+    </template-page>
+    <div class="cartographer_big">
+      <el-dialog title="创建" width="100%" :modal="false" :visible.sync="createFormBool" :before-close="handleClose">
+        <formModule v-if="createFormBool" :id="id" :handleClose="handleClose" />
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { enginPayList, enginPayListExport, enginPayImport } from '@/api/projectCollectionManagement'
+import { commonTemplateDownload } from '@/api/common.js'
+import formModule from "../workOrderInfo/index.vue"
+export default {
+  components: {
+    TemplatePage,
+    formModule
+  },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      formData: {},
+      detailParams: [],
+      examineStatus: '',
+      createFormBool: false,
+      id: null
+    }
+  },
+  computed: {
+    // 事件组合
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.id = null
+                this.createFormBool = true
+              }
+            })
+          ],
+          [
+            this.optionsEvensAuth(['imp', 'template'], {
+              name: '导入',
+              click: () => { }
+            }),
+            this.optionsEvensAuth('imp', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(enginPayImport, moduleName)
+                }
+              }
+            }),
+            this.optionsEvensAuth('template', {
+              click: () => {
+                commonTemplateDownload({ name: '工程收款管理模板.xlsx' }, `工程收款管理模板`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            })
+          ]
+        ]
+      ]
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p) {
+      try {
+        var pam = JSON.parse(JSON.stringify(p))
+        if (this.examineStatus) {
+          pam.params.push({ param: 'a.status', compare: '=', value: this.examineStatus })
+        }
+        return enginPayList(pam)
+      } catch (error) { }
+    },
+
+    // 列表导出函数
+    exportList: enginPayListExport,
+
+    // 切换状态
+    changeType(val) {
+      this.$refs.pageRef.refreshList()
+    },
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+
+    operation() {
+      return this.operationBtn({
+        details: {
+          btnType: 'text',
+          click: ({ row, index, column }) => {
+            this.id = row.id
+            this.createFormBool = true
+          }
+        }
+      })
+    },
+
+    handleClose() {
+      this.$refs.pageRef.refreshList()
+      this.createFormBool = false
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 70 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/pages/offline.vue

@@ -0,0 +1,70 @@
+<template>
+  <template-page ref="pageRef" :getList="getList" :exportList="exportList" :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes" :tableEvents="tableEvents">
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { enginPayGatherList, enginPayGatherListExport } from '@/api/projectCollectionManagement'
+export default {
+  components: {
+    TemplatePage
+  },
+  mixins: [import_mixin, operation_mixin],
+  props: {
+    detailParams: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      formBool: false,
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      }
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: enginPayGatherList,
+
+    exportList: enginPayGatherListExport,
+
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 333 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/index.vue

@@ -0,0 +1,333 @@
+<template>
+  <zj-page-container v-if="formData">
+    <zj-page-fill class="neibuview">
+      <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules"
+        :form-attributes="{ size: 'mini' }">
+        <!-- 工程信息 -->
+        <zj-form-module title="工程信息" :form-data="formData" :form-items="serviceInfo" label-width="120px" />
+        <!-- 基本信息 -->
+        <zj-form-module title="基本信息" :form-data="formData" :form-items="basicInfo" label-width="120px" />
+        <!-- 产品信息 -->
+        <zj-form-module title="产品信息" :form-data="formData" :form-items="product" label-width="120px" />
+        <!-- 收款信息 -->
+        <zj-form-module
+          v-if="!!id && (formData.status == 'WAIT_PAY' || formData.status == 'PART_PAY' || formData.status == 'PAY')"
+          title="收款信息" :form-data="formData" :form-items="payInfo" label-width="120px" />
+      </zj-form-container>
+    </zj-page-fill>
+    <!-- 操作按钮 -->
+    <div>
+      <div style="box-sizing: border-box; padding: 10px">
+        <el-button size="mini" @click="handleClose">关闭</el-button>
+        <el-button v-if="!id" size="mini" type="primary" @click="submit">提交</el-button>
+        <el-button v-if="!!id && formData.status == 'WAIT'" size="mini" type="primary" @click="examine">审核</el-button>
+        <el-button v-if="!!id && (formData.status == 'WAIT_PAY' || formData.status == 'PART_PAY')" size="mini"
+          type="primary" @click="confirm">确定提交</el-button>
+      </div>
+    </div>
+  </zj-page-container>
+</template>
+
+<script>
+import basicInfo from './mixins/basicInfo.js'
+import productColumns from './mixins/productColumns.js'
+import serviceInfo from './mixins/serviceInfo.js'
+import editTable from "@/components/template/editTable.js"
+import { enginPayDetail, enginPaySave, enginPayConfirm, enginPayPay } from "@/api/projectCollectionManagement.js"
+import ImageUpload from '@/components/file-upload'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null,
+    },
+    handleClose: Function
+  },
+  components: { ImageUpload },
+  mixins: [
+    basicInfo,
+    productColumns,
+    serviceInfo,
+    editTable
+  ],
+  data() {
+    return {
+      formData: {
+        "address": "",
+        "area": "",
+        "areaId": "",
+        "city": "",
+        "cityId": "",
+        "companyWechatId": "",
+        "companyWechatName": "",
+        "confirmBy": "",
+        "confirmTime": "",
+        "customerMobile": "",
+        "customerMobile2": "",
+        "customerName": "",
+        "goodsType": "",
+        "items": [],
+        "lastUpdateBy": "",
+        "lastUpdateTime": "",
+        "linkName": "",
+        "orderSmallType": "",
+        "orderSmallTypeText": "",
+        "projectName": "",
+        "projectNo": "",
+        "province": "",
+        "provinceId": "",
+        "records": [],
+        "remark": "",
+        "salesNo": "",
+        "salesWebsit": "",
+        "status": "",
+        "street": "",
+        "streetId": "",
+        "totalPayAmount": 0,
+        "totalSalesAmount": 0,
+        "websitId": "",
+        "websitName": "",
+        // 收款信息
+        "amount": "",
+        "fileUrl": [],
+        "payRemark": ""
+      },
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        this.getorderDetail((data) => {
+          this.getinitlbslist()
+          this.gettGoodsAloneList()
+        })
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  computed: {
+    // 用户信息
+    userInfo() {
+      return JSON.parse(localStorage.getItem('greemall_user'))
+    },
+    // 表单校验规则
+    formRules() {
+      return {}
+    },
+    payInfo() {
+      return [
+        ...(() => {
+          if (!!this.id && (this.formData.status == 'WAIT_PAY' || this.formData.status == 'PART_PAY')) {
+            return [{
+              name: 'el-input',
+              md: 6,
+              attributes: { placeholder: '请输入' },
+              formItemAttributes: {
+                label: '收款金额',
+                prop: 'amount',
+                rules: [...required]
+              }
+            },
+            {
+              md: 24,
+              isShow: true,
+              name: 'slot-component',
+              formItemAttributes: {
+                label: '收款凭证',
+                prop: 'fileUrl',
+                rules: []
+              },
+              render: (h, { props, onInput }) => {
+                var { value } = props
+                return (
+                  <ImageUpload fileList={this.formData.fileUrl} limit={1} />
+                )
+              }
+            },
+            {
+              name: 'el-input',
+              md: 24,
+              attributes: {
+                type: 'textarea',
+                rows: 3,
+                placeholder: '请输入'
+              },
+              formItemAttributes: {
+                label: '备注',
+                prop: 'payRemark',
+                rules: []
+              }
+            }]
+          }
+          return []
+        })(),
+        {
+          md: 24,
+          isShow: true,
+          name: 'slot-component',
+          formItemAttributes: {
+            label: '收款记录',
+            prop: 'records',
+            rules: []
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <zj-table
+                columns={[{
+                  columnAttributes: {
+                    label: '收款结果',
+                    prop: 'status'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div div style="padding-left:10px">
+                      {({ WAIT: "待审核", WAIT_PAY: "待收款", PART_PAY: "部分收款", PAY: "收款完成", })[row.status]}
+                    </div>
+                  },
+                }, {
+                  columnAttributes: {
+                    label: '收款金额',
+                    prop: 'payAmount'
+                  }
+                }, {
+                  columnAttributes: {
+                    label: '收款凭证',
+                    prop: 'fileUrl'
+                  },
+                  render: (h, { row, column, index }) => {
+                    return <div div style="padding-left:10px">
+                      {row.fileUrl ? <ImageUpload fileList={[{ url: row.fileUrl }]} limit={1} isEdit={false} /> : null}
+                    </div>
+                  },
+                }, {
+                  columnAttributes: {
+                    label: '备注',
+                    prop: 'payRemark'
+                  }
+                }, {
+                  columnAttributes: {
+                    label: '收款人',
+                    prop: 'lastUpdateBy'
+                  }
+                }, {
+                  columnAttributes: {
+                    label: '收款时间',
+                    prop: 'lastUpdateTime'
+                  }
+                },]}
+                table-data={value}
+              />
+            )
+          }
+        },
+      ]
+    }
+  },
+  methods: {
+    // 获取工单详情
+    getorderDetail(cb) {
+      if (this.id) {
+        // 编辑详情
+        enginPayDetail({
+          id: this.id
+        }).then((res) => {
+          Object.assign(this.formData, res.data)
+          cb && cb()
+        })
+      }
+    },
+    appointVerify(arr, cb) {
+      this.$refs.formRef.validateField(arr, (valid, invalidFields, errLabels) => {
+        cb && cb(valid, invalidFields, errLabels)
+      })
+    },
+    submit() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginPaySave(this.formData).then(res => {
+            this.$message({
+              type: 'success',
+              message: '提交成功'
+            })
+            this.handleClose && this.handleClose()
+          })
+        }
+      })
+    },
+    examine() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginPayConfirm({ id: this.formData.id }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '审核成功'
+            })
+            this.handleClose && this.handleClose()
+          })
+        }
+      })
+    },
+    confirm() {
+      this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
+        if (valid) {
+          enginPayPay({
+            id: this.formData.id,
+            "amount": this.formData.amount,
+            "fileUrl": this.formData.fileUrl.map(item => item.url).join(","),
+            "payRemark": this.formData.payRemark,
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: '收款成功'
+            })
+            this.handleClose && this.handleClose()
+          })
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+
+.pgxxTable {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+}
+
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+
+.redbordererr {
+  ::v-deep .el-form-item {
+    margin: 0 !important;
+    overflow: hidden;
+  }
+}
+</style>

+ 281 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/basicInfo.js

@@ -0,0 +1,281 @@
+import { lbsAmapRegion } from '@/api/common.js'
+import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      provinceList: [],
+      cityList: [],
+      areaList: [],
+      streetList: [],
+    }
+  },
+  computed: {
+    // 基本信息数据模型
+    basicInfo() {
+      return [
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入' },
+          formItemAttributes: {
+            label: '客户名称',
+            prop: 'customerName',
+            rules: [...required]
+          },
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入' },
+          formItemAttributes: {
+            label: '联系人',
+            prop: 'linkName',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入', maxlength: 11 },
+          formItemAttributes: {
+            label: '客户电话',
+            prop: 'customerMobile',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: !!this.id, placeholder: '请输入', maxlength: 11 },
+          formItemAttributes: {
+            label: '客户电话2',
+            prop: 'customerMobile2',
+            rules: []
+          }
+        },
+        {
+          name: 'el-select',
+          md: 6,
+          formItemAttributes: {
+            label: '客户地址', //省
+            prop: 'provinceId',
+            rules: [...required],
+            errLabel: '省'
+          },
+          options: this.provinceList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取省名称
+              this.formData.province = this.provinceList.find(item => item.id === val)?.name || ''
+              // 清除市区街道以及详细地址数据
+              this.delDataK(1)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.cityList = res.data
+              })
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //市
+            prop: 'cityId',
+            rules: [...required],
+            errLabel: '市'
+          },
+          options: this.cityList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取市名称
+              this.formData.city = this.cityList.find(item => item.id === val).name
+              // 清除区街道以及详细地址数据
+              this.delDataK(2)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.areaList = res.data
+              })
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //区
+            prop: 'areaId',
+            rules: [...required],
+            errLabel: '区'
+          },
+          options: this.areaList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取区名称
+              this.formData.area = this.areaList.find(item => item.id === val).name
+              // 清除街道以及详细地址数据
+              this.delDataK(3)
+              lbsAmapRegion({ pid: val }).then(res => {
+                this.streetList = res.data
+              })
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 5,
+          formItemAttributes: {
+            'label-width': '0px',
+            label: '', //街道
+            prop: 'streetId',
+            rules: [...required],
+            errLabel: '街道'
+          },
+          options: this.streetList.map((v, i) => ({ value: v.id, label: v.name })),
+          attributes: { disabled: true, clearable: true, filterable: true, placeholder: '请选择' },
+          events: {
+            change: (val) => {
+              // 获取街道名称
+              this.formData.street = this.streetList.find(item => item.id === val).name
+              // 清除详细地址数据
+              this.delDataK(4)
+            }
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 3,
+          formItemAttributes: {
+            'label-width': '0px',
+            prop: '',
+          },
+          render: (h, { props }) => {
+            return (
+              <geographicalPosi
+                disabled={!!this.id}
+                formData={this.formData}
+                onSelectPosi={data => {
+                  // 获取经纬度
+                  this.formData.lng = data.center[0]
+                  this.formData.lat = data.center[1]
+                  // 获取定位的省市区街道
+                  var { province, city, district, township } = data.data.addressComponent
+                  // 获取选中省名称id
+                  var { id, name } = this.provinceList.find(item => item.name === province)
+                  this.formData.provinceId = id
+                  this.formData.province = name
+                  // 请求市选项
+                  lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+                    // 赋值市选项
+                    this.cityList = res.data
+                    // 获取选中市名称id
+                    var { id, name } = res.data.find(item => item.name === city)
+                    this.formData.cityId = id
+                    this.formData.city = name
+                    // 请求区选项
+                    lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                      // 赋值区选项
+                      this.areaList = res.data
+                      // 获取选中区名称id
+                      var { id, name } = res.data.find(item => item.name === district)
+                      this.formData.areaId = id
+                      this.formData.area = name
+                      // 请求街道选项
+                      lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                        // 赋值街道选项
+                        this.streetList = res.data
+                        // 获取选中街道名称id
+                        var { id, name } = res.data.find(item => item.name === township)
+                        this.formData.streetId = id
+                        this.formData.street = name
+                        if (!this.formData.address) {
+                          this.formData.address = data.name
+                        }
+                      })
+                    })
+                  })
+                }}
+              />
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          formItemAttributes: { label: '详细地址', prop: 'address', rules: [...required] },
+          attributes: { disabled: !!this.id, placeholder: '详细地址' }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: !!this.id,
+            type: 'textarea',
+            rows: 3,
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+            rules: []
+          }
+        }
+      ]
+    }
+  },
+  created() {
+    this.getinitlbslist()
+  },
+  methods: {
+    getinitlbslist() {
+      // 初始化请求省市区街道下拉选项数据
+      lbsAmapRegion({ pid: 0 }).then(res => {
+        this.provinceList = res.data
+        if (this.formData.provinceId) {
+          lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
+            this.cityList = res.data
+            if (this.formData.cityId) {
+              lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
+                this.areaList = res.data
+                if (this.formData.areaId) {
+                  lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
+                    this.streetList = res.data
+                  })
+                }
+              })
+            }
+          })
+        }
+      })
+    },
+    delDataK(num) {
+      if (num <= 1) {
+        // 删除市
+        this.formData.cityId = ''
+        this.formData.city = ''
+        // 删除市选项
+        this.cityList = []
+      }
+      if (num <= 2) {
+        // 删除区
+        this.formData.areaId = ''
+        this.formData.area = ''
+        // 删除区选项
+        this.areaList = []
+      }
+      if (num <= 3) {
+        // 删除街道
+        this.formData.streetId = ''
+        this.formData.street = ''
+        // 删除街道选项
+        this.streetList = []
+      }
+      // 删除gps地址
+      this.formData.gpsAddress = ''
+    }
+  }
+}

+ 194 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/productColumns.js

@@ -0,0 +1,194 @@
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      isEditIndex: -1,
+      serviceProvider: null,
+      specificationList: [],
+      hezuoshangjiaList: [],
+    }
+  },
+  watch: {
+
+  },
+  computed: {
+    product() {
+      return [{
+        name: 'slot-component',
+        md: 24,
+        formItemAttributes: {
+          'label-width': '0px',
+          label: '',
+          prop: 'items',
+          rules: [...required]
+        },
+        render: (h, { props }) => {
+          return this.convertTableJson(this.formData?.items || [], [
+            {
+              columnAttributes: {
+                label: '商品',
+                prop: 'goodsId',
+                propName: 'goodsName',
+              },
+              editRender: (h, { row, column, index }) => {
+                return <div class="redbordererr">
+                  <el-form-item label="" label-width="0px" prop={`items.${index}.${column.columnAttributes.prop}`} rules={required}>
+                    <el-select
+                      value={row[column.columnAttributes.prop]}
+                      onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                      onChange={(val) => {
+                        row[column.columnAttributes.propName] = ""
+                        row.categoryName = ""
+                        row.unit = ""
+                        row.goodsSpecification = ""
+                        row.marketPrice = ""
+                        row.qty = ""
+                        row.amount = ""
+                        row.goodsCode = ""
+                        if (val) {
+                          var data = this.goodsList.find(item => item.goodsId == val)
+                          if (data) {
+                            row[column.columnAttributes.propName] = data.goodsName
+                            row.categoryName = data.categoryName
+                            row.goodsCode = data.goodsCode
+                            row.unit = data.goodsStockUnit
+                            row.goodsSpecification = data.goodsSpecification
+                            row.marketPrice = data.marketPrice
+                            row.qty = ""
+                          }
+                        }
+                      }}
+                      placeholder="请选择">
+                      {this.goodsList.filter(item => item.goodsId == row.goodsId || !(this.formData?.items || []).find(data => data.goodsId == item.goodsId)).map((item, index_) => <el-option key={index_} label={item.goodsName} value={item.goodsId}></el-option>)}
+                    </el-select>
+                  </el-form-item>
+                </div>
+              },
+              viewRender: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{row[column.columnAttributes.propName]}</div>
+              },
+            },
+            {
+              columnAttributes: {
+                label: '分类',
+                prop: 'categoryName'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '单位',
+                prop: 'unit'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '商品代码',
+                prop: 'goodsCode'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '规格型号',
+                prop: 'goodsSpecification'
+              }
+            },
+            {
+              columnAttributes: {
+                label: '销售价格',
+                prop: 'marketPrice',
+              },
+              editRender: (h, { row, column, index }) => {
+                return <div class="redbordererr">
+                  <el-form-item label="" label-width="0px" prop={`items.${index}.${column.columnAttributes.prop}`} rules={required}>
+                    <el-input
+                      value={row[column.columnAttributes.prop]}
+                      onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                      placeholder="请输入内容"
+                      type="number"
+                    >
+                    </el-input>
+                  </el-form-item>
+                </div>
+              },
+              viewRender: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+              },
+            },
+            {
+              columnAttributes: {
+                label: '数量',
+                prop: 'qty',
+              },
+              editRender: (h, { row, column, index }) => {
+                return <div class="redbordererr">
+                  <el-form-item label="" label-width="0px" prop={`items.${index}.${column.columnAttributes.prop}`} rules={required}>
+                    <el-input
+                      value={row[column.columnAttributes.prop]}
+                      onInput={(val) => { row[column.columnAttributes.prop] = val }}
+                      placeholder="请输入内容"
+                      type="number"
+                    >
+                    </el-input>
+                  </el-form-item>
+                </div>
+              },
+              viewRender: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+              },
+            },
+            {
+              columnAttributes: {
+                label: '金额(元)',
+                prop: 'amount',
+              },
+              render: (h, { row, column, index }) => {
+                return <div style="padding-left:10px">{
+                  (Number(row.marketPrice) * Number(row.qty)).toFixed(2)
+                }</div>
+              },
+            },
+          ], {
+            isEdit: !this.id,
+            isAdd: !this.id,
+            isDel: !this.id,
+          }, {
+            // 点击添加触发
+            add: () => {
+              this.formData.items.unshift({
+                "goodsId": "",
+                "goodsCode": "",
+                "goodsName": "",
+                "categoryName": "",
+                "unit": "",
+                "goodsSpecification": "",
+                "marketPrice": "",
+                "qty": "",
+                "amount": ""
+              })
+              this.isEditTableIndex = 0
+            },
+            verify: ({ row, column, index }, isEditTableIndex) => {
+              return new Promise(r => {
+                if (isEditTableIndex > -1) {
+                  this.appointVerify([
+                    `items.${isEditTableIndex}.goodsId`,
+                    `items.${isEditTableIndex}.marketPrice`,
+                    `items.${isEditTableIndex}.qty`,
+                  ], (v) => {
+                    if (v) {
+                      r(true)
+                    } else {
+                      r(false)
+                    }
+                  })
+                } else {
+                  r(true)
+                }
+              })
+            },
+          })
+        }
+      }]
+    },
+  },
+}

+ 171 - 0
src/views/engineeringAuxiliaryParts/projectCollectionManagement/workOrderInfo/mixins/serviceInfo.js

@@ -0,0 +1,171 @@
+import { listPageV2 } from "@/api/workOrder/orderType";
+import { getWebsit } from "@/api/customerManagement.js"
+import {
+  websitGoodsAlonePList,
+  websitGoodsAloneMList
+} from '@/api/auxiliaryMaterialBasicInfo.js'
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
+export default {
+  data() {
+    return {
+      orderSmallTypeData: [],
+      goodsList: []
+    }
+  },
+  computed: {
+    serviceInfo() {
+      return [
+        {
+          md: 6,
+          name: 'el-input',
+          attributes: { placeholder: '请输入', disabled: true },
+          formItemAttributes: {
+            label: '所属商户',
+            prop: 'companyWechatName',
+            rules: []
+          }
+        },
+        {
+          name: 'el-select',
+          options: this.websitList,
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '网点名称',
+            prop: 'websitId',
+            rules: [...required],
+          },
+          events: {
+            change: (val) => {
+              this.formData.websitName = this.websitList.find(item => item.value === val)?.label
+            }
+          }
+        },
+        {
+          name: 'el-select',
+          md: 6,
+          options: this.orderSmallTypeData,
+          attributes: {
+            disabled: !!this.id,
+            placeholder: '请选择',
+            clearable: true,
+            filterable: true
+          },
+          formItemAttributes: {
+            label: '工单类型',
+            prop: 'orderSmallType',
+            rules: [...required]
+          },
+          events: {
+            change: (val) => {
+              this.formData.orderSmallTypeText = this.orderSmallTypeData.find(item => item.value === val)?.label
+            }
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '工程编号',
+            prop: 'projectNo',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '工程名称',
+            prop: 'projectName',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '销售单号',
+            prop: 'salesNo',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            disabled: !!this.id,
+          },
+          formItemAttributes: {
+            label: '销售网点',
+            prop: 'salesWebsit',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-radio',
+          md: 6,
+          options: [{ value: "M", label: "辅材" }, { value: "P", label: "配件" }],
+          attributes: {
+            disabled: !!this.id,
+            placeholder: '请选择',
+          },
+          formItemAttributes: {
+            label: '费用类型',
+            prop: 'goodsType',
+            rules: [...required]
+          },
+          events: {
+            change: (val) => {
+              this.formData.items = []
+              this.gettGoodsAloneList()
+            }
+          }
+        },
+      ]
+    }
+  },
+  created() {
+    // 获取网点
+    getWebsit({ type: "C", status: true, isAll: this.id ? true : false }).then(res => {
+      this.websitList = res.data.map(item => ({
+        label: item.name,
+        value: item.websitId,
+        data: item
+      }))
+    })
+    // 获取工单类型
+    listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "true" }] }).then(res => {
+      this.orderSmallTypeData = res.data.records.map(item => ({
+        value: item.id,
+        label: item.orderSmallTypeText
+      }))
+    })
+  },
+  methods: {
+    gettGoodsAloneList() {
+      this.goodsList = []
+      if (this.formData.goodsType) {
+        ({
+          M: websitGoodsAloneMList,
+          P: websitGoodsAlonePList
+        })[this.formData.goodsType]({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.status", "compare": "=", "value": "ON" }] }).then(res => {
+          this.goodsList = res.data.records
+        })
+      }
+    }
+  },
+}

+ 359 - 436
src/views/setting/menus/index.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="app-container">
+  <div class="app-container" style="height: 100%; box-sizing: border-box; overflow-y: auto">
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button size="small" type="primary" icon="el-icon-plus" @click="addOrEditParent('add')"
+          <el-button size="small" type="primary" icon="el-icon-plus" @click="openFormWin('add', '0')"
             >添加菜单</el-button
           >
         </div>
@@ -17,7 +17,7 @@
           default-expand-all
           :tree-props="{ children: 'pages' }"
         >
-        <el-table-column prop="moduleName" label="菜单名称" min-width="150" />
+          <el-table-column prop="moduleName" label="菜单名称" min-width="150" />
           <el-table-column prop="url" label="菜单URL" min-width="150" />
           <el-table-column prop="fullUrl" label="菜单全URL" min-width="200" />
           <el-table-column align="center" prop="icon" label="菜单图标">
@@ -38,10 +38,18 @@
           <el-table-column align="center" prop="sortNum" label="排序" />
           <el-table-column align="right" label="操作" width="150" fixed="right">
             <template slot-scope="scope">
-              <el-button type="primary" size="mini" icon="el-icon-plus"
-                @click="addOrEditChild('add', scope.row.moduleId)" />
-              <el-button type="primary" size="mini" icon="el-icon-edit"
-                @click="addOrEditChild('edit', scope.row.moduleId)" />
+              <el-button
+                type="primary"
+                size="mini"
+                icon="el-icon-plus"
+                @click="openFormWin('add', scope.row.moduleId)"
+              />
+              <el-button
+                type="primary"
+                size="mini"
+                icon="el-icon-edit"
+                @click="openFormWin('edit', scope.row.moduleId)"
+              />
               <el-popconfirm style="margin-left: 10px" title="确定删除吗?" @confirm="handleDelete(scope.row.moduleId)">
                 <el-button slot="reference" size="mini" icon="el-icon-delete" />
               </el-popconfirm>
@@ -51,157 +59,44 @@
       </div>
     </div>
 
-    <!-- 新增编辑 一级菜单 -->
-    <el-dialog
-      :title="addParentFormType == 'add' ? '添加一级菜单' : '编辑一级菜单'"
-      :visible.sync="addParentFormVisible"
-      :show-close="false"
-      width="60%"
-      :close-on-click-modal="false"
-    >
-      <el-form
-        ref="addParentForm"
-        :model="addParentForm"
-        :rules="addParentFormRules"
-        label-position="left"
-        label-width="120px"
+    <!-- 创建编辑菜单 -->
+    <div class="cartographer_big">
+      <el-dialog
+        :title="this.menuFormData.moduleId ? '编辑菜单' : '创建菜单'"
+        width="100%"
+        :modal="false"
+        :visible.sync="menuFormBool"
+        :before-close="cancelFormWin"
+        :close-on-click-modal="false"
       >
-        <el-form-item label="类型" prop="type">
-          <el-radio-group v-model="addParentForm.type">
-            <el-radio v-for="item in menuTypeList" :key="item.label" :label="item.label">
-              {{ item.value }}
-            </el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="一级菜单" prop="oneMenu">
-          <el-input v-model="addParentForm.oneMenu" type="text" placeholder="请输入一级菜单名称" show-word-limit />
-        </el-form-item>
-        <el-form-item label="CODE" prop="code">
-          <el-input v-model="addParentForm.code" placeholder="请输入CODE" />
-        </el-form-item>
-        <el-form-item label="URL" prop="url">
-          <el-input v-model="addParentForm.url" placeholder="请输入URL" />
-        </el-form-item>
-        <el-form-item label="全URL" prop="fullUrl">
-          <el-input v-model="addParentForm.fullUrl" placeholder="请输入全URL" />
-        </el-form-item>
-        <el-form-item label="图标">
-          <div class="iconInput">
-            <div v-if="addParentForm.icon" class="icon"><i :class="addParentForm.icon" /></div>
-            <el-input v-model="addParentForm.icon" placeholder="请选择图标" />
-            <el-button type="primary" @click="toChooseIcon(1)">选择</el-button>
+        <zj-page-container v-if="menuFormBool">
+          <zj-page-fill class="neibuviewaaaaa">
+            <zj-form-container
+              ref="formRef"
+              :form-data="menuFormData"
+              :form-attributes="{ size: 'medium' }"
+              :styleSwitch="false"
+            >
+              <zj-form-module
+                title="基本信息"
+                :form-data="menuFormData"
+                :form-items="basicInfo"
+                :showHade="false"
+                label-width="120px"
+              />
+            </zj-form-container>
+          </zj-page-fill>
+          <div>
+            <div style="box-sizing: border-box; padding: 10px 60px; text-align: right">
+              <el-button @click="cancelFormWin">取 消</el-button>
+              <el-button type="primary" @click="submitMenuForm">确 定</el-button>
+            </div>
           </div>
-        </el-form-item>
-        <el-form-item label="排序" prop="sort">
-          <el-input v-model.number="addParentForm.sort" placeholder="请输入排序" />
-        </el-form-item>
-        <el-form-item label="是否显示" prop="status">
-          <el-switch v-model="addParentForm.status" :active-value="true" :inactive-value="false" active-color="#13ce66"
-            inactive-color="#ff4949" />
-        </el-form-item>
-        <el-form-item label="是否缓存页面" prop="isCache">
-          <el-switch v-model="addParentForm.isCache" :active-value="1" :inactive-value="0" active-color="#13ce66"
-            inactive-color="#ff4949" />
-        </el-form-item>
-      </el-form>
-      <div v-if="addParentForm.type === 2">
-        <el-button style="margin-bottom: 10px" type="primary" size="small" @click="hasShowTable">新增</el-button>
-        <zj-table
-          ref="tableEl"
-          :is-drop="true"
-          :columns="columns"
-          :table-data="tableData"
-          :table-attributes="{
-            border: true
-          }"
-        />
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="cancelAddParentForm">取 消</el-button>
-        <el-button type="primary" @click="submitAddParentForm">确 定</el-button>
-      </div>
-    </el-dialog>
+        </zj-page-container>
+      </el-dialog>
+    </div>
 
-    <!-- 新增编辑 二级菜单 -->
-    <el-dialog
-      :title="addChildFormType == 'add' ? '添加二级菜单' : '编辑二级菜单'"
-      :visible.sync="addChildFormVisible"
-      :show-close="false"
-      width="60%"
-      :close-on-click-modal="false"
-    >
-      <el-form
-        ref="addChildForm"
-        :model="addChildForm"
-        :rules="addChildFormRules"
-        label-position="left"
-        label-width="120px"
-      >
-        <el-form-item label="类型" prop="type">
-          <el-radio-group v-model="addChildForm.type">
-            <el-radio v-for="item in menuTypeList" :key="item.label" :label="item.label">
-              {{ item.value }}
-            </el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="上级菜单" prop="oneMenu">
-          <el-cascader
-            v-model="addChildForm.oneMenu"
-            style="width: 100%"
-            :options="[{ moduleId: '0', moduleName: '设定一级' }, ...dataList]"
-            :props="{ checkStrictly: true, value: 'moduleId', label: 'moduleName' }"
-            filterable
-            clearable
-          />
-        </el-form-item>
-        <el-form-item label="二级菜单" prop="twoMenu">
-          <el-input v-model="addChildForm.twoMenu" type="text" placeholder="请输入二级菜单名称" show-word-limit />
-        </el-form-item>
-        <el-form-item label="CODE" prop="code">
-          <el-input v-model="addChildForm.code" placeholder="请输入CODE" />
-        </el-form-item>
-        <el-form-item label="URL" prop="url">
-          <el-input v-model="addChildForm.url" placeholder="请输入URL" />
-        </el-form-item>
-        <el-form-item label="全URL" prop="fullUrl">
-          <el-input v-model="addChildForm.fullUrl" placeholder="请输入全URL" />
-        </el-form-item>
-        <el-form-item label="图标" prop="icon">
-          <div class="iconInput">
-            <div v-if="addChildForm.icon" class="icon"><i :class="addChildForm.icon" /></div>
-            <el-input v-model="addChildForm.icon" placeholder="请选择图标" />
-            <el-button type="primary" @click="toChooseIcon(2)">选择</el-button>
-          </div>
-        </el-form-item>
-        <el-form-item label="排序" prop="sort">
-          <el-input v-model.number="addChildForm.sort" placeholder="请输入排序" />
-        </el-form-item>
-        <el-form-item label="是否显示" prop="status">
-          <el-switch v-model="addChildForm.status" :active-value="true" :inactive-value="false" active-color="#13ce66"
-            inactive-color="#ff4949" />
-        </el-form-item>
-        <el-form-item label="是否缓存页面" prop="isCache">
-          <el-switch v-model="addChildForm.isCache" :active-value="1" :inactive-value="0" active-color="#13ce66"
-            inactive-color="#ff4949" />
-        </el-form-item>
-      </el-form>
-      <div v-if="addChildForm.type === 2">
-        <el-button style="margin-bottom: 10px" type="primary" size="small" @click="hasShowTable">新增</el-button>
-        <zj-table
-          ref="tableEl"
-          :is-drop="true"
-          :columns="columns"
-          :table-data="tableData"
-          :table-attributes="{
-            border: true
-          }"
-        />
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="cancelAddChildForm">取 消</el-button>
-        <el-button type="primary" @click="submitAddChildForm">确 定</el-button>
-      </div>
-    </el-dialog>
+    <!-- 添加功能 -->
     <el-dialog
       :title="formData.moduleId ? '编辑' : '新增'"
       :visible.sync="dialogVisible"
@@ -218,16 +113,11 @@
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
-        <el-button
-          @click="
-            dialogVisible = false
-            chongzhi()
-          "
-          >取 消</el-button
-        >
+        <el-button @click="chongzhi">取 消</el-button>
         <el-button type="primary" @click="addOperative">确 定</el-button>
       </span>
     </el-dialog>
+
     <!-- 选择图标 -->
     <el-dialog
       title="选择图标"
@@ -253,98 +143,53 @@ import iconList from '@/const/iconList.js'
 export default {
   data() {
     return {
-      baseURL: process.env.VUE_APP_BASE_API,
-      myHeaders: { 'x-token': getToken() },
       dataList: [], // 列表数据
       listLoading: true, // 列表加载loading
-      screenForm: {
-        // 筛选表单数据
-        keyword: '' // 关键词
-      },
-      editParentId: null,
-      addParentFormType: 'add',
-      addParentFormVisible: false,
-      addParentForm: {
-        oneMenu: '',
-        code: '',
-        url: '',
-        fullUrl: '',
-        icon: '',
-        sort: 0,
-        flag: '',
-        type: 1,
-        status: true,
-        isCache: 1
-      },
-      addParentFormRules: {
-        type: [{ required: true, message: '请选择类型', trigger: 'change' }],
-        oneMenu: [{ required: true, message: '请填写一级菜单名称', trigger: 'blur' }],
-        code: [{ required: true, message: '请填写菜单CODE', trigger: 'blur' }],
-        url: [{ required: true, message: '请填写菜单URL', trigger: 'blur' }],
-        icon: [{ required: true, message: '请选择图标', trigger: 'blur' }],
-        flag: [{ required: true, message: '请选择所属', trigger: 'blur' }]
-      },
-      editChildId: null,
-      addChildFormType: 'add',
-      addChildFormVisible: false,
-      addChildForm: {
-        oneMenu: '',
-        twoMenu: '',
-        code: '',
-        url: '',
-        fullUrl: '',
-        icon: '',
-        sort: 0,
-        flag: '',
-        type: 1,
-        status: true,
-        isCache: 1
-      },
-      addChildFormRules: {
-        type: [{ required: true, message: '请选择类型', trigger: 'change' }],
-
-        oneMenu: [{ required: true, message: '请选择一级菜单', trigger: 'change' }],
-        twoMenu: [{ required: true, message: '请填写二级菜单', trigger: 'blur' }],
-        code: [{ required: true, message: '请填写菜单CODE', trigger: 'blur' }],
-        url: [{ required: true, message: '请填写菜单URL', trigger: 'blur' }],
-        flag: [{ required: true, message: '请选择所属', trigger: 'blur' }]
-      },
       isChooseIconDialog: false,
       iconList: iconList,
-      chooseIconType: null,
       menuTypeList: [
         {
-          label: 1,
-          value: '目录'
+          value: 1,
+          label: '目录'
         },
         {
-          label: 2,
-          value: '页面'
+          value: 2,
+          label: '页面'
         },
         {
-          label: 4,
-          value: '外链'
+          value: 4,
+          label: '外链'
         }
       ],
-      tableData: [],
       dialogVisible: false,
       formData: {
         code: '',
-        moduleName: '',
+        moduleName: ''
       },
       formDataRules: {
         code: [{ required: true, message: '请选择类型', trigger: 'blur' }],
         moduleName: [{ required: true, message: '请选择类型', trigger: 'blur' }]
       },
-      operateType: null
+      menuFormData: {
+        parentId: '',
+        moduleId: '',
+        moduleName: '',
+        code: '',
+        url: '',
+        fullUrl: '',
+        icon: '',
+        sortNum: 0,
+        flag: '',
+        type: 1,
+        status: true,
+        isCache: 1,
+        childList: []
+      },
+      menuFormBool: false
     }
   },
   computed: {
     ...mapGetters(['userid', 'name']),
-    isAdmin() {
-      const type = JSON.parse(localStorage.getItem('supply_user')).type
-      return type === 2
-    },
     columns() {
       return [
         {
@@ -364,35 +209,44 @@ export default {
             label: '操作',
             prop: ''
           },
-          render: (h, { row, column, $index }) => {
+          render: (h, { row, column, index }) => {
             return (
               <div style="padding-left:10px">
-                <el-button
-                  size="mini"
-                  type="text"
-                  onClick={() => {
-                    getMenuDetail({ moduleId: row.moduleId }).then(res => {
-                      this.formData = {
-                        ...this.formData,
-                        ...res.data
-                      }
-                      this.dialogVisible = true
-                    })
-                  }}
-                >
-                  编辑
-                </el-button>
+                {row.moduleId ? (
+                  <el-button
+                    size="mini"
+                    type="text"
+                    onClick={() => {
+                      getMenuDetail({ moduleId: row.moduleId }).then(res => {
+                        this.formData = {
+                          ...this.formData,
+                          ...res.data
+                        }
+                        this.dialogVisible = true
+                      })
+                    }}
+                  >
+                    编辑
+                  </el-button>
+                ) : null}
                 <el-popconfirm
                   title="确定删除吗?"
                   onConfirm={() => {
-                    deleteMenu({ id: row.moduleId }).then(res => {
-                      this.$successMsg('删除成功')
-                      getMenuDetail({ moduleId: this.operateType === 1 ? this.editParentId : this.editChildId }).then(
-                        res => {
-                          this.tableData = res.data.childList.filter(item=>item.type!==2)
+                    if (row.moduleId && this.menuFormData.moduleId) {
+                      deleteMenu({ id: row.moduleId }).then(res => {
+                        this.$successMsg('删除成功')
+                        if (this.menuFormData.moduleId) {
+                          getMenuDetail({ moduleId: this.menuFormData.moduleId }).then(res => {
+                            this.menuFormData.childList = res.data.childList
+                          })
                         }
-                      )
-                    })
+                      })
+                    } else {
+                      var i = this.menuFormData.childList.findIndex(item => item.type == 3 && item.code == row.code)
+                      if (i > -1) {
+                        this.menuFormData.childList.splice(i, 1)
+                      }
+                    }
                   }}
                 >
                   <el-button slot="reference" type="text" size="mini">
@@ -404,12 +258,186 @@ export default {
           }
         }
       ]
+    },
+    basicInfo() {
+      return [
+        {
+          name: 'el-radio',
+          md: 24,
+          options: this.menuTypeList,
+          attributes: {
+            placeholder: '请选择'
+          },
+          formItemAttributes: {
+            label: '类型',
+            prop: 'type'
+          }
+        },
+        {
+          name: 'el-cascader',
+          md: 24,
+          attributes: {
+            placeholder: '请选择',
+            options: [{ moduleId: '0', moduleName: '设定一级' }, ...this.dataList],
+            props: { checkStrictly: true, value: 'moduleId', label: 'moduleName', emitPath: false },
+            filterable: true,
+            clearable: true,
+            style: { width: '100%' }
+          },
+          formItemAttributes: {
+            label: '上级菜单',
+            prop: 'parentId'
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            placeholder: '请输入菜单名称'
+          },
+          formItemAttributes: {
+            label: '菜单名称',
+            prop: 'moduleName',
+            rules: [{ required: true, message: '请选择类型', trigger: 'blur' }]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            placeholder: '请输入CODE'
+          },
+          formItemAttributes: {
+            label: 'CODE',
+            prop: 'code',
+            rules: [{ required: true, message: '请选择类型', trigger: 'blur' }]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            placeholder: '请输入URL'
+          },
+          formItemAttributes: {
+            label: 'URL',
+            prop: 'url'
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            placeholder: '请输入全URL'
+          },
+          formItemAttributes: {
+            label: '全URL',
+            prop: 'fullUrl'
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: {
+            label: '图标',
+            prop: 'icon'
+          },
+          render: (h, { props, onInput }) => {
+            var { formData, value } = props
+            return (
+              <div class="iconInput">
+                {formData.icon ? (
+                  <div class="icon">
+                    <i class={formData.icon} />
+                  </div>
+                ) : null}
+                <el-input value={value} onInput={onInput} placeholder="请选择图标" />
+                <el-button
+                  type="primary"
+                  onClick={() => {
+                    this.toChooseIcon(2)
+                  }}
+                >
+                  选择
+                </el-button>
+              </div>
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            placeholder: '请输入排序'
+          },
+          formItemAttributes: {
+            label: '排序',
+            prop: 'sortNum'
+          }
+        },
+        {
+          name: 'el-switch',
+          md: 24,
+          attributes: {
+            'active-value': true,
+            'inactive-value': false,
+            'active-color': '#13ce66',
+            'inactive-color': '#ff4949'
+          },
+          formItemAttributes: {
+            label: '是否显示',
+            prop: 'status'
+          }
+        },
+        {
+          name: 'el-switch',
+          md: 24,
+          attributes: {
+            'active-value': 1,
+            'inactive-value': 0,
+            'active-color': '#13ce66',
+            'inactive-color': '#ff4949'
+          },
+          formItemAttributes: {
+            label: '是否缓存页面',
+            prop: 'isCache'
+          }
+        },
+        {
+          isShow: this.menuFormData.type == 2,
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: {
+            label: '功能',
+            prop: ''
+          },
+          render: (h, { props, onInput }) => {
+            var { formData, value } = props
+            return (
+              <div>
+                <el-button style="margin-bottom: 10px" type="primary" size="small" onClick={this.hasShowTable}>
+                  新增
+                </el-button>
+                <zj-table
+                  is-drop={true}
+                  columns={this.columns}
+                  table-data={this.menuFormData.childList.filter(item => item.type != 2)}
+                  table-attributes={{
+                    border: true
+                  }}
+                />
+              </div>
+            )
+          }
+        }
+      ]
     }
   },
   created() {
     this.getList()
   },
   methods: {
+    // 获取菜单列表
     getList() {
       this.listLoading = true
       getMenuList({
@@ -418,12 +446,12 @@ export default {
       })
         .then(res => {
           this.dataList = this.recursionFn(res.data)
-          console.log(this.dataList)
         })
         .finally(() => {
           this.listLoading = false
         })
     },
+    // 组合数据
     recursionFn(arr) {
       if (!arr.length) return
       for (let i = 0; i < arr.length; i++) {
@@ -443,202 +471,111 @@ export default {
       }
       return arr || []
     },
-    // 打开 新增编辑 一级菜单
-    addOrEditParent(type, cid) {
-      this.addParentFormType = type
-      this.addParentFormVisible = true
-      this.operateType = 1
-      if (type == 'edit') {
-        this.editParentId = cid
-        getMenuDetail({ moduleId: cid }).then(res => {
-          this.addParentForm = {
-            oneMenu: res.data.moduleName,
-            code: res.data.code,
-            url: res.data.url,
-            fullUrl: res.data.fullUrl,
-            icon: res.data.icon,
-            sort: res.data.sortNum,
-            flag: res.data.flag,
-            type: res.data.type,
-            status: res.data.status,
-            isCache: res.data.isCache,
-            childList: res.data.childList
-          }
-        })
-      }
+    // 去选择图标
+    toChooseIcon(type) {
+      this.isChooseIconDialog = true
     },
 
-    // 取消 新增编辑 一级菜单
-    cancelAddParentForm() {
-      this.addParentFormVisible = false
-      this.tableData = []
-      this.$refs.addParentForm.resetFields()
+    // 选择图标
+    chooseIcon(value) {
+      this.menuFormData.icon = value
+      this.isChooseIconDialog = false
     },
 
-    // 提交 一级菜单
-    submitAddParentForm() {
-      this.$refs.addParentForm.validate(valid => {
-        if (valid) {
-          const params = {
-            moduleName: this.addParentForm.oneMenu,
-            code: this.addParentForm.code,
-            url: this.addParentForm.url,
-            fullUrl: this.addParentForm.fullUrl,
-            icon: this.addParentForm.icon,
-            sortNum: this.addParentForm.sort,
-            flag: this.addParentForm.flag,
-            parentId: 0,
-            type: this.addParentForm.type,
-            status: this.addParentForm.status,
-            isCache: this.addParentForm.isCache
-          }
-          if (this.addParentFormType == 'edit') {
-            params.moduleId = this.editParentId
-            editMenu(params).then(res => {
-              this.cancelAddParentForm()
-              this.getList()
-              this.$successMsg('编辑成功')
-            })
-          } else {
-            // params.type = 2;
-            addMenu(params).then(res => {
-              this.cancelAddParentForm()
-              this.getList()
-              this.$successMsg('添加成功')
-            })
-          }
-        }
-      })
+    // 打开功能窗口
+    hasShowTable() {
+      this.dialogVisible = true
     },
 
-    // 打开 新增编辑 二级菜单
-    addOrEditChild(type, cid) {
-      this.addChildFormType = type
-      this.addChildFormVisible = true
-      this.operateType = 2
-      if (type == 'add') {
-        this.addChildForm.oneMenu = cid
-      }
-
-      if (type == 'edit') {
-        this.editChildId = cid
-        getMenuDetail({ moduleId: cid }).then(res => {
-          this.addChildForm = {
-            oneMenu: res.data.parentId,
-            twoMenu: res.data.moduleName,
-            code: res.data.code,
-            url: res.data.url,
-            fullUrl: res.data.fullUrl,
-            icon: res.data.icon,
-            sort: res.data.sortNum,
-            flag: res.data.flag,
-            type: res.data.type,
-            status: res.data.status,
-            isCache: res.data.isCache,
-            childList: res.data.childList
-          };
-          this.tableData = res.data.childList.filter(item=>item.type!==2)
-        })
-      }
-    },
+    // 添加功能确定按钮
     addOperative() {
       this.$refs.formData.validate(valid => {
         if (valid) {
           const params = {
-            parentId: this.editChildId,
+            parentId: this.menuFormData.moduleId || '',
             moduleId: this.formData.moduleId || '',
             moduleName: this.formData.moduleName,
             code: this.formData.code,
-            type: 3,
             childList: this.formData.childList || null,
+            type: 3
           }
-          if (this.formData.moduleId) {
-            params.parentId = null
-            editMenu(params).then(res => {
-              this.dialogVisible = false
-              this.$successMsg('编辑成功')
-              this.chongzhi()
-              getMenuDetail({ moduleId: this.operateType === 1 ? this.editParentId : this.editChildId }).then(res => {
-                this.tableData = res.data.childList.filter(item=>item.type!==2)
+          if (this.menuFormData.moduleId) {
+            if (this.formData.moduleId) {
+              params.parentId = null
+              editMenu(params).then(res => {
+                this.$successMsg('编辑成功')
+                this.chongzhi()
+                getMenuDetail({ moduleId: this.menuFormData.moduleId }).then(res => {
+                  this.menuFormData.childList = res.data.childList
+                })
               })
-            })
-          } else {
-            addMenu(params).then(res => {
-              this.dialogVisible = false
-              this.$successMsg('添加成功')
-              this.chongzhi()
-              getMenuDetail({ moduleId: this.operateType === 1 ? this.editParentId : this.editChildId }).then(res => {
-                this.tableData = res.data.childList.filter(item=>item.type!==2)
+            } else {
+              addMenu(params).then(res => {
+                this.$successMsg('添加成功')
+                this.chongzhi()
+                getMenuDetail({ moduleId: this.menuFormData.moduleId }).then(res => {
+                  this.menuFormData.childList = res.data.childList
+                })
               })
-            })
+            }
+          } else {
+            var index = this.menuFormData.childList.findIndex(item => item.type == 3 && item.code == params.code)
+            if (index == -1) {
+              this.menuFormData.childList.push(params)
+            } else {
+              this.menuFormData.childList.splice(index, 1, params)
+            }
+            this.chongzhi()
           }
         }
       })
     },
+
+    // 关闭功能添加窗口
     chongzhi() {
       this.formData = {
         code: '',
-        moduleName: '',
+        moduleName: ''
       }
+      this.dialogVisible = false
     },
-    hasShowTable() {
-      this.dialogVisible = true
+
+    // 打开 新增编辑
+    openFormWin(type, cid) {
+      if (type == 'add') {
+        this.menuFormData.parentId = cid
+        this.menuFormBool = true
+      } else if (type == 'edit') {
+        getMenuDetail({ moduleId: cid }).then(res => {
+          this.menuFormData = {
+            ...res.data
+          }
+          this.menuFormBool = true
+        })
+      }
     },
-    // 取消 新增编辑 二级菜单
-    cancelAddChildForm() {
-      this.addChildFormVisible = false
-      this.tableData = []
-      this.$refs.addChildForm.resetFields()
+
+    // 关闭窗口
+    cancelFormWin() {
+      this.$data.menuFormData = this.$options.data().menuFormData
+      this.$refs?.formRef?.resetFields()
+      this.menuFormBool = false
     },
 
-    // 提交 二级菜单
-    submitAddChildForm() {
-      this.$refs.addChildForm.validate(valid => {
+    // 提交菜单
+    submitMenuForm() {
+      this.$refs.formRef.validate(valid => {
         if (valid) {
-          let params = {}
-          let parentId = null
-          if (this.addChildForm.oneMenu instanceof Array) {
-            parentId = this.addChildForm.oneMenu[this.addChildForm.oneMenu.length - 1] || 0
-          } else {
-            parentId = this.addChildForm.oneMenu || 0
-          }
-          if (this.addChildFormType == 'edit') {
-            params = {
-              parentId,
-              moduleId: this.editChildId,
-              moduleName: this.addChildForm.twoMenu,
-              code: this.addChildForm.code,
-              url: this.addChildForm.url,
-              fullUrl: this.addChildForm.fullUrl,
-              icon: this.addChildForm.icon,
-              sortNum: this.addChildForm.sort,
-              flag: this.addChildForm.flag,
-              type: this.addChildForm.type,
-              status: this.addChildForm.status,
-              isCache: this.addChildForm.isCache
-            }
-            editMenu(params).then(res => {
-              this.cancelAddChildForm()
+          if (this.menuFormData.moduleId) {
+            editMenu(this.menuFormData).then(res => {
               this.getList()
+              this.cancelFormWin()
               this.$successMsg('编辑成功')
             })
           } else {
-            params = {
-              parentId,
-              moduleName: this.addChildForm.twoMenu,
-              code: this.addChildForm.code,
-              url: this.addChildForm.url,
-              fullUrl: this.addChildForm.fullUrl,
-              icon: this.addChildForm.icon,
-              sortNum: this.addChildForm.sort,
-              flag: this.addChildForm.flag,
-              type: this.addChildForm.type,
-              status: this.addChildForm.status,
-              isCache: this.addChildForm.isCache
-            }
-            addMenu(params).then(res => {
-              this.cancelAddChildForm()
+            addMenu(this.menuFormData).then(res => {
               this.getList()
+              this.cancelFormWin()
               this.$successMsg('添加成功')
             })
           }
@@ -652,22 +589,6 @@ export default {
         this.getList()
         this.$successMsg()
       })
-    },
-
-    // 去选择图标
-    toChooseIcon(type) {
-      this.chooseIconType = type
-      this.isChooseIconDialog = true
-    },
-
-    // 选择图标
-    chooseIcon(value) {
-      if (this.chooseIconType === 1) {
-        this.addParentForm.icon = value
-      } else if (this.chooseIconType > 1) {
-        this.addChildForm.icon = value
-      }
-      this.isChooseIconDialog = false
     }
   }
 }
@@ -696,7 +617,7 @@ export default {
     }
   }
 }
-.iconInput {
+::v-deep .iconInput {
   display: flex;
   .icon {
     margin-right: 10px;
@@ -730,8 +651,10 @@ export default {
 .el-table__row.expanded {
   background: #f5f5f5;
 }
-
-// th {
-//   text-align: center !important;
-// }
+.neibuviewaaaaa {
+  .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding: 20px 50px;
+  }
+}
 </style>

+ 52 - 0
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/activateOrder.vue

@@ -0,0 +1,52 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="abnormal" :disabled="disabled" type="primary" size="mini">激活工单</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+import { orderBaseActive } from "@/api/workOrderPool.js"
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    abnormal() {
+      this.lockBtn()
+      MessageBox.confirm('是否确定将此单重新激活,请谨慎操作', '激活工单确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        orderBaseActive({ orderBaseId: this.orderInfo.id }).then(res => {
+          this.unlockBtn()
+          // 编辑保存后不跳转列表,刷新数据
+          this.acquireVerify(this, 'getorderDetail')()
+          // 刷新操作记录
+          this.acquireVerify(this, 'getOrderBaseLogList')()
+          this.$message({
+            type: 'success',
+            message: '激活成功!'
+          })
+        }).catch(() => {
+          this.unlockBtn()
+        })
+      }).catch(() => {
+        this.unlockBtn()
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 7 - 3
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue

@@ -47,9 +47,11 @@
         <!-- 7,回访  -->
         <processFeedback v-if="~btnRestrict.indexOf(7)" resultCodeName="回访" resultCode="回访" :orderInfo="orderInfo"
           :orderType="orderType" />
-        <!-- 工单驳回 -->
-        <orderReject v-if="~btnRestrict.indexOf(9)" :orderInfo="orderInfo" :orderType="orderType" />
         <!-- 8,新建工单 -->
+        <!-- 9,工单驳回 -->
+        <orderReject v-if="~btnRestrict.indexOf(9)" :orderInfo="orderInfo" :orderType="orderType" />
+        <!-- 10,激活工单 -->
+        <activateOrder v-if="~btnRestrict.indexOf(10)" :orderInfo="orderInfo" :orderType="orderType" />
       </div>
       <div style="box-sizing: border-box; padding: 10px 10px 0" v-else>
         <!-- 关闭 -->
@@ -79,6 +81,7 @@ import abnormal from './buttons/abnormal.vue'
 import processFeedback from './buttons/processFeedback.vue'
 import cancelOrder from './buttons/cancelOrder.vue'
 import orderReject from './buttons/orderReject.vue'
+import activateOrder from './buttons/activateOrder.vue'
 
 export default {
   components: {
@@ -90,7 +93,8 @@ export default {
     abnormal,
     processFeedback,
     cancelOrder,
-    orderReject
+    orderReject,
+    activateOrder
   },
   mixins: [
     workOrderLogic,

+ 2 - 2
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -108,7 +108,7 @@ export default {
     },
     // 处理操作按钮是否可以操作
     btnRestrict() {
-      // 1,保存 2,过程反馈 3,设为异常 4,加急 5,不加急 6,取消工单 7,回访 8,新建工单
+      // 1,保存 2,过程反馈 3,设为异常 4,加急 5,不加急 6,取消工单 7,回访 8,新建工单 9,工单驳回 10,激活工单
       var btns = []
       if (this.orderInfo) {
         btns = {
@@ -129,7 +129,7 @@ export default {
           // 已结算
           YJS: [],
           // 已取消
-          YQX: []
+          YQX: [10]
         }[this.orderInfo.orderStatus]
       }