chrislee 1 月之前
父节点
当前提交
a82e9c892b

+ 36 - 0
src/api/workshop.js

@@ -0,0 +1,36 @@
+import request from '@/utils/httpRequest'
+
+// 车间列表
+export function getList (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/pro-workshop/list`),
+    method: 'get',
+    params: data
+  })
+}
+
+// 车间详情
+export function getDetail (id) {
+  return request({
+    url: request.adornUrl(`/biz-service/pro-workshop/detail/${id}`),
+    method: 'get'
+  })
+}
+
+// 上传技术文件
+export function save (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/pro-workshop/save`),
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改技术文件
+export function update (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/pro-workshop/update`),
+    method: 'post',
+    data: data
+  })
+}

+ 1 - 0
src/icons/svg/icon-chejian.svg

@@ -0,0 +1 @@
+<svg t="1751354528521" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4523" width="200" height="200"><path d="M739.84 673.216a239.84 239.84 0 0 0-325.984-328.096l47.744 47.776 105.792 105.76-90.496 90.528-105.92-105.92-47.744-47.712a236.8 236.8 0 0 0-25.216 65.28 241.312 241.312 0 0 0-6.048 52.928 239.744 239.744 0 0 0 359.488 207.968l188.48 230.72a82.464 82.464 0 0 0 59.424 30.496c1.344 0.064 2.656 0.096 4 0.096a72.224 72.224 0 0 0 51.712-21.152l24.992-25.024a72.576 72.576 0 0 0 21.056-55.68 82.56 82.56 0 0 0-30.464-59.424z m-83.424 4.992a175.52 175.52 0 0 1-299.904-118.88l93.888 93.888a37.312 37.312 0 0 0 52.864 0.064l128.32-128.288a37.504 37.504 0 0 0-0.064-52.704L537.6 378.4a175.424 175.424 0 0 1 118.784 299.84z m278.4 253.44l-24.992 24.96a9.792 9.792 0 0 1-7.264 2.4 18.624 18.624 0 0 1-13.024-7.04L708.16 729.92l222.016 181.344a18.72 18.72 0 0 1 7.04 13.088 9.472 9.472 0 0 1-2.4 7.232z" fill="#575869" p-id="4524"></path><path d="M1007.296 331.52l-207.36-141.92V55.68h-64v90.144L531.456 5.952a31.072 31.072 0 0 0-14.88-4.992 447.104 447.104 0 0 0-9.216 0 31.104 31.104 0 0 0-14.88 4.992L16.704 331.488a32 32 0 1 0 36.128 52.8l45.792-31.328v638.208a32 32 0 0 0 32 32l0.48-0.096 0.448 0.096h500.48v-64H162.624V309.184L512 70.144l347.2 237.536v285.952h64v-242.176l48 32.864a32 32 0 1 0 36.096-52.8z" p-id="4525"></path></svg>

+ 2 - 2
src/views/modules/order/order-add-or-update.vue

@@ -24,8 +24,8 @@
       <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
         <el-row class="my-row">
           <el-col :span="8">
-            <el-form-item label="任务单编码" prop="orderCode">
-              <el-input v-model="dataForm.orderCode" placeholder="任务单编码"></el-input>
+            <el-form-item label="任务" prop="orderCode">
+              <el-input v-model="dataForm.orderCode" placeholder="请输入任务号"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8" style="padding-left: 20px">

+ 122 - 0
src/views/modules/tech/workshop-add-or-update.vue

@@ -0,0 +1,122 @@
+<template>
+  <div>
+    <div class="my-title">{{ !id ? "新增" : "修改" }}</div>
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      label-width="180px"
+    >
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="名称" prop="name">
+            <el-input v-model="dataForm.name" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="16">
+          <el-form-item label="描述" prop="description">
+            <el-input v-model="dataForm.description" placeholder="请输入"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="主管" prop="workshopManager">
+            <UserComponent
+              v-model="dataForm.workshopManager"
+              :user-id="dataForm.workshopManager"
+              :displayStar="true"
+              @userSelected="userSelected"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="16">
+          <el-form-item label="备注说明" prop="remark">
+            <el-input
+              v-model="dataForm.remark"
+              placeholder="请输入"
+              type="textarea"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <el-button type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
+    </span>
+  </div>
+</template>
+
+<script>
+import { getDetail } from '@/api/workshop'
+import UserComponent from '../common/user-component.vue'
+export default {
+  name: 'workshop-add-or-update',
+  components: {ProductComponent, uploadComponent},
+  data () {
+    return {
+      id: 0,
+      dataForm: {},
+      materialList: [],
+      dataRule: {
+        name: [
+          { required: true, message: '请输入名称', trigger: 'blur' },
+          { min: 1, max: 50, message: '长度在 1 到 50 个字符之间', trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  created () {
+  },
+  methods: {
+    init (id) {
+      this.id = id || 0
+      if(!id) return
+      this.getDetail()
+    },
+    onChose () {
+      this.$emit('onChose')
+    },
+    getDetail () {
+      getDetail(this.id).then(({ data }) => {
+        if (data && data.code === '200') {
+          this.dataForm = data.data || {}
+        } else {
+          this.$message.error(data.msg)
+        }
+      })
+    },
+    dataFormSubmit () {
+      // this.$refs['dataForm'].validate((valid) => {
+      //   if (valid) {
+      //     this.$http({
+      //       url: !this.id
+      //         ? this.$http.adornUrl(`/biz-service/pro-program/save`)
+      //         : this.$http.adornUrl(`/biz-service/pro-program/update`),
+      //       method: 'post',
+      //       data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
+      //     }).then(({ data }) => {
+      //       if (data && data.code === '200') {
+      //         this.$message({
+      //           message: '操作成功',
+      //           type: 'success',
+      //           duration: 1500,
+      //           onClose: () => {
+      //             this.onChose()
+      //             this.$emit('refreshDataList')
+      //           }
+      //         })
+      //       } else {
+      //         this.$message.error(data.msg)
+      //       }
+      //     })
+      //   }
+      // })
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 219 - 0
src/views/modules/tech/workshop-manage.vue

@@ -0,0 +1,219 @@
+<!-- 车间管理 -->
+<template>
+  <div>
+    <template v-if="!addOrUpdateVisible && !detailVisible">
+      <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
+        <el-form-item label="项目/任务号">
+          <el-input v-model="dataForm.orderCode" placeholder="" clearable/>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="queryData()">查询</el-button>
+          <el-button type="primary" @click="addOrUpdateHandle(0, false)">新增</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table
+        :data="dataList"
+        border
+        v-loading="dataListLoading"
+        style="width: 100%;">
+        <el-table-column
+          label="序号"
+          type="index"
+          width="50"
+          align="center">
+        </el-table-column>
+         <el-table-column
+          prop="projectName"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="项目名称">
+        </el-table-column>
+        <el-table-column
+          prop="orderCode"
+          header-align="center"
+          align="center"
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          label="任务号">
+        </el-table-column>
+        <el-table-column
+          prop="attachList"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="技术协议"
+        >
+        <template slot-scope="scope">
+            <el-button
+              :disabled="
+                !scope.row.attachList || scope.row.attachList.length === 0
+              "
+              type="text"
+              size="small"
+              @click="attachDetails(scope.row.attachList)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="attachList1"
+          header-align="center"
+          align="center"
+          :show-tooltip-when-overflow="true"
+          label="技术文件"
+        >
+        <template slot-scope="scope">
+            <el-button
+              :disabled="
+                !scope.row.attachList1 || scope.row.attachList1.length === 0
+              "
+              type="text"
+              size="small"
+              @click="attachDetails(scope.row.attachList1)"
+              >查看</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="notes"
+          header-align="center"
+          align="center"
+         :show-tooltip-when-overflow="true"
+          label="备注">
+        </el-table-column>
+        <el-table-column
+          prop="createTime"
+          header-align="center"
+          align="center"
+          min-width="120"
+          :show-tooltip-when-overflow="true"
+          label="创建时间">
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          header-align="center"
+          align="center"
+          width="150"
+          label="操作">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
+            <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row, false)">编辑</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        @size-change="sizeChangeHandle"
+        @current-change="currentChangeHandle"
+        :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageSize"
+        :total="totalPage"
+        layout="total, sizes, prev, pager, next, jumper">
+      </el-pagination>
+    </template>
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
+    <detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
+
+    <attach-detail-dialog ref="attachDetail" @onChose="onChose" />
+  </div>
+</template>
+
+<script>
+  import AddOrUpdate from './workshop-add-or-update'
+  import Detail from './file-manage-detail'
+  import { getList } from '@/api/workshop'
+  import AttachDetailDialog from '../common/attach-detail-dialog'
+  export default {
+    name: 'workshop-manage',
+    components: {
+      AddOrUpdate, Detail, AttachDetailDialog
+    },
+    data () {
+      return {
+        addOrUpdateVisible: false,
+        detailVisible: false,
+        dataForm: {},
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: [],
+        optionsLevel: []
+      }
+    },
+    created () {
+      this.getDataList()
+    },
+    methods: {
+      onChose () {
+        this.addOrUpdateVisible = false
+        this.detailVisible = false
+      },
+      // 查询
+      queryData () {
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 获取数据列表
+      getDataList () {
+        this.dataListLoading = true
+        this.addOrUpdateVisible = false
+        let params = {
+          'current': this.pageIndex,
+          'size': this.pageSize,
+          'orderCode': this.dataForm.orderCode ? this.dataForm.orderCode : null
+        }
+        getList(params).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataList = data.data.records
+            this.totalPage = Number(data.data.total)
+          } else {
+            this.dataList = []
+            this.totalPage = 0
+          }
+          this.dataListLoading = false
+        })
+      },
+      // 每页数
+      sizeChangeHandle (val) {
+        this.pageSize = val
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 当前页
+      currentChangeHandle (val) {
+        this.pageIndex = val
+        this.getDataList()
+      },
+      // 多选
+      selectionChangeHandle (val) {
+        this.dataListSelections = val
+      },
+      // 新增 / 修改
+      addOrUpdateHandle (item, disable) {
+        this.addOrUpdateVisible = true
+        this.$nextTick(() => {
+          this.$refs.addOrUpdate.init(item, disable)
+        })
+      },
+      // 详情
+      detailHandle (item) {
+        this.detailVisible = true
+        this.$nextTick(() => {
+          this.$refs.detail.init(item)
+        })
+      },
+      attachDetails (attachList) {
+        this.$refs.attachDetail.init(attachList)
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>