Browse Source

解決衝突

main
Cheng 1 year ago
parent
commit
6b11b84608
  1. 16
      wms/contract/api/postContractNewApplyData.php
  2. 4
      wms/contract/contract-download.php
  3. 17
      wms/contract/contract-new-apply.php
  4. BIN
      wms/contract/images/contracts_new_files/m202312201449117041v7041M1汰改合約書.doc
  5. 18
      wms/contract/js/alpine.js
  6. 4
      wms/mkt/pricereview-create.php

16
wms/contract/api/postContractNewApplyData.php

@ -201,6 +201,21 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 0
$stmt ->bindParam(':updated_by', $updated_by); $stmt ->bindParam(':updated_by', $updated_by);
$stmt ->execute(); $stmt ->execute();
} }
$deleted_at = date("Y-m-d H:i:s");
$removefiles = json_decode($_POST['removefiles'], true);
print_r($removefiles);
if(count($removefiles) > 0){
foreach($removefiles as $file){
$sql_str = "UPDATE contract_apply_files SET deleted_at = :deleted_at WHERE id = :fileid";
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':deleted_at', $deleted_at);
$stmt ->bindParam(':fileid', $file);
$stmt ->execute();
}
}
header("HTTP/1.1 201 success!"); header("HTTP/1.1 201 success!");
$conn->commit(); $conn->commit();
@ -251,6 +266,7 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 2
$progress = $_POST['progress']; $progress = $_POST['progress'];
$review_comment = $_POST['review_comment']; $review_comment = $_POST['review_comment'];
$user_id = $_POST['review_person_id']; $user_id = $_POST['review_person_id'];
echo $user_id;
$review_date = date('Y-m-d H:i:s'); $review_date = date('Y-m-d H:i:s');
$conn->beginTransaction(); $conn->beginTransaction();
try{ try{

4
wms/contract/contract-download.php

@ -144,7 +144,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
非制式合約 非制式合約
</label> --> </label> -->
</div> </div>
<button @click="isBuyInputIng = true" class="rebtn">重新輸入</button> <!-- <button @click="isBuyInputIng = true" class="rebtn">重新輸入</button> -->
<button @click="exportFn(1)" class="prviewbtn">預覽</button> <button @click="exportFn(1)" class="prviewbtn">預覽</button>
<div class="contract" id="noStandardBuyContract" x-show="!toggleBuyStandard"> <div class="contract" id="noStandardBuyContract" x-show="!toggleBuyStandard">
<table class="my-2 contract" x-ref="contract1" id="contract1"> <table class="my-2 contract" x-ref="contract1" id="contract1">
@ -270,7 +270,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
非制式合約 非制式合約
</label> --> </label> -->
</div> </div>
<button @click="isInstallInputIng = true" class="rebtn">重新輸入</button> <!-- <button @click="isInstallInputIng = true" class="rebtn">重新輸入</button> -->
<button @click="exportFn(2)" class="prviewbtn">預覽</button> <button @click="exportFn(2)" class="prviewbtn">預覽</button>

17
wms/contract/contract-new-apply.php

@ -92,6 +92,7 @@ if(empty($contract_new_apply)){
} }
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; $sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$sql_str = "SELECT contract_apply_files.file_name, contract_apply_files.id as id FROM contract_new_apply JOIN contract_apply_files ON contract_new_apply.id = contract_apply_files.contract_id WHERE contract_new_apply.mid = :contract_id AND contract_apply_files.deleted_at IS NULL";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contract_id', $id); $stmt->bindParam(':contract_id', $id);
$stmt->execute(); $stmt->execute();
@ -451,7 +452,6 @@ $person = $contract['person'];
</td> </td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td colspan="4">附件上傳</td> <td colspan="4">附件上傳</td>
@ -459,9 +459,15 @@ $person = $contract['person'];
<?php if($status < 1): ?> <?php if($status < 1): ?>
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" /> <input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
<?php endif; ?> <?php endif; ?>
<?php foreach($files as $file): ?> <template x-for="file in data.originfiles">
<a href="./images/contracts_new_files/<?php echo $file['file_name']; ?>" download><?php echo $file['file_name']; ?></a> <?php if($status < 1): ?><span style="margin-left:10px;cursor:pointer;color:#f019">X</span><?php endif; ?><br /> <template x-if="file">
<?php endforeach; ?> <div>
<a :href="'./images/contracts_new_files/' + file.file_name" download x-text="file.file_name" ></a>
<span @click="removeFile(file.id)" style="margin-left:10px;cursor:pointer;color:#f019">X</span>
</div>
</template>
</template>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -501,7 +507,7 @@ $person = $contract['person'];
</tr> </tr>
<tr> <tr>
<td>業務承辦人</td> <td>業務承辦人</td>
<td><span><?php echo (isset($contract['review_person_name']) || empty($contract['review_person_name'])) ? "---" : $contract['review_person_name'] ."(".$contract['review_person_id'].")"; ?></span></td> <td><span><?php echo (!isset($contract['review_person_name']) || empty($contract['review_person_name'])) ? "---" : $contract['review_person_name'] ."(".$contract['review_person_id'].")"; ?></span></td>
<td> <td>
<?php if($status == 3): ?><span class="successtext">結案同意</span><?php endif; ?> <?php if($status == 3): ?><span class="successtext">結案同意</span><?php endif; ?>
<?php if($status == 2): ?><span class="failtext">結案不同意</span><?php endif; ?> <?php if($status == 2): ?><span class="failtext">結案不同意</span><?php endif; ?>
@ -636,6 +642,7 @@ $person = $contract['person'];
const secondPayDeadline = <?php echo $secondPayDeadline ?? ''; ?>; const secondPayDeadline = <?php echo $secondPayDeadline ?? ''; ?>;
const total_items = <?php echo $contract['total_items'] ?? ''; ?>; const total_items = <?php echo $contract['total_items'] ?? ''; ?>;
const contract_new_apply_id = <?php echo $contract_new_apply_id; ?>; const contract_new_apply_id = <?php echo $contract_new_apply_id; ?>;
const originfiles = [...<?php echo json_encode($files); ?>];
</script> </script>

BIN
wms/contract/images/contracts_new_files/m202312201449117041v7041M1汰改合約書.doc

Binary file not shown.

18
wms/contract/js/alpine.js

@ -1212,6 +1212,8 @@ const contractNewApply = () => {
secondPayDeadline: secondPayDeadline, secondPayDeadline: secondPayDeadline,
total_items: total_items, total_items: total_items,
files: [], files: [],
removefiles: [],
originfiles: originfiles,
}, },
pays: { pays: {
1: { 1: {
@ -1297,6 +1299,7 @@ const contractNewApply = () => {
form.append('user_id', user_id); form.append('user_id', user_id);
form.append('pays', JSON.stringify(this.pays)); form.append('pays', JSON.stringify(this.pays));
form.append('status', 0); form.append('status', 0);
form.append('removefiles', JSON.stringify(this.data.removefiles))
form.append('salesman_comment', this.data.salesman_comment); form.append('salesman_comment', this.data.salesman_comment);
for (var i = 0; i < this.data.files.length; i++) { for (var i = 0; i < this.data.files.length; i++) {
form.append('files[]', this.data.files[i]); form.append('files[]', this.data.files[i]);
@ -1309,7 +1312,7 @@ const contractNewApply = () => {
} else if (res.status === 200) { } else if (res.status === 200) {
alert('更新成功'); alert('更新成功');
console.log(res.data); console.log(res.data);
window.location.reload(); // window.location.reload();
} }
this.isLoading = false this.isLoading = false
}).catch(error => { }).catch(error => {
@ -1400,9 +1403,7 @@ const contractNewApply = () => {
}) })
}, },
disagree() { disagree() {
if (!confirm('確定退回嗎?')) { if (!confirm('確定退回嗎?')) return;
return;
}
this.isLoading = true this.isLoading = true
const form = new FormData(); const form = new FormData();
form.append('contract_new_apply_id', contract_new_apply_id); form.append('contract_new_apply_id', contract_new_apply_id);
@ -1415,7 +1416,7 @@ const contractNewApply = () => {
if (res.status === 200) { if (res.status === 200) {
alert('退回成功'); alert('退回成功');
console.log(res.data); console.log(res.data);
window.location.reload(); // window.location.reload();
} }
this.isLoading = false this.isLoading = false
}).catch(error => { }).catch(error => {
@ -1426,6 +1427,13 @@ const contractNewApply = () => {
uploadFiles(e) { uploadFiles(e) {
this.data.files = e.target.files this.data.files = e.target.files
}, },
removeFile(id) {
if (!confirm('確定移除該檔案嗎?')) return;
console.log(id);
this.data.removefiles.push(id);
this.data.originfiles.splice(id, 1);
this.data.originfiles = this.data.originfiles.filter(file => file.id != id)
}
} }
} }

4
wms/mkt/pricereview-create.php

@ -2113,6 +2113,10 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
<label for="special_fee">特殊費用</label> <label for="special_fee">特殊費用</label>
<input type="text" name="special_fee" id="special_fee" value="<?php if (isset($last_pr_arr["special_fee"])) echo number_format($last_pr_arr["special_fee"]); ?>"> <input type="text" name="special_fee" id="special_fee" value="<?php if (isset($last_pr_arr["special_fee"])) echo number_format($last_pr_arr["special_fee"]); ?>">
</div> </div>
<div>
<label for="special_fee">服務費</label>
<input type="text" name="service_fee" id="service_fee" value="0">
</div>
<div> <div>
<label for="price_broken">破價(台)</label> <label for="price_broken">破價(台)</label>
<input type="text" name="price_broken" id="price_broken" class="dollar-right" value="<?php if (isset($last_pr_arr["qty_total"]) && $last_pr_arr["qty_total"]>0) { <input type="text" name="price_broken" id="price_broken" class="dollar-right" value="<?php if (isset($last_pr_arr["qty_total"]) && $last_pr_arr["qty_total"]>0) {

Loading…
Cancel
Save