王震
2023-11-17 b8c0763607375198e37e4b98ed42793ba6606689
Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before
已修改16个文件
865 ■■■■■ 文件已修改
src/api/plan/manufacturingorder.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/warehouse/location.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/location/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/location/location-form.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basic/workstation/workstation-form.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/customerorder/customerorder-form.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/manufacturingorder/customerorder.vue 307 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/manufacturingorder/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/manufacturingorder/productorder-form.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/feed-pane.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/index.vue 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/operation-task-pane.vue 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/taskinfo-pane.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/workstationoperate-form.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/completeproductstructure/completeproductstructure-form.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/structure/single-structure-form.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/plan/manufacturingorder.js
@@ -80,6 +80,14 @@
  })
}
export function getProcessConfigFile(obj) {
  return request({
    url: '/mes/plan/customerOrder/processConfigFiles',
    method: 'get',
    params: obj
  })
}
export function checkOutTechnologyRouting(query) {
  return request({
    url: '/mes/plan/manufacturingOrder/checkout',
src/api/warehouse/location.js
@@ -106,3 +106,19 @@
    params: query
  })
}
export function getIfsLocationByGroupCopy(query) {
  return request({
    url: '/mes/location/getIfsLocation/copy',
    method: 'get',
    params: query
  })
}
export function getIfsLocationByGroupCopyAll(query) {
  return request({
    url: '/mes/location/getIfsLocationByGroupCopyAll',
    method: 'get',
    params: query
  })
}
src/views/basic/location/index.vue
@@ -198,7 +198,7 @@
          {
            minWidth: '200',
            prop: 'ifsLocation',
            label: 'ERP库位',
            label: 'IFS库位',
            sort: true,
            isTrue: false,
            isSearch: true,
src/views/basic/location/location-form.vue
@@ -135,11 +135,10 @@
      <el-row>
        <el-col :span="12">
          <el-form-item
            v-if="permissions.basic_has_ifs"
            label="IFS库位"
            prop="ifsLocationDesc"
          >
            <!--<el-select
            <!-- <el-select
              v-model="dataForm.ifsLocation"
              filterable
              placeholder="请选择IFS库位"
@@ -152,11 +151,11 @@
                :key="index"
              >
              </el-option>
            </el-select>-->
            </el-select> -->
            <el-cascader
              v-model="dataForm.ifsLocationDesc"
              :props="locationProps"
              style="width:100%"
              style="width:100%" filterable
            ></el-cascader>
          </el-form-item>
        </el-col>
@@ -219,6 +218,7 @@
      warehouseOptions: [],
      factoryOptions: [],
      ifsLocationOptions: [],
            locationTree: [],
      visible: false,
      dataForm: {
        id: 0,
@@ -262,34 +262,39 @@
      locationProps: {
        lazy: true,
        lazyLoad(node, resolve) {
          console.log('node', node)
          const { level } = node
          if (level === 0) {
            getIfsLocationGroup().then((response) => {
              if (response.data.code === 0) {
                const _data = response.data.data
                const nodes = _data.map((item) => {
                const nodes = JSON.parse(_data)["LIST_INFO"].map((item) => {
                  return {
                    value: item.LOCATION_GROUP,
                    label: item.LOCATION_GROUP,
                    value: item.LOCATION_GROUP_DESC +'-'+ item.LOCATION_GROUP,
                    label: item.LOCATION_GROUP_DESC +'-'+ item.LOCATION_GROUP,
                    leaf: false
                  }
                })
                                var set = new Set()
                                nodes.forEach(a=>{
                                    set.add(JSON.stringify(a))
                                })
                                var list = []
                                set.forEach(a=>{
                                    list.push(JSON.parse(a))
                                })
                // 通过调用resolve将子节点数据返回,通知组件数据加载完成
                resolve(nodes)
                resolve(list)
              }
            })
          } else {
            getIfsLocationByGroup({ locationGroup: node.value }).then(
            getIfsLocationByGroup({ locationNo: node.value.split('-')[1] }).then(
              (response) => {
                if (response.data.code === 0) {
                  const _data = response.data.data
                  const nodes = _data.map((item) => {
                  const nodes = JSON.parse(_data)["LIST_INFO"].map((item) => {
                    return {
                      value: item.LOCATION_NO,
                      label: item.LOCATION_NO,
                      label: item.LOCATION_DESC +' | '+ item.LOCATION_NO,
                      leaf: true
                    }
                  })
@@ -404,7 +409,32 @@
          this.isSubmit = false
        }
      })
    }
    },
        getLocationTree(){
            getIfsLocationGroup().then((res) => {
              if (res.data.code === 0) {
                    var strs = JSON.parse(res.data.data)['LIST_INFO']
                    var set3 = new Set()
                    var set2 = new Set()
                    var set = []
                    strs.forEach(a=>{
                        set2.add(a['LOCATION_GROUP_DESC'] + '-' + a['LOCATION_GROUP'])
                    })
                    strs.forEach(a=>{
                        set2.forEach(b=>{
                            if((a['LOCATION_GROUP_DESC'] + '-' + a['LOCATION_GROUP'])==b){
                                set3.add(a['LOCATION_DESC'] + '-' + a['LOCATION_NO'])
                            }
                            set.push({
                                value: b,
                                label: b,
                                children: []
                            })
                        })
                    })
              }
            })
        }
  }
}
</script>
src/views/basic/workstation/workstation-form.vue
@@ -138,7 +138,7 @@
          >
          </el-transfer>
        </el-tab-pane>
        <el-tab-pane label="产出不合格库位" name="disqualified">
        <!-- <el-tab-pane label="产出不合格库位" name="disqualified">
          <el-transfer
            filterable
            v-model="disqualifiedLocationIds"
@@ -159,7 +159,7 @@
            @change="handleChangeQualifiedLocation"
          >
          </el-transfer>
        </el-tab-pane>
        </el-tab-pane> -->
        <el-tab-pane label="检验待处理库位" name="pending">
          <el-transfer
            filterable
src/views/plan/customerorder/customerorder-form.vue
@@ -1299,9 +1299,6 @@
      this.getConfigFiles()
    },
    delProcessConfigFile(row) {
      if (row.lineNumber !== this.dataForm.otcLineNo) {
        this.$message.error('上传文件行号与当前销售订单行号不一致,不允许删除')
      } else {
        this.$confirm('是否删除工艺配置文件', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
@@ -1314,7 +1311,6 @@
          .then((data) => {
            this.getConfigFiles()
          })
      }
    },
    downloadProcessConfigFile(row) {
      downloadProcessConfigFile(
src/views/plan/manufacturingorder/customerorder.vue
@@ -22,18 +22,18 @@
        @keyup.enter.native="dataFormSubmit()"
        label-width="100px"
        class="l-mes productorder-order"
        :disabled="!editable"
      >
        <el-tabs type="border-card">
      <!-- :disabled="!editable" -->
        <el-tabs type="border-card" @tab-click="downs" v-model="activeFileName">
          <el-tab-pane label="主要" type="card">
            <el-row>
              <el-col :span="12">
                <el-form-item label="同步数据来源" prop="sourceId">
                  <el-input
                    v-model="dataForm.sourceId"
                    placeholder=""
                    :disabled="!ediSource"
                  ></el-input>
                 <el-input
                  v-model="dataForm.sourceId == 0 ? '同步' : '手动'"
                  placeholder=""
                  disabled
                ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
@@ -86,7 +86,7 @@
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
              <!-- <el-col :span="12">
                <el-form-item label="行号" prop="coLineNo">
                  <el-input
                    v-model="dataForm.coLineNo"
@@ -94,7 +94,17 @@
                    :disabled="!ediSource"
                  ></el-input>
                </el-form-item>
              </el-col>
              </el-col> -->
               <el-col :span="6">
              <el-form-item label="产品名称" prop="productName">
                <el-input
                  v-model="dataForm.productName"
                  placeholder=""
                  disabled
                >
                </el-input>
              </el-form-item>
            </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
@@ -121,9 +131,9 @@
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="期望交货时间" prop="wantedDeliveryDate">
                <el-form-item label="期望交货时间" prop="deliveryDate">
                  <el-date-picker
                    v-model="dataForm.wantedDeliveryDate"
                    v-model="dataForm.deliveryDate"
                    style="width: 100%"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
@@ -132,7 +142,16 @@
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
               <el-col :span="12">
                <el-form-item label="工艺文件名称" prop="docName">
                  <el-input
                    v-model="dataForm.docName"
                  placeholder=""
                  disabled
                  ></el-input>
                </el-form-item>
              </el-col>
              <!-- <el-col :span="12">
                <el-form-item label="计划交货时间" prop="plannedDeliveryDate">
                  <el-date-picker
                    v-model="dataForm.plannedDeliveryDate"
@@ -143,13 +162,37 @@
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              </el-col> -->
            </el-row>
            <el-card
            <el-row>
            <el-col :span="24">
              <el-form-item label="订单备注" prop="comment">
                <el-input
                   v-model="dataForm.comment"
                    placeholder=""
                    :disabled="!ediSource"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="产品备注" prop="remark">
                <el-input
                 v-model="dataForm.remark"
                    placeholder=""
                    :disabled="!ediSource"
                >
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
            <!-- <el-card
              header="订单参数"
              shadow="never"
              class="productorder-order-param"
            >
            > -->
              <el-row>
                <el-form-item
                  style="float:left;width: 50%"
@@ -166,8 +209,33 @@
              </el-row>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="附件" type="card">
          <el-tab-pane label="附件" type="card" name="附件">
            <div style="display: flex;justify-content:flex-end;">
            <div></div>
          </div>
          <div
            v-loading="progrecessFileLoading"
            element-loading-text="请稍等,文件上传中"
          >
            <el-upload
              drag
              ref="upload"
              action="/mes/plan/customerOrder/upload"
              :auto-upload="true"
              :headers="headers"
              :before-upload="submitUpload"
              :on-success="uploadSuccess"
              :data="paramData"
              :with-credentials="true"
              :show-file-list="false"
            >
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">
                将文件拖到此处,或<em>点击上传</em>
              </div>
            </el-upload>
          </div>
            <!-- <el-upload
              disabled
              action=""
              ref="upload"
@@ -176,10 +244,93 @@
              :on-preview="handlePreview"
              :with-credentials="true"
            >
            </el-upload>
            </el-upload> -->
            <el-table :data="processConfigFileTableData" height="400px">
            <el-table-column
              prop="orderNumber"
              align="center"
              label="订单号"
              show-overflow-tooltip
            >
            </el-table-column>
            <!-- <el-table-column prop="lineNumber" align="center" label="行号"> -->
            <!-- </el-table-column> -->
            <el-table-column
              prop="originalFileName"
              align="center"
              label="原文件名"
              width="200"
            >
            </el-table-column>
            <el-table-column prop="fileName" align="center" label="文件后缀">
            </el-table-column>
            <el-table-column prop="createUser" align="center" label="上传人">
            </el-table-column>
            <el-table-column
              prop="createTime"
              align="center"
              label="上传时间"
              show-overflow-tooltip
            >
            </el-table-column>
            <el-table-column prop="updateUser" align="center" label="更新人">
            </el-table-column>
            <el-table-column
              prop="updateTime"
              align="center"
              label="更新时间"
              show-overflow-tooltip
            >
            </el-table-column>
            <!--            <el-table-column align="center" label="是否同步工艺配置单">-->
            <!--              <template slot-scope="scope">-->
            <!--                <el-switch-->
            <!--                  :value="scope.row.effectiveRange"-->
            <!--                  active-value="1"-->
            <!--                  inactive-value="0"-->
            <!--                  @input="handleInput(scope.row)"-->
            <!--                  :disabled="scope.row.lineNumber !== dataForm.otcLineNo"-->
            <!--                />-->
            <!--              </template>-->
            <!--            </el-table-column>-->
            <el-table-column fixed="right" align="center" label="操作">
              <template slot-scope="scope">
                <!-- <el-button
                  @click="synchronizeFile(scope.row)"
                  type="text"
                  size="small"
                  :disabled="scope.row.lineNumber !== dataForm.customerNo"
                  >同步</el-button
                > -->
                <el-button
                  @click="delProcessConfigFile(scope.row)"
                  type="text"
                  size="small"
                  :disabled="scope.row.lineNumber !== dataForm.customerNo"
                  >删除</el-button
                >
                <el-button
                  @click="downloadProcessConfigFile(scope.row)"
                  type="text"
                  size="small"
                  >下载</el-button
                >
              </template>
            </el-table-column>
          </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-form>
      <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button
        type="primary"
        :disabled="buttonDisable"
        v-thinclick="`dataFormSubmit`"
        v-if="editable"
        >确定</el-button
      >
    </span>
    </el-tab-pane>
  </el-tabs>
</template>
@@ -196,11 +347,14 @@
  addCustomerOrder,
  download,
  getCustomerOrder,
  deleteProcessConfigFile,
  downloadProcessConfigFile,
  putCustomerOrder
} from '@/api/plan/customerorder'
import { remote } from '@/api/admin/dict'
import { validateSixDecimal } from '@/util/validate'
import { getCustomer } from '../../../api/plan/manufacturingorder'
import { getStore } from '@/util/store'
import { getCustomer,getProcessConfigFile } from '../../../api/plan/manufacturingorder'
export default {
  props: {
@@ -277,37 +431,71 @@
          { validator: validateSixDecimal, trigger: 'blur' }
        ]
      },
      paramData: {
        // range: '1',
        orderNumber: '',
        lineNumber: ''
      },
      headers: {
        Authorization: 'Bearer ' + getStore({ name: 'access_token' })
      },
      units: [],
      coStates: [
        // {
        //   value: '01plan',
        //   label: '待计划'
        // },
        // {
        //   value: '03planed',
        //   label: '已计划'
        // },
        // {
        //   value: '02planing',
        //   label: '计划中'
        // },
        // {
        //   value: '04complete',
        //   label: '已完成'
        // }
         {
          value: '01partUnCheck',
          label: '零件待选'
        },
        {
          value: '01plan',
          value: '02technologyUnCheck',
          label: '工艺文件待选'
        },
        {
          value: '03plan',
          label: '待计划'
        },
        {
          value: '03planed',
          label: '已计划'
          value: '04planed',
          label: '已下发'
        },
        {
          value: '02planing',
          label: '计划中'
          value: '05cancel',
          label: '已作废'
        },
        {
          value: '04complete',
          label: '已完成'
          value: '06unedit',
          label: '订单编辑'
        }
      ]
      ],
      processConfigFileTableData: [],
      activeFileName: ""
    }
  },
  computed: {
    editable: function() {
      if (!this.dataForm.id) {
        return true
      }
      if (this.dataForm.id && this.dataForm.coState !== '04complete') {
        return true
      }
      return false
    },
    // editable: function() {
    //   if (!this.dataForm.id) {
    //     return true
    //   }
    //   if (this.dataForm.id && this.dataForm.coState !== '04complete') {
    //     return true
    //   }
    //   return false
    // },
    ediSource: function() {
      if (!this.dataForm.id) {
        return true
@@ -360,8 +548,8 @@
            }
            this.fileList = response.data.data.customerOrderAttachmentList
            this.orderParamList = response.data.data.orderParamList
            //附件
            this.processConfigFileTableData = response.data.data.configFiles
            this.title =
              this.dataForm.customerName + this.dataForm.customerOrderNo
          })
@@ -371,6 +559,48 @@
          this.$refs.tabs.currentName = '0'
        }
      })
    },
    submitUpload() {
      this.paramData.orderNumber = this.dataForm.contractNo
      this.paramData.lineNumber = this.dataForm.customerNo
      this.progrecessFileLoading = true
    },
    uploadSuccess() {
      this.progrecessFileLoading = false
      this.downs()
    },
    //附件的查询
    downs(label, e){
      if(this.activeFileName=='附件'){
        console.log('1');
        getProcessConfigFile({
          orderNumber: this.dataForm.contractNo,
          lineNumber: this.dataForm.customerNo
        }).then((res)=>{
          this.processConfigFileTableData = res.data.data
        })
      }
    },
    downloadProcessConfigFile(row) {
      downloadProcessConfigFile(
        row.fileName,
        row.bucketName,
        row.originalFileName
      )
    },
    delProcessConfigFile(row) {
        this.$confirm('是否删除工艺配置文件', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
          closeOnClickModal: false
        })
          .then(function() {
            return deleteProcessConfigFile(row.id)
          })
          .then((data) => {
            this.downs()
          })
    },
    // 附件的点击
    handlePreview(file) {
@@ -425,6 +655,9 @@
    },
    handleTabClick(tab, event) {
      this.init(parseInt(tab.name))
      if(tab.name){
      }
    },
    // 零件选择
    openPartDialog() {
src/views/plan/manufacturingorder/index.vue
@@ -428,8 +428,8 @@
          },
          {
            minWidth: '120',
            prop: 'orderRemark',
            label: '销售订单备注',
            prop: 'remark',
            label: '备注',
            sort: true,
            isTrue: true,
            isSearch: true,
src/views/plan/manufacturingorder/productorder-form.vue
@@ -638,17 +638,11 @@
                </el-row>
                <el-row>
                  <el-table
                    default-expand-all
                    :data="components"
                    :data="components[0]"
                    @selection-change="structSelectionChange"
                    row-key="id"
                    border
                    :tree-props="{
                      children: 'children'
                    }"
                    style="width: 100%"
                    height="400px"
                    :default-sort="{ prop: 'index' }"
                  >
                    <el-table-column type="selection" width="40" fixed="left" />
                    <el-table-column
