Selaa lähdekoodia

拆分备件申购新增跟特殊申购

duanxiaoduan 1 vuosi sitten
vanhempi
commit
daea2dad1d
1 muutettua tiedostoa jossa 177 lisäystä ja 5 poistoa
  1. 177 5
      src/views/custom/subscribe/index.vue

+ 177 - 5
src/views/custom/subscribe/index.vue

@@ -186,6 +186,179 @@
                 <el-input ref="providerName" v-model="createTemp.providerName" disabled />
               </el-form-item>
             </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="备件:" prop="partCode">
+                <el-autocomplete
+                  v-model="createTemp.partCode"
+                  value-key="name"
+                  class="inline-input"
+                  :fetch-suggestions="sparePartSearch"
+                  placeholder="请输入备件编号或备件名称或备件规格"
+                  style="width:100%"
+                  ref="autocomplete"
+                  @select="handleSelectSparePart"
+                >
+                  <template slot-scope="{ item }">
+                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
+                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
+                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
+                  </template>
+                </el-autocomplete>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <el-table
+          :key="tableKey"
+          v-loading="listLoading"
+          element-loading-text="给我一点时间"
+          :data="listAdd"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;margin-bottom:30px"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable"
+        >
+          <!-- table表格 -->
+          <el-table-column label="序号" align="center" type="index" width="50px" />
+          <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
+            <template slot-scope="scope">
+              <el-popover placement="right" title="" trigger="hover">
+                <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
+                <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
+              </el-popover>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
+            <template slot-scope="scope">
+              <span v-if="dialogStatus==='create'">{{ scope.row.brandName }}</span>
+              <span v-if="dialogStatus==='update'">{{ scope.row.brandName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
+            <template slot-scope="scope">
+              <span>{{ scope.row.unit }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="现有库存" prop="reportery" align="center" min-width="60">
+            <template slot-scope="scope">
+              <span v-if="createTemp.providerId == '' || parseFloat(createTemp.purchaseType) > 0">{{ scope.row.reportery }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="价格" prop="price" align="center" min-width="60">
+            <template slot-scope="scope">
+              <span v-if="createTemp.providerId == ''">{{ scope.row.price }}</span>
+              <el-form v-else :model="scope.row" :rules="rules">
+                <el-form-item prop="price">
+                  <el-input v-model="scope.row.price" style="margin-top:15px" />
+                </el-form-item>
+              </el-form>
+            </template>
+          </el-table-column>
+          <el-table-column label="申购数量" min-width="120px" align="center" valign="middle">
+            <template slot-scope="scope">
+              <el-form :model="scope.row" :rules="rules">
+                <el-form-item prop="amount">
+                  <el-input v-model="scope.row.amount" style="margin-top:15px" />
+                </el-form-item>
+              </el-form>
+            </template>
+          </el-table-column>
+          <el-table-column label="备注" min-width="110px" align="center" valign="middle">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.purpose" />
+            </template>
+          </el-table-column>
+          <!-- <el-table-column label="使用周期" min-width="120px" align="center" prop="lifeCycle" />
+          <el-table-column label="合同差异项" min-width="120px" align="center" prop="contractVarianceItem" /> -->
+          <el-table-column
+            label="操作"
+            align="center"
+            width="100"
+            class-name="small-padding fixed-width"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <a class="del" @click="partDelete(row)">删除</a>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div slot="footer" class="dialog-footer" style="bottom:10px">
+          <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus==='create'" @click="add_dialog_save()">保存并关闭</el-button>
+          <el-button type="primary" :disabled="isokDisable" v-else-if="dialogStatus==='update'" @click="edit_dialog_save()">保存并关闭</el-button>
+          <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 特殊申购 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible2" :close-on-click-modal="false" width="90%">
+      <div class="app-container">
+        <el-form
+          ref="createTemp"
+          :rules="rules"
+          :model="createTemp"
+          label-position="right"
+          label-width="100px"
+          style="width: 90%;margin:0 auto;"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="申购单号:" prop="orderNumber">
+                <el-input ref="orderNumber" v-model="createTemp.orderNumber" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="牧场:" prop="pastureId">
+                <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changePasture">
+                  <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="申购部门:" prop="departmentId">
+                <el-select v-model="createTemp.departmentId" placeholder="申购部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changeDepart">
+                  <el-option v-for="item in createDepartList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="申购人:" prop="employeId">
+                <el-select v-model="createTemp.employeId" placeholder="申购人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
+                  <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="申购日期:" prop="createTime">
+                <el-date-picker v-model="createTemp.createTime" :picker-options="pickerOptions" type="date" placeholder="申购日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='update'" />
+              </el-form-item>
+            </el-col>
+            <el-col v-if="dialogStatus==='update'" :span="8">
+              <el-form-item label="线上采购:" prop="providerName">
+                <el-input ref="providerName" v-model="createTemp.providerName" disabled />
+              </el-form-item>
+            </el-col>
             <el-col v-if="dialogStatus==='special' && createTemp.purchaseType == '1' || createTemp.purchaseType == '3'" :span="8">
               <el-form-item label="供应商:" prop="providerId">
                 <el-select v-model="createTemp.providerId" placeholder="供应商" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
@@ -345,10 +518,8 @@
           </el-table-column>
         </el-table>
         <div slot="footer" class="dialog-footer" style="bottom:10px">
-          <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus==='create'" @click="add_dialog_save()">保存并关闭</el-button>
-          <el-button type="primary" :disabled="isokDisable" v-else-if="dialogStatus==='update'" @click="edit_dialog_save()">保存并关闭</el-button>
-          <el-button type="primary" :disabled="isokDisable" v-else-if="dialogStatus==='special'" @click="special_dialog_save()">保存并关闭</el-button>
-          <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
+          <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus==='special'" @click="special_dialog_save()">保存并关闭</el-button>
+          <el-button @click="dialogFormVisible2 = false;get_table_data()">取消并关闭</el-button>
         </div>
       </div>
     </el-dialog>
@@ -714,6 +885,7 @@ export default {
       list: [],
       dialogStatus: '',
       dialogFormVisible: false,
+      dialogFormVisible2: false,
       dialogFormVisibleSee: false,
       listLoadingSee: true,
       listSee: [],
@@ -2198,7 +2370,7 @@ export default {
       this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
       this.getCreateDepartDownList()
       this.dialogStatus = 'special'
-      this.dialogFormVisible = true
+      this.dialogFormVisible2 = true
       this.$nextTick(() => {
         this.$refs['createTemp'].clearValidate()
       })