소스 검색

工艺项目管理

landydb 3 주 전
부모
커밋
2b08913341

+ 111 - 0
src/views/modules/tech/project-tech-assign.vue

@@ -0,0 +1,111 @@
+<template>
+  <div>
+    <div class="my-title">分派</div>
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      label-width="auto"
+    >
+      <el-row class="my-row">
+        <el-col :span="24">
+          <el-form-item label="责任人" prop="responsibilityPerson">
+            <user-component
+              v-model="dataForm.responsibilityPerson"
+              :user-id="dataForm.responsibilityPerson"
+              @userSelected="selectChange"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <el-button
+        v-if="!display"
+        type="primary"
+        @click="dataFormSubmit()"
+        v-reClick
+        >确定</el-button
+      >
+    </span>
+  </div>
+</template>
+
+<script>
+import UserComponent from '../common/user-component'
+export default {
+  name: 'project-product-assign',
+  components: { UserComponent },
+  computed: {},
+  data () {
+    return {
+      visible: false,
+      id: 0,
+      dataForm: {},
+      dataRule: {
+        responsibilityPerson: [
+          {
+            required: true,
+            message: '请选择责任人',
+            trigger: 'blur'
+          }
+        ]
+      }
+    }
+  },
+  created () {},
+  beforeDestroy () {},
+  methods: {
+    onChose () {
+      this.$emit('onChose')
+    },
+    async init (item, display) {
+      this.dataForm = item
+
+      this.visible = true
+    },
+    validateField (type) {
+      this.$refs.dataForm.validateField(type)
+    },
+    // 表单提交
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/projTechnology/assign`),
+            method: 'post',
+            data: this.$http.adornData({
+              technologyId: this.dataForm.technologyId,
+              responsibilityPerson: this.dataForm.responsibilityPerson
+            })
+          }).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)
+            }
+          })
+        }
+      })
+    },
+    selectChange (val) {
+      this.dataForm.responsibilityPerson = val
+    }
+  }
+}
+</script>
+
+<style scoped>
+.my-row {
+  margin-bottom: 20px;
+}
+</style>

+ 93 - 0
src/views/modules/tech/project-tech-notice-change-setting.vue

@@ -0,0 +1,93 @@
+<template>
+    <div>
+        <div class="my-title">发货通知人设置</div>
+        <!-- 表单 -->
+        <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+          <el-row class="my-row">
+            <el-form-item label="通知接收人" prop="userIds">
+              <user-components v-model="dataForm.userIds" :userIds="dataForm.userIds" @change="userSelectedChanged"/>
+            </el-form-item>
+          </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 UserComponents from '../common/user-components'
+
+export default {
+    name: 'dispatch-notice-change-setting',
+    components: {
+      UserComponents
+    },
+    data () {
+      return {
+        visible: false,
+        dataForm: {
+          userIds: []
+        },
+        dataRule: {
+          userIds: [{ required: true, message: '请选择通知接收人', trigger: 'change' }]
+        }
+      }
+    },
+    methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
+      async init () {
+        this.dataForm = {}
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/projTechnology/noteChangeConfig`),
+          method: 'get'
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = {
+              userIds: data.data
+            }
+          }
+        })
+        this.visible = true
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/projProduct/noteChangeConfig`),
+              method: 'post',
+              data: this.dataForm.userIds
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.onChose()
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      },
+      userSelectedChanged (val) {
+        this.dataForm.userIds = val
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 290 - 0
src/views/modules/tech/project-tech-submit.vue

@@ -0,0 +1,290 @@
+<template>
+  <div>
+    <div class="my-title">处理</div>
+    <el-form
+      :model="dataForm"
+      :rules="dataRule"
+      ref="dataForm"
+      label-width="auto"
+    >
+      <el-row class="my-row">
+        <el-col :span="6">
+          <el-form-item label="项目名称:" prop="projectName">
+            <span>{{dataForm.projectName}}</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="任务号:" prop="orderCode">
+            <span>{{dataForm.orderCode}}</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="技术协议:" prop="attachFile1">
+            <span @click="attachDetail(dataForm.attachFile1)">{{dataForm.attachFile1 == null ? '' : dataForm.attachFile1[0].fileName}}</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="资料:" prop="attachFile2">
+            <span @click="attachDetail(dataForm.attachFile1)">{{dataForm.attachFile2 == null ? '' : dataForm.attachFile2[0].fileName}}</span>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-table 
+        :data="dataForm.proProductList"
+        border
+        v-loading="dataListLoading"
+        style="width: 100%;">
+        <el-table-column
+          label="序号"
+          type="index"
+          width="100"
+          align="center">
+        </el-table-column>
+        <el-table-column
+          prop="productName"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="名称">
+        </el-table-column>
+        <el-table-column
+          prop="mapNumber"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="图号">
+        </el-table-column>
+        <el-table-column
+          prop="versionNumber"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="版本号">
+        </el-table-column>
+        <el-table-column
+          prop="attachList2"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="简图">
+          <template slot-scope="scope">
+            <el-button :disabled="!scope.row.attachList2 || scope.row.attachList2.length === 0" type="text" size="small" @click="attachDetail(scope.row.attachList2)">查看</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="unit"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="单位">
+        </el-table-column>
+        <el-table-column
+          prop="cnt"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="单套数量">
+        </el-table-column>
+        <el-table-column
+          prop="productSpec"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="材料规格">
+        </el-table-column>
+        <el-table-column
+          prop="size"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="净尺寸">
+        </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="heatTreatment"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="热处理">
+        </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="isTechnology"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="是否编制工艺">
+          <template slot-scope="scope">
+            {{scope.row.isTechnology == 2 ? '否' : '是' }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="techId"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="是否有工艺">
+          <template slot-scope="scope">
+            {{scope.row.techId == null || scope.row.techId == 0 ? '否' : '是' }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="notes"
+          header-align="center"
+          align="center"
+          min-width="140"
+          :show-tooltip-when-overflow="true"
+          label="备注">
+        </el-table-column>
+        <el-table-column
+          v-if="!disabled"
+          fixed="right"
+          prop="disposal"
+          header-align="center"
+          align="center"
+          width="120"
+          :show-tooltip-when-overflow="true"
+          label="操作">
+          <template slot-scope="scope">
+            <el-button type="text" v-if="scope.row.techId == null || scope.row.techId == 0">新建工艺</el-button>
+            <el-button type="text" v-else>修改工艺</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+    </span>
+
+    <attach-detail-dialog ref="attachDetail"/>
+  </div>
+</template>
+
+<script>
+import AttachDetailDialog from '../common/attach-detail-dialog'
+export default {
+  name: 'plan-submit',
+  components: { AttachDetailDialog },
+  computed: {},
+  data () {
+    return {
+      disabled: false,
+      id: 0,
+      dataForm: {
+        proProductList:[]
+      },
+      dataRule: {
+        planCnt:[{required:true, message:'请输入', trigger:'blur'}],
+        disposal:[{required:true, message:'请选择', trigger:'change'}],
+        isTechnology:[{required:true, message:'请选择', trigger:'change'}],
+      },
+      dataList: [],
+      dataListLoading: false
+    }
+  },
+  created () {},
+  beforeDestroy () {},
+  methods: {
+    onChose () {
+      this.$emit('onChose')
+    },
+    async init (item, readonly) {
+      let id = item.technologyId;
+      if(readonly){
+        this.disabled = true
+      }
+
+      this.$http({
+            url: this.$http.adornUrl(`/biz-service/projTechnology/info/${id}`),
+            method: 'get'
+          }).then(({data}) => {
+            if(data && data.code === '200'){
+              this.dataForm = data.data;
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+    },
+    validateField (type) {
+      this.$refs.dataForm.validateField(type)
+    },
+    attachDetail (attachList) {
+      this.$nextTick(() => {
+        this.$refs.attachDetail.init(attachList)
+      })
+    },
+    // 表单提交
+    dataFormSubmit () {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          let data = {
+            orderCode: this.dataForm.orderCode,
+            proProductList: this.dataForm.proProductList
+          };
+
+          console.log('data', data)
+
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/projProduction/submitPlan`),
+            method: 'post',
+            data: this.$http.adornData(data)
+          }).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>
+.my-row {
+  margin-bottom: 20px;
+}
+
+.radio-group-wrap {
+  display: flex;
+  align-items: flex-start;
+  flex-direction: column;
+  gap: 10px 0px; /* 行列间距控制 */
+}
+</style>