@@ -1071,6 +1065,7 @@
  data() {
    return {
      componentsTable:[],
      typeOptions: [],
      paramTemplateSelArr: [],
      paramTemplateSelCol: 'operationTemplateNo',
@@ -1232,6 +1227,7 @@
    this.getBomTypeDbOptions()
    this.getManufactureAttrs('manufacture_attr_type')
    this.getSysParam(sysParam.IS_REPORT_OPERATION)
    // console.log(this.components);
  },
  watch: {
    'dataForm.partId'(newValue, oldValue) {
@@ -1245,7 +1241,11 @@
        }
      }
    },
    components(newVal,oldVal){
      console.log("新",newVal);
      console.log("老",oldVal);
      console.log(this.components);
    },
    currentRouting(newValue, oldValue) {
      if (newValue && newValue.id) {
        if (this.dataForm.id != null && this.dataForm.id !== 0) {
@@ -1295,7 +1295,8 @@
      if (newValue && newValue.id) {
        // 查询产品结构对应的组件
        getBom(newValue.id).then((response) => {
          this.components = [response.data.data.tree]
          console.log("查",this.components);
          // this.components = [response.data.data.tree]
        })
      }
    },
@@ -1397,6 +1398,7 @@
    },
    // 查询当前车间订单信息
    getOrderInfo() {
      let that=this
      getManufacturingOrder(this.dataForm.id).then((response) => {
        this.dataForm = response.data.data
        // 把工艺挂上去
@@ -1416,7 +1418,7 @@
        }
        // 把产品结构组件挂上去
        if (this.dataForm.bomRoot) {
          this.components = [this.dataForm.bomRoot]
          that.components = [this.dataForm.bomRoot]
        }
      })
    },
