WorkingSuppilerList.vue 16.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
<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="报工类型">
              <j-dict-select-tag v-model="queryParam.type" placeholder="请选择报工类型"
                                 dictCode="working_type"/>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="部门">
              <j-select-depart placeholder="请选择部门" v-model="queryParam.depart"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="操作者">
              <j-select-user-by-dep placeholder="请选择操作者" v-model="queryParam.operater"/>
            </a-form-item>
          </a-col>
          <a-col :xl="10" :lg="11" :md="12" :sm="24">
            <a-form-item label="完成日期">
              <j-date placeholder="请选择开始日期" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
                      v-model="queryParam.createTime_begin"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date placeholder="请选择结束日期" class="query-group-cust" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"
                      v-model="queryParam.createTime_end"></j-date>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="工单号">
                <a-input placeholder="请输入工单号" v-model="queryParam.code"></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.materialname"></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.drawingno"></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.technologyName"></a-input>
              </a-form-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-item label="工艺">
                <j-popup v-model="queryParam.technology" code="getPurchaseCraft"
                         field="name"
                         :param="param1"
                         orgFields="name,code"
                         destFields="name,code" :trigger-change="true" @callback="findCarNumberClick2" :multi="true"/>
              </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.qty"></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.weight"></a-input>-->
            <!--              </a-form-item>-->
            <!--            </a-col>-->
          </template>
          <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="search" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button type="primary" icon="download" @click="handleExportXls('工时统计')">导出</a-button>
    </div>
    <!--    <span-->
    <!--      style="font-size: 18px">报工人数:{{ workContent.num }},总工时:{{ workContent.totalHour }}小时,{{-->
    <!--        workContent.totalMinutes-->
    <!--      }}分钟</span>-->
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
        style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt=""
               style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
            <a @click="editFrom(record)">初审</a>
        </span>

      </a-table>
    </div>
    <working-modal ref="modalForm" @ok="modalFormOk"></working-modal>
    <working-compare ref="splitPanelModal"></working-compare>
    <SuppilerQqForm ref="suppilerForm" @clearSelect="clearSelect"></SuppilerQqForm>
    <plm-pic-modal ref="plmModal"></plm-pic-modal>
    <edit-form ref="editFrom" @clearSelect="clearSelect"></edit-form>
    <j-popup
      v-show="showRentPrise"
      ref="attendance_record"
      code="find_attendance_records"
      :param="Param"
      org-fields="username,realname"
      dest-fields="popup,other"
      field="popup"/>
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import WorkingModal from './modules/WorkingModal'
import WorkingCompare from "./WorkingCompare";
import SuppilerQqForm from "./modules/SuppilerQqForm";
import {getOnlyDrawId, getSid} from "../../api/api";
import PlmPicModal from "../scheduler/modules/PlmPicModal";
import editForm from "./modules/editForm";