+ 233 - 0
src/views/modules/tech/project-tech.vue

@@ -0,0 +1,233 @@
+<!-- 工种管理 -->
+<template>
+  <div class="work-type">
+    <template v-if="!assignVisible && !noticeChangeVisible && !submitVisible">
+      <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 @click="noticeSettingHandle(null, 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="100"
+          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="customerName"
+          header-align="center"
+          align="center"
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          label="客户名称">
+        </el-table-column>
+        <el-table-column
+          prop="deliveryDate"
+          header-align="center"
+          align="center"
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          label="合同交期">
+        </el-table-column>
+        <el-table-column
+          prop="createTime"
+          header-align="center"
+          align="center"
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          label="创建时间">
+        </el-table-column>
+        <el-table-column
+          prop="responsibilityPerson"
+          header-align="center"
+          align="center"
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          label="责任人">
+        </el-table-column>
+        <el-table-column
+          prop="state"
+          header-align="center"
+          align="center"
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          :formatter="formatState"
+          label="状态">
+        </el-table-column>
+        <el-table-column
+          fixed="right"
+          header-align="center"
+          align="center"
+          width="220"
+          label="操作">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="submitHandle(scope.row, true)">查看</el-button>
+            <el-button type="text" size="small" @click="assignHandle(scope.row)">分派</el-button>
+            <el-button type="text" size="small" @click="submitHandle(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>
+    <!-- 弹窗 -->
+    <assign v-if="assignVisible" ref="assign" @onChose="onChose"/>
+    <notice-change v-if="noticeChangeVisible" ref="noticeChange" @onChose="onChose"/>
+    <submit-plan v-if="submitVisible" ref="submit" @onChose="onChose"/>
+  </div>
+</template>
+
+<script>
+  import Assign from '@/views/modules/tech/project-tech-assign'
+  import NoticeChange from '@/views/modules/tech/project-tech-notice-change-setting'
+  import SubmitPlan from '@/views/modules/tech/project-tech-submit'
+  export default {
+    name: 'plan',
+    components: {
+      Assign, NoticeChange, SubmitPlan
+    },
+    data () {
+      return {
+        assignVisible: false,
+        noticeChangeVisible: false,
+        submitVisible: false,
+        dataForm: {},
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: [],
+        optionsLevel: [],
+        importLoading: false,
+        importData: {},
+        fileList: [],
+        stateOption: [
+          {label: '待处理', value: '1'},
+          {label: '已处理', value: '2'}
+        ]
+      }
+    },
+    created () {
+      this.getDataList()
+    },
+    methods: {
+      onChose () {
+        this.detailVisible = false
+        this.assignVisible = false
+        this.noticeChangeVisible = false
+        this.submitVisible = false
+      },
+      // 查询
+      queryData () {
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 获取数据列表
+      getDataList () {
+        this.dataListLoading = true
+        this.addOrUpdateVisible = false
+  
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/projTechnology/list`),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.pageIndex,
+            'size': this.pageSize,
+            'orderCode': this.dataForm.orderCode,
+          })
+        }).then(({data}) => {
+          this.dataListLoading = false
+          if (data && data.code === '200') {
+            this.dataList = data.data.records
+            this.totalPage = Number(data.data.total)
+          } else {
+            this.dataList = []
+            this.totalPage = 0
+          }
+        })
+      },
+      // 每页数
+      sizeChangeHandle (val) {
+        this.pageSize = val
+        this.pageIndex = 1
+        this.getDataList()
+      },
+      // 当前页
+      currentChangeHandle (val) {
+        this.pageIndex = val
+        this.getDataList()
+      },
+      // 多选
+      selectionChangeHandle (val) {
+        this.dataListSelections = val
+      },
+      assignHandle (item) {
+        this.assignVisible = true
+        this.$nextTick(() => {
+          this.$refs.assign.init(item)
+        })
+      },
+      submitHandle(item, readonly) {
+        this.submitVisible = true
+        this.$nextTick(() => {
+          this.$refs.submit.init(item, readonly)
+        })
+      },
+      formatState (row) {
+        if (!row.state) return ''
+        
+        return this.getStateStr(row.state)
+      },
+      getStateStr(state){
+        let option = this.stateOption.find(t => t.value === state)
+        if (option != null) {
+          return option.label
+        }
+        return ''
+      },
+      noticeSettingHandle(){
+        this.noticeChangeVisible = true
+        this.$nextTick(() => {
+          this.$refs.noticeChange.init()
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>