src/views/product/workbench/feed-pane.vue
@@ -144,14 +144,14 @@
            ><span style="font-size:14px;font-weight:bold">线边仓合格物料</span>
          </div>
          <div>
            <el-button
            <!-- <el-button
              v-if="permissions.product_feed_scan"
              class="feeding-btn"
              type="primary"
              icon="feed-btn-feeding"
              @click="scanAddFeed()"
              >扫码投料</el-button
            >
            > -->
            <el-button
              class="feeding-btn"
              type="primary"
@@ -1130,7 +1130,7 @@
        ><span style="font-size:14px;font-weight:bold">已投入未消耗物料</span>
      </div>
      <div>
                <el-button
                <!-- <el-button
                  class="return-btn"
                  type="primary"
                  @click="submitIns()"
@@ -1141,7 +1141,7 @@
                  type="primary"
                  @click="inputHandle()"
                  >尾料处理</el-button
                >
                > -->
        <el-button
          class="return-btn"
          type="primary"
src/views/product/workbench/index.vue
@@ -256,7 +256,7 @@
                            >
                          </div>
                        </div>
                        <div class="start-end-div">
                        <div class="start-end-div"  >
                          <div>
                            <span
                              style="margin-left:8px;font-size:12px;line-height:32px;"
@@ -528,35 +528,36 @@
              </el-form-item>
            </el-form>
          </div>
          <div class="task-div-content">
            <div v-if="!isShowNormalTracking" class="task-list-div">
              <operationTaskPane
                ref="operateTaskDiv"
                :workstationId="dutyForm.workstationId"
                :productSn="operateTaskForm.SN"
                :orderNumber="operateTaskForm.orderNumber"
                :spec="operateTaskForm.spec"
                :outBatchNo="operateTaskForm.outBatchNo"
                :mpsNo="operateTaskForm.mpsNo"
                @changeCurrOperateTask="changeCurrOperateTask"
                @refreshReport="refreshWorkReportPageData"
              />
            </div>
            <div v-if="isShowNormalTracking" class="task-list-div">
              <operationTaskTable
                ref="operateTaskTableDiv"
                :workstationId="dutyForm.workstationId"
                :productSn="operateTaskForm.SN"
                :orderNumber="operateTaskForm.orderNumber"
                :spec="operateTaskForm.spec"
                :mpsNo="operateTaskForm.mpsNo"
                @changeCurrOperateTask="changeCurrOperateTask"
              />
            </div>
          </div>
          <div class="task-div-content" >
    <div v-if="!isShowNormalTracking" class="task-list-div" >
      <operationTaskPane
        ref="operateTaskDiv" :style="{ backgroundColor: taskStatusColor() }"
        :workstationId="dutyForm.workstationId"
        :productSn="operateTaskForm.SN"
        :orderNumber="operateTaskForm.orderNumber"
        :spec="operateTaskForm.spec"
        :outBatchNo="operateTaskForm.outBatchNo"
        :mpsNo="operateTaskForm.mpsNo"
        @changeCurrOperateTask="changeCurrOperateTask"
        @refreshReport="refreshWorkReportPageData"
      />
    </div>
    <div v-if="isShowNormalTracking" class="task-list-div" >
      <operationTaskTable
        ref="operateTaskTableDiv" :style="{ backgroundColor: taskStatusColor() }"
        :workstationId="dutyForm.workstationId"
        :productSn="operateTaskForm.SN"
        :orderNumber="operateTaskForm.orderNumber"
        :spec="operateTaskForm.spec"
        :mpsNo="operateTaskForm.mpsNo"
        @changeCurrOperateTask="changeCurrOperateTask"
      />
    </div>
  </div>
        </div>
      </div>
      <div :style="{ width: mainMiddleWidth }" v-show="mainMiddleShow">
      <div :style="{ width: mainMiddleWidth } " v-show="mainMiddleShow">
        <div style="height:86px;width:14px;position: absolute;top:50%">
          <el-tooltip effect="dark" content="收缩" placement="left">
            <img