export default {
  name: 'WorkingSuppilerList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    WorkingModal, WorkingCompare, SuppilerQqForm, PlmPicModal, editForm
  },
  data() {
    return {
      Param: {work_no: ''},
      formData: "",
      description: '外协(油漆)统计',
      selectValue: "",
      param1: {code: '', name: ''},
      id: '',
      ids: [],
      picUrl: [],
      picUrl2: [],
      picInfoList: [],
      picAll: [],
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: 'id',
          align: "center",
          dataIndex: 'id',
        },
        {
          title: '部门',
          align: "center",
          dataIndex: 'depart_dictText'
        },
        {
          title: '操作者',
          align: "center",
          dataIndex: 'operater_dictText'
        },
        {
          title: '工单号',
          align: "center",
          dataIndex: 'code'
        },
        {
          title: '部件名称',
          align: "center",
          dataIndex: 'materialname'
        },
        {
          title: '图号',
          align: "center",
          dataIndex: 'drawingno'
        },
        // {
        //   title: '规格型号',
        //   align: "center",
        //   dataIndex: 'spec'
        // },
        {
          title: '工序',
          align: "center",
          dataIndex: 'technology_dictText'
        },
        {
          title: '合格数量',
          align: "center",
          dataIndex: 'qty'
        },
        {
          title: '重量',
          align: "center",
          dataIndex: 'weight'
        },
        {
          title: '料号',
          align: "center",
          dataIndex: 'no'
        },
        {
          title: '创建日期',
          align: "center",
          dataIndex: 'createTime',
          customRender: function (text) {
            return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '两底面漆(M2)',
          align: "center",
          dataIndex: 'area1'
        }, {
          title: '仅底漆(M2)',
          align: "center",
          dataIndex: 'area2'
        },
        {
          title: '仅面漆(M2)',
          align: "center",
          dataIndex: 'area3'
        },

        {
          title: '喷塑面积(M2)',
          align: "center",
          dataIndex: 'psArea'
        },
        {
          title: '喷塑重量(KG)',
          align: "center",
          dataIndex: 'psWeight'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: "center",
          fixed: "right",
          width: 200,
          scopedSlots: {customRender: 'action'}
        }
      ],
      url: {
        list: "/working/working/wxSuppilerList",
        delete: "/working/working/delete",
        deleteBatch: "/working/working/deleteBatch",
        exportXlsUrl: "/working/working/exportXls",
        importExcelUrl: "working/working/importExcel",
      },
      dictOptions: {},
      superFieldList: [],
      workContent: {}
    }
  },
  created() {
    this.getSuperFieldList();
    //this.calculateWorkingList();
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    },
  },
  methods: {
    workingQuery() {
      if (this.queryParam.createTime_begin == '') {
        this.$message.warning("请选择开始时间!!")
        return false;
      }
      var sdata = this.queryParam.createTime_begin;
      var edata = this.queryParam.createTime_end;
      //var url='http://172.16.43.49:8080/jeecg-boot/jmreport/view/779930954305630208?sdata='+sdata+'&edata='+edata;
      var url = 'http://mts.huahengweld.com/jeecg-boot/jmreport/view/779930954305630208?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzUwODk3NTUsInVzZXJuYW1lIjoiY2hlbmFvIn0.gU3T9C3DDau-fXOF4XZ12F8kMRRkigunm8yx5tct7Ws&sdata=' + sdata + '&edata=' + edata;
      window.open(url, '_blank');
    },
    workOrderTimeQuery() {
      if (this.queryParam.createTime_begin == '') {
        this.$message.warning("请选择开始时间!!")
        return false;
      }
      var sdata = this.queryParam.createTime_begin;
      var edata = this.queryParam.createTime_end;
      //var url='http://172.16.43.49:8080/jeecg-boot/jmreport/view/779930954305630208?sdata='+sdata+'&edata='+edata;
      var url = 'http://mts.huahengweld.com/jeecg-boot/jmreport/view/780221852637720576?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzUxNTM3OTYsInVzZXJuYW1lIjoiY2hlbmFvIn0.XOsKnzycliauY5lAIc3kY9rtTTmW0az7VUHi4e7XK7c&sdata=' + sdata + '&edata=' + edata;
      window.open(url, '_blank');
    },
    editFrom(record) {
      this.$refs.editFrom.edit(record);

    },
    workDepartTimeQuery() {
      if (this.queryParam.createTime_begin == '') {
        this.$message.warning("请选择开始时间!!")
        return false;
      }
      var sdata = this.queryParam.createTime_begin;
      var edata = this.queryParam.createTime_end;
      //var url='http://172.16.43.49:8080/jeecg-boot/jmreport/view/779930954305630208?sdata='+sdata+'&edata='+edata;
      var url = 'http://mts.huahengweld.com/jeecg-boot/jmreport/view/780327236593512448?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzUxNTQ0NTksInVzZXJuYW1lIjoiY2hlbmFvIn0.AjxoWCOG4fgQEEXFwym529DpoZXyhGI0xSildllHN9I&sdata=' + sdata + '&edata=' + edata;
      window.open(url, '_blank');
    },
    workCompare() {
      this.$refs.splitPanelModal.show(123);
    },

    clearSelect() {
      this.loadData();
    },

    findCarNumberClick2(row) {
      this.queryParam.technology = row.code;
    },

    initDictConfig() {
    },
    getFormFieldValue(field) {
      return this.form.getFieldValue(field)
    },
    popupCallback(row) {
      this.form.setFieldsValue(row)
    },
    search() {
      this.searchQuery();
    },
    // calculateWorkingList() {
    //   const that = this;
    //   let obj = calculateWorking(this.queryParam);
    //   obj.then((res) => {
    //     console.log("workTotal:");
    //     that.workContent = res;
    //     console.log("workTotal:" + that.workContent.totalHour);
    //   })
    // },
    getSuperFieldList() {
      let fieldList = [];
      fieldList.push({type: 'sel_depart', value: 'depart', text: '部门'})
      fieldList.push({type: 'sel_user', value: 'operater', text: '操作者'})
      fieldList.push({type: 'string', value: 'code', text: '工单号', dictCode: ''})
      fieldList.push({type: 'string', value: 'materialname', text: '部件名称', dictCode: ''})
      fieldList.push({type: 'string', value: 'drawingno', text: '图号', dictCode: ''})
      fieldList.push({type: 'string', value: 'technology', text: '工序', dictCode: ''})
      fieldList.push({type: 'BigDecimal', value: 'qty', text: '合格数量', dictCode: ''})
      fieldList.push({type: 'string', value: 'weight', text: '重量', dictCode: ''})
      fieldList.push({type: 'BigDecimal', value: 'techonlogytime', text: '工艺工时', dictCode: ''})
      fieldList.push({type: 'BigDecimal', value: 'completetime', text: '实际工时', dictCode: ''})
      fieldList.push({type: 'BigDecimal', value: 'approvedtime', text: '核定工时', dictCode: ''})
      fieldList.push({type: 'string', value: 'remark', text: '备注', dictCode: ''})
      fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''})
      fieldList.push({type: 'string', value: 'updateBy', text: '更新人', dictCode: ''})
      fieldList.push({type: 'date', value: 'updateTime', text: '更新日期'})
      this.superFieldList = fieldList
    },
    attendanceRecordClick(data) {
      this.Param['work_no'] = "'" + data.operater + "'"
      this.$refs.attendance_record.openModal();
    },
    openDraw(record) {

      if (this.isLock) {
        this.$message.info("图纸加载中,请勿频繁点击....")
        return false;
      }
      if (record.no == '') {
        this.$message.info("当前生产计划不是从PLM导入,无法查看图纸....")
        return false;
      }
      let params = {
        'name': record.materialname,
        'f08': record.drawingno,
        'no': record.no,
        'uuid': '',
        'sid': ''
      }
      this.ids = [];
      this.picUrl = [];
      this.picUrl2 = [];
      this.picAll = [];
      //this.isLock = true
      var id = '';
      getOnlyDrawId(params).then((res) => {
        id = res.result;
        if (res.code == 500) {
          this.$message.error(res.message);
          return false;
        }
        this.$message.info("图纸打开中....")
        if (res.code == 0) {
          this.picInfoList = res.result
          getSid().then((res) => {
            var json = JSON.parse(res.result);
            if (json.errcode == "0") {
              window.open("http://172.16.0.137:8087/sipmweb/web/search/detail?rid=" + json.errmsg + "&id=" + id + "&t=DWGSW", "_blank");
              this.isLock = false
            } else {
              this.$message.error("接口鉴权失败")
              this.isLock = false
            }
          })
        } else {
          this.$message.error("数据异常,未找到图纸")
        }
      })

    },
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>