lyh
3 天以前 aed6fe7716c2d0b456a67be7753a2e9c8f0b7e11
开发DNC首页集成三维工艺列表页面
已添加4个文件
已修改1个文件
745 ■■■■■ 文件已修改
src/views/dashboard/SyncProcessList.vue 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/dncIndex/DncManagerSignage.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/SyncProcessSpecificationInfoList.vue 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.Style#Drawer.vue 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/SyncProcessList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,228 @@
<template>
  <div class="sync-process-container">
    <a-spin :spinning="loading">
      <a-table
        :columns="columns"
        :data-source="syncProcessList"
        rowKey="id"
        :pagination="false"
        class="process-table"
        :scroll="{ y: 400 }"
      >
        <span slot="action" slot-scope="text, record">
          <a-popconfirm title="确定领取吗?" @confirm="() => handleInspection(record.id)">
            <a>领取</a>
          </a-popconfirm>
        </span>
      </a-table>
    </a-spin>
    <!-- è¡¨å•区域 -->
    <syncProcessSpecificationInfo-modal ref="modalForm" @ok="modalFormOk"></syncProcessSpecificationInfo-modal>
  </div>
</template>
<script>
import '@/assets/less/TableExpand.less'
import SyncProcessSpecificationInfoModal from '../dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '@api/manage'
export default {
  name: "SyncProcessSpecificationInfoList",
  mixins: [JeecgListMixin],
  components: {
    SyncProcessSpecificationInfoModal
  },
  data() {
    return {
      syncProcessList: [],
      url: {
        list: '/dnc/home/syncProcessSpecificationInfo',
        isSameNode: '/assign/flow/isSameNode',
        receiveInspectionOrder:"/dnc/home/receiveTree"
      },
      // è¡¨æ ¼åˆ—配置
      columns: [
        {
          title: '产品代号',
          align: "center",
          dataIndex: 'productCode',
          scopedSlots: { customRender: 'productCode' },
          width: '10%'
        },
        {
          title: '部件名称',
          align: "center",
          dataIndex: 'partName',
        },
        {
          title: '部件编号',
          align: "center",
          dataIndex: 'partNumber',
        },
        {
          title: '部件版本',
          align: "center",
          dataIndex: 'partVersion',
        },
        {
          title: '工艺规程编号',
          align: "center",
          dataIndex: 'planNumber',
        },
        {
          title: '工艺规程版本',
          align: "center",
          dataIndex: 'planVersion',
        },
        {
          title: '发布时间',
          align: "center",
          dataIndex: 'createTime'
        },
        {
          title: '操作',
          align: "center",
          scopedSlots: { customRender: 'action' },
        }
      ]
    };
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  methods: {
    handleReceive(item) {
      console.log('领取任务', item);
      // å®žé™…业务中调用领取接口
      this.$message.success('任务领取成功');
      // æ›´æ–°æœ¬åœ°æ•°æ®çŠ¶æ€
      this.syncProcessList = this.syncProcessList.map(i =>
        i.id === item.id ? {...i, isReceive: true} : i
      );
    },
    loadData() {
      this.syncProcessList = [];
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!');
        return;
      }
      this.loading = true;
      getAction(this.url.list).then((res) => {
        if (res.success) {
          // ä½¿ç”¨çœŸå®žæŽ¥å£æ•°æ®
          this.syncProcessList = res.result.records || res.result;
        } else {
          this.$message.warning(res.message);
        }
      }).finally(() => {
        this.loading = false;
      });
    },
    /**
     * é¢†å–
     * @param id
     */
    handleInspection(id) {
      var that = this
      this.loading = true
      getAction(that.url.receiveInspectionOrder, { id })
        .then((res) => {
          if (res.success) {
            that.$notification.success({
              message: '消息',
              description: res.message
            })
            that.loadData()
          } else {
            that.$notification.warning({
              message: '消息',
              description: res.message
            })
            this.loading = false
          }
        })
    },
  },
  mounted() {
    this.loadData();
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.sync-process-container {
  padding: 16px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  height: 500px;
  display: flex;
  flex-direction: column;
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.table-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d2129;
}
.more-button {
  background-color: #1890ff;
  border-color: #1890ff;
  font-weight: 500;
}
.more-button:hover {
  background-color: #40a9ff;
  border-color: #40a9ff;
}
/* è¡¨æ ¼æ ·å¼ */
.process-table {
  flex: 1;
  overflow: hidden;
}
/* äº§å“ä»£å·é“¾æŽ¥æ ·å¼ */
.process-table >>> .ant-table-tbody a {
  color: #1890ff;
  transition: color 0.3s;
  font-weight: 500;
}
.process-table >>> .ant-table-tbody a:hover {
  color: #40a9ff;
  text-decoration: underline;
}
/* æ“ä½œæŒ‰é’®æ ·å¼ */
.process-table >>> .ant-btn-link {
  padding: 0 4px;
}
/* è¡¨æ ¼è¡Œæ‚¬åœæ•ˆæžœ */
.process-table >>> .ant-table-row:hover td {
  background-color: #f0f8ff !important;
  cursor: pointer;
}
/* è¡¨æ ¼æ»šåŠ¨åŒºåŸŸæ ·å¼ */
.process-table >>> .ant-table-body {
  overflow-y: auto !important;
}
</style>
src/views/dashboard/dncIndex/DncManagerSignage.vue
@@ -20,8 +20,12 @@
    <!-- å³ä¾§ä¸¤ä¸ªå°å¡ç‰‡ -->
    <div class="right-cards">
      <div class="card top-card">
        <h2 class="card-title">卡片1</h2>
        <h2 class="card-title">三维工艺生成产品结构树</h2>
        <h2 class="more-btns" @click = "gotoSyncProcessList">更多</h2>
        <div class="card-content">
          <syncProcessList
            ref="syncProcessList"
            ></syncProcessList>
        </div>
      </div>
@@ -36,11 +40,14 @@
<script>
import TodoList from '@views/dashboard/TodoList.vue'
import SyncProcessList from '@views/dashboard/SyncProcessList.vue'
export default {
  name: 'DncManagerSignage',
  components: {
    TodoList
    TodoList,
    SyncProcessList
  },
  data() {
    return {
@@ -56,7 +63,10 @@
  methods: {
    gotoTodoList() {
      this.$router.push('/flowable/workflow/FlowTodo')
    }
    },
    gotoSyncProcessList(){
      this.$router.push('/dnc/base/SyncProcessSpecificationInfoList')
    },
  }
}
</script>
@@ -116,6 +126,19 @@
  border: none;
  cursor: pointer;
}
.more-btns {
  position: absolute;
  top: 140px;
  right: 40px;
  color: #1890ff;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  z-index: 10;
}
.top-card {
  flex: 1;
}
src/views/dnc/base/SyncProcessSpecificationInfoList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,192 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="产品名称">
              <a-input placeholder="请输入产品名称" v-model="queryParam.productName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="产品代号">
              <a-input placeholder="请输入产品代号" v-model="queryParam.productCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="部件名称">
              <a-input placeholder="请输入部件名称" v-model="queryParam.partName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="部件编号">
              <a-input placeholder="请输入部件编号" v-model="queryParam.partNumber"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a-popconfirm title="确定领取吗?" @confirm="() => handleInspection(record.id)">
            <a>领取</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <!-- è¡¨å•区域 -->
    <syncProcessSpecificationInfo-modal ref="modalForm" @ok="modalFormOk"></syncProcessSpecificationInfo-modal>
  </a-card>
</template>
<script>
  import '@assets/less/TableExpand.less'
  import SyncProcessSpecificationInfoModal from './modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction } from '@api/manage'
  export default {
    name: "SyncProcessSpecificationInfoList",
    mixins:[JeecgListMixin],
    components: {
      SyncProcessSpecificationInfoModal
    },
    data () {
      return {
        description: '三维工艺工艺规程信息管理页面',
        // è¡¨å¤´
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '产品名称',
            align:"center",
            dataIndex: 'productName'
          },
              {
            title: '产品代号',
            align:"center",
            dataIndex: 'productCode'
           },
              {
            title: '部件名称',
            align:"center",
            dataIndex: 'partName'
           },
              {
            title: '部件编号',
            align:"center",
            dataIndex: 'partNumber'
           },
              {
            title: '部件版本',
            align:"center",
            dataIndex: 'partVersion'
           },
              {
            title: '工艺规程编号',
            align:"center",
            dataIndex: 'planNumber'
           },
              {
            title: '工艺规程版本',
            align:"center",
            dataIndex: 'planVersion'
           },
              {
            title: '是否领取',
            align:"center",
            dataIndex: 'isReceive_dictText'
           },
              {
            title: '发布时间',
            align:"center",
            dataIndex: 'createTime'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/dnc/home/syncProcessSpecificationInfo",
          receiveInspectionOrder:"/dnc/home/receiveTree"
       },
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    methods: {
      /**
       * é¢†å–
       * @param id
       */
      handleInspection(id) {
        var that = this
        this.loading = true
        getAction(that.url.receiveInspectionOrder, { id })
          .then((res) => {
            if (res.success) {
              that.$notification.success({
                message: '消息',
                description: res.message
              })
              that.loadData()
            } else {
              that.$notification.warning({
                message: '消息',
                description: res.message
              })
              this.loading = false
            }
          })
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.Style#Drawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,158 @@
<template>
  <a-drawer
      :title="title"
      :width="800"
      placement="right"
      :closable="false"
      @close="close"
      :visible="visible">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataType" label="数据类型">
          <a-input placeholder="请输入数据类型" v-model="model.dataType" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeNo" label="更改单号">
          <a-input placeholder="请输入更改单号" v-model="model.changeNo" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partName" label="部件名称">
          <a-input placeholder="请输入部件名称" v-model="model.partName" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber" label="部件编号">
          <a-input placeholder="请输入部件编号" v-model="model.partNumber" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partVersion" label="部件版本">
          <a-input placeholder="请输入部件版本" v-model="model.partVersion" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planNumber" label="工艺规程编号">
          <a-input placeholder="请输入工艺规程编号" v-model="model.planNumber" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planVersion" label="工艺规程版本">
          <a-input placeholder="请输入工艺规程版本" v-model="model.planVersion" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isReceive" label="是否领取">
          <a-input placeholder="请输入是否领取" v-model="model.isReceive" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createDate" label="发布时间">
          <a-date-picker showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="model.createDate" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jsonData" label="json字符串信息">
          <a-input placeholder="请输入json字符串信息" v-model="model.jsonData" />
        </a-form-model-item>
      </a-form-model>
    </a-spin>
    <div class="drawer-bootom-button">
      <a-button type="primary" @click="handleOk">确定</a-button>
      <a-button type="primary" @click="handleCancel">取消</a-button>
    </div>
  </a-drawer>
</template>
<script>
  import { httpAction } from '@api/manage'
  import moment from "moment"
  export default {
    name: "SyncProcessSpecificationInfoModal",
    data () {
      return {
        title:"操作",
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules:{
        },
        url: {
          add: "/dnc/syncProcessSpecificationInfo/add",
          edit: "/dnc/syncProcessSpecificationInfo/edit",
        },
      }
    },
    created () {
    },
    methods: {
      add () {
        //初始化默认值
        this.edit({});
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        const that = this;
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
              that.close();
            })
          }else{
            return false;
         }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
<style lang="less" scoped>
  /**Button按钮间距*/
  .ant-btn {
    margin-left: 30px;
    margin-bottom: 30px;
    float: right;
  }
 /**抽屉按钮样式*/
  .drawer-bootom-button {
    position: absolute;
    bottom: -8px;
    width: 100%;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: right;
    left: 0;
    background: #fff;
    border-radius: 0 0 2px 2px;
  }
</style>
src/views/dnc/base/modules/SyncProcessSpecificationInfo/SyncProcessSpecificationInfoModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,138 @@
<template>
  <j-modal
    :title="title"
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataType" label="数据类型">
          <a-input placeholder="请输入数据类型" v-model="model.dataType" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeNo" label="更改单号">
          <a-input placeholder="请输入更改单号" v-model="model.changeNo" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partName" label="部件名称">
          <a-input placeholder="请输入部件名称" v-model="model.partName" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partNumber" label="部件编号">
          <a-input placeholder="请输入部件编号" v-model="model.partNumber" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="partVersion" label="部件版本">
          <a-input placeholder="请输入部件版本" v-model="model.partVersion" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planNumber" label="工艺规程编号">
          <a-input placeholder="请输入工艺规程编号" v-model="model.planNumber" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planVersion" label="工艺规程版本">
          <a-input placeholder="请输入工艺规程版本" v-model="model.planVersion" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isReceive" label="是否领取">
          <a-input placeholder="请输入是否领取" v-model="model.isReceive" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="createDate" label="发布时间">
          <a-date-picker showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="model.createDate" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jsonData" label="json字符串信息">
          <a-input placeholder="请输入json字符串信息" v-model="model.jsonData" />
        </a-form-model-item>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { httpAction } from '@api/manage'
  import moment from "moment"
  export default {
    name: "SyncProcessSpecificationInfoModal",
    data () {
      return {
        title:"操作",
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules:{
        },
        url: {
          add: "/dnc/syncProcessSpecificationInfo/add",
          edit: "/dnc/syncProcessSpecificationInfo/edit",
        },
      }
    },
    created () {
    },
    methods: {
      add () {
        //初始化默认值
        this.edit({});
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      close () {
        this.$emit('close');
        this.visible = false;
        this.$refs.form.clearValidate();
      },
      handleOk () {
        const that = this;
        // è§¦å‘表单验证
         this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
              that.close();
            })
          }else{
             return false;
          }
        })
      },
      handleCancel () {
        this.close()
      },
    }
  }
</script>
<style lang="less" scoped>
</style>