@@ -1437,6 +1438,7 @@
  box-sizing: border-box;
  overflow-y: auto;
  margin-bottom: 10px;
}
.task-list-div {
@@ -1560,6 +1562,10 @@
  },
  data() {
    return {
      dutyForm: {},
      operateTaskForm: {},
      isShowNormalTracking: false,
      // taskStatusColor: '',
      showBan: false,
      dutyCanEdit: false,
      saveButton: false,
@@ -1666,96 +1672,9 @@
      currItem: 'task'
    }
  },
  computed: {
    ...mapGetters(['userInfo', 'tagWel', 'permissions'])
  },
  created() {
    document.title = '工作台——MES'
    if (!this.dutyForm.workstationId) {
      const k = localStorage.getItem(storage_key)
      if (k) {
        this.dutyForm.workstationId = parseInt(k)
      }
    }
    this.initOptions()
    this.getSysParam(sysParam.SHOW_STEP_BUSINESS)
    this.getTrackingParam(sysParam.SHOW_TRACKING_TYPE)
    this.timer = setInterval(this.clockTimer, 1000)
  },
  watch: {
    'dutyForm.workstationId'(val) {
      if (val) {
        localStorage.setItem(storage_key, val)
      }
      // 工作站改变时,整个页面的动态数据需实时加载、页面缓存数据需 初始化
      this.initPageVariable()
      this.loadInfoByWorkstation()
    },
    'dutyForm.startTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'dutyForm.endTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'operateTaskForm.orderNumber'(val) {
      /* this.$nextTick(() => {
        this.queryInfoForOrderNumber()
      }) */
    },
    'operateTaskForm.spec'(val) {
      if (val == '' || val == null) {
        this.SNs = []
        this.operateTaskForm.SN = ''
      } else {
        const that = this
        that.SNs = []
        getProductSnByCustomerNoAndPartName({
          customerOrderNo: this.operateTaskForm.orderNumber,
          partName: val
        }).then((res) => {
          const result = res.data.data
          result.forEach(function(item) {
            const obj = {
              key: item,
              value: item
            }
            that.SNs.push(obj)
          })
        })
      }
      this.$nextTick(() => {
        if (this.partNames.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.SN'(val) {
      this.$nextTick(() => {
        if (this.SNs.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.outBatchNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    },
    'operateTaskForm.mpsNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    }
  },
  methods: {
    changeCurrOperateTask() {},
    refreshWorkReportPageData() {},
    refreshOperateTasksByConditions() {
      this.$nextTick(() => {
        this.refreshOperateTasks()
@@ -2597,6 +2516,113 @@
    beforeDestroy() {
      clearInterval(this.timer)
    }
  },
  computed: {
    ...mapGetters(['userInfo', 'tagWel', 'permissions']),
    taskStatusColor() {
    return function() {
      const now = new Date();
      const threeDaysAgo = new Date(now - 3 * 24 * 60 * 60 * 1000);
      const oneDayAgo = new Date(now - 24 * 60 * 60 * 1000);
      const today = new Date(now);
      if (threeDaysAgo <= today && today <= oneDayAgo) {
        return 'yellow';
      } else if (today <= threeDaysAgo) {
        return 'blue';
      } else {
        return 'red';
      }
    };
  }
  },
  created() {
    document.title = '工作台——MES'
    if (!this.dutyForm.workstationId) {
      const k = localStorage.getItem(storage_key)
      if (k) {
        this.dutyForm.workstationId = parseInt(k)
      }
    }
    this.initOptions()
    this.getSysParam(sysParam.SHOW_STEP_BUSINESS)
    this.getTrackingParam(sysParam.SHOW_TRACKING_TYPE)
    this.timer = setInterval(this.clockTimer, 1000)
  },
  watch: {
    'dutyForm.workstationId'(val) {
      if (val) {
        localStorage.setItem(storage_key, val)
      }
      // 工作站改变时,整个页面的动态数据需实时加载、页面缓存数据需 初始化
      this.initPageVariable()
      this.loadInfoByWorkstation()
    },
    'dutyForm.startTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'dutyForm.endTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'operateTaskForm.orderNumber'(val) {
      /* this.$nextTick(() => {
        this.queryInfoForOrderNumber()
      }) */
    },
    'operateTaskForm.spec'(val) {
      if (val == '' || val == null) {
        this.SNs = []
        this.operateTaskForm.SN = ''
      } else {
        const that = this
        that.SNs = []
        getProductSnByCustomerNoAndPartName({
          customerOrderNo: this.operateTaskForm.orderNumber,
          partName: val
        }).then((res) => {
          const result = res.data.data
          result.forEach(function(item) {
            const obj = {
              key: item,
              value: item
            }
            that.SNs.push(obj)
          })
        })
      }
      this.$nextTick(() => {
        if (this.partNames.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.SN'(val) {
      this.$nextTick(() => {
        if (this.SNs.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.outBatchNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    },
    'operateTaskForm.mpsNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    }
  },
}
</script>
src/views/product/workbench/operation-task-pane.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <el-alert
    <el-alert
      v-if="!operationTasks || operationTasks.length == 0"
      title="还没有工单下发到此机台!"
      type="warning"
@@ -8,76 +8,76 @@
    >
    </el-alert>
    <el-card
      v-for="(item, index) in operationTasks"
      @click.native="setCheckFlag(item)"
      shadow="hover"
      :key="index"
      :class="['task-item', item.checkFlag ? 'card-checked' : 'card-unchecked']"
  v-for="(item, index) in operationTasks"
    @click.native="setCheckFlag(item)"
  shadow="hover"
  :key="index"
  :class="['task-item', item.checkFlag ? 'card-checked' : 'card-unchecked']"
>
  <!-- <img class="selectedImg" /> -->
  <div class="header" >
    <div>工单号:{{ item.taskNo }}</div>
    <!-- <div>计划号:{{ item.mpsNo }}</div> -->
    <div
      :class="[
        'status-change-div',
        item.checkFlag ? 'card-checked-status' : 'card-status'
      ]"
    >
      <img class="selectedImg" src="/img/workbench/icon_selected.png" />
      <div class="header">
        <div>工单号:{{ item.taskNo }}</div>
        <!-- <div>计划号:{{ item.mpsNo }}</div> -->
        <div
          :class="[
            'status-change-div',
            item.checkFlag ? 'card-checked-status' : 'card-status'
          ]"
        >
          <el-select
            v-if="permissions.product_operationTask_state"
            v-model="item.statusAction"
            placeholder="功能菜单"
            @change="
              changeTaskState(item.statusAction, item.status, item.id, item)
            "
          >
            <el-option
              v-for="ele in statusActions"
              :key="ele.value"
              :label="ele.label"
              :value="ele.value"
              :disabled="ele.disabled"
            >
            </el-option>
          </el-select>
        </div>
      </div>
      <div class="body">
        <div class="row">
          <div class="l">零件名称:</div>
          <div class="r">{{ item.partName }}</div>
        </div>
        <div class="row">
          <div class="l">零件号:</div>
          <div class="r">{{ item.partNo }}</div>
        </div>
        <!-- <div class="row">
          <div class="l">成品:</div>
          <div class="r">{{ item.productName }}</div>
        </div> -->
        <div class="row">
          <div class="l">计划完成时间:</div>
          <div class="r">{{ item.planFinishDay }}</div>
        </div>
      </div>
      <el-progress
        class="task-progress"
        :text-inside="true"
        :stroke-width="20"
        :percentage="
          Number((item.completedQuantity / item.plannedQuantity).toFixed(2)) *
            100 >
          100
            ? 100
            : Number(
                (item.completedQuantity / item.plannedQuantity).toFixed(2)
              ) * 100
      <el-select
        v-if="permissions.product_operationTask_state"
        v-model="item.statusAction"
        placeholder="功能菜单"
        @change="
          changeTaskState(item.statusAction, item.status, item.id, item)
        "
        :format="formatPercentage(item.completedQuantity, item.plannedQuantity)"
      ></el-progress>
    </el-card>
      >
        <el-option
          v-for="ele in statusActions"
          :key="ele.value"
          :label="ele.label"
          :value="ele.value"
          :disabled="ele.disabled"
        >
        </el-option>
      </el-select>
    </div>
  </div>
  <div class="body">
    <div class="row">
      <div class="l">零件名称:</div>
      <div class="r">{{ item.partName }}</div>
    </div>
    <div class="row">
      <div class="l">零件号:</div>
      <div class="r">{{ item.partNo }}</div>
    </div>
    <!-- <div class="row">
      <div class="l">成品:</div>
      <div class="r">{{ item.productName }}</div>
    </div> -->
    <div class="row">
      <div class="l">计划完成时间:</div>
      <div class="r">{{ item.planFinishDay }}</div>
    </div>
  </div>
  <el-progress
    class="task-progress"
    :text-inside="true"
    :stroke-width="20"
    :percentage="
      Number((item.completedQuantity / item.plannedQuantity).toFixed(2)) *
        100 >
      100
        ? 100
        : Number(
            (item.completedQuantity / item.plannedQuantity).toFixed(2)
          ) * 100
    "
    :format="formatPercentage(item.completedQuantity, item.plannedQuantity)"
  ></el-progress>
</el-card>
  </div>
</template>
<style lang="scss" scoped>
@@ -96,10 +96,13 @@
  border-radius: 12px;
  cursor: pointer;
  position: relative;
background:none;
  box-shadow: 1px 2px 24px 1px rgba(4, 0, 0, 0.14);
  & + .task-item {
    margin-top: 10px;
  }
  &.card-checked {
    // color: white;
    background-image: -webkit-linear-gradient(
@@ -344,6 +347,28 @@
    }
  },
  methods: {
    // setCheckFlag(item) {
    //   this.$nextTick(() => {
    //     this.changeBackgroundColor(item.planFinishDay);
    //   });
    // },
    // changeBackgroundColor(dateString) {
    //   const date = new Date(dateString);
    //   const threeDaysAgo = new Date();
    //   threeDaysAgo.setDate(threeDaysAgo.getDate() - 3);
    //   const oneDayAgo = new Date();
    //   oneDayAgo.setDate(oneDayAgo.getDate() - 1);
    //   if (date <= threeDaysAgo) {
    //     document.body.style.backgroundColor = "blue";
    //   } else if (date <= oneDayAgo) {
    //     document.body.style.backgroundColor = "yellow";
    //   } else {
    //     document.body.style.backgroundColor = "red";
    //   }
    // },
    // 点击工单,选中工单
    setCheckFlag(item) {
      if (item.checkFlag) {
src/views/product/workbench/taskinfo-pane.vue
@@ -891,6 +891,7 @@
  getGenerateSN,
  getShiftProductOutByOpIdAndWsId
} from '@/api/product/personboard'
import {
  getTemplate,
  getDocumentJgt,
src/views/product/workbench/workstationoperate-form.vue
@@ -1,5 +1,6 @@
<template>
  <div style="width: 100%;height: 100%"></div>
</template>
<style lang="scss" scoped>
.ws-header {
src/views/technology/completeproductstructure/completeproductstructure-form.vue
@@ -134,6 +134,7 @@
            <el-table-column label="零件名称" prop="partName"></el-table-column>
            <el-table-column label="单位" prop="unit"></el-table-column>
            <el-table-column label="数量" prop="qpa"></el-table-column>
            <el-table-column label="盘数" prop="discNum"></el-table-column>
          </el-table>
          <!-- <el-table
            class="tree-select-table"
src/views/technology/structure/single-structure-form.vue
@@ -209,8 +209,8 @@
                }}</span>
              </template>
            </el-table-column>
            <el-table-column label="图号" prop="drawingNumber" align="center">
            </el-table-column>
            <!-- <el-table-column label="图号" prop="drawingNumber" align="center">
            </el-table-column> -->
            <el-table-column align="center" label="操作" width="85px">
              <template slot-scope="scope">
                <el